Skip to content

Commit

Permalink
fix: add SKIP_CYTHON option
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco committed Oct 1, 2022
1 parent f26bd00 commit 5d55e92
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ jobs:
- "3.10"
os:
- ubuntu-latest
extension:
- "skip_cython"
- "use_cython"
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
Expand All @@ -55,7 +58,12 @@ jobs:
python-version: ${{ matrix.python-version }}
cache: "poetry"
- name: Install Dependencies
run: poetry install
run: |
if [ "${{ matrix.extension }}" = "skip_cython" ]; then
SKIP_CYTHON=1 poetry install
else:
poetry install
fi
- name: Test with Pytest
run: export $(dbus-launch); poetry run pytest --cov-report=xml
- name: Upload coverage to Codecov
Expand Down
3 changes: 3 additions & 0 deletions build.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""Build optional cython modules."""

import contextlib
import os
from distutils.command.build_ext import build_ext


Expand All @@ -13,6 +14,8 @@ def build_extensions(self):


def build(setup_kwargs):
if os.environ.get("SKIP_CYTHON", False):
return
with contextlib.suppress(Exception):
from Cython.Build import cythonize

Expand Down
2 changes: 1 addition & 1 deletion src/dbus_fast/_private/marshaller.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
class Marshaller:
"""Marshall data for Dbus."""

__slots__ = ("signature_tree", "buffer", "body")
__slots__ = ("signature_tree", "_buf", "body")

def __init__(self, signature: str, body: List[Any]) -> None:
"""Marshaller constructor."""
Expand Down

0 comments on commit 5d55e92

Please sign in to comment.