Skip to content

Commit

Permalink
Migrate to Cython3 (#813)
Browse files Browse the repository at this point in the history
* Fix asyncio tests

* Convert class-private attributes to just private

* Upgrade to Cython 3

* Regenerate C files

* Fix tox coverage report
  • Loading branch information
ZipFile authored Nov 4, 2024
1 parent 13a7ef6 commit 595daeb
Show file tree
Hide file tree
Showing 12 changed files with 204,491 additions and 144,752 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/tests-and-linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,18 @@ jobs:
name: Run tests with coverage
runs-on: ubuntu-latest
env:
# Cython's version <3 issue with tracing: "error: no member named 'use_tracing' in 'struct _PyCFrame'"
# DEPENDENCY_INJECTOR_DEBUG_MODE: 1
DEPENDENCY_INJECTOR_DEBUG_MODE: 1
PIP_VERBOSE: 1
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: 3.12
- run: pip install tox cython==0.29.37
- run: pip install tox 'cython>=3,<4'
- run: make cythonize
- run: tox
- run: tox -vv
env:
TOXENV: coveralls

Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ VERSION := $(shell python setup.py --version)

CYTHON_SRC := $(shell find src/dependency_injector -name '*.pyx')

CYTHON_DIRECTIVES = -Xlanguage_level=2
CYTHON_DIRECTIVES = -Xlanguage_level=3

ifdef DEPENDENCY_INJECTOR_DEBUG_MODE
CYTHON_DIRECTIVES += -Xprofile=True
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cython==0.29.37
cython>=3,<4
pytest
pytest-asyncio
tox
Expand Down
2 changes: 1 addition & 1 deletion requirements-ext.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
flask==2.1.3
werkzeug==2.2.2
aiohttp==3.9.0b1
aiohttp
Loading

0 comments on commit 595daeb

Please sign in to comment.