diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index de794382..b3a6fdd2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -42,6 +42,9 @@ jobs: - "3.10" os: - ubuntu-latest + extension: + - "skip_cython" + - "use_cython" runs-on: ${{ matrix.os }} steps: - uses: actions/checkout@v3 @@ -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 diff --git a/build.py b/build.py index 058be070..4eca0540 100644 --- a/build.py +++ b/build.py @@ -1,6 +1,7 @@ """Build optional cython modules.""" import contextlib +import os from distutils.command.build_ext import build_ext @@ -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 diff --git a/src/dbus_fast/_private/marshaller.py b/src/dbus_fast/_private/marshaller.py index e55de9ec..30ffd1e0 100644 --- a/src/dbus_fast/_private/marshaller.py +++ b/src/dbus_fast/_private/marshaller.py @@ -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."""