-
-
Notifications
You must be signed in to change notification settings - Fork 335
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Cython to CI #2942
Add Cython to CI #2942
Conversation
…to make sure we can repro the error
…licitly install distutils
… .. idk really what difference that could make
pypy+cython seems to sort of be a thing: https://docs.cython.org/en/latest/src/userguide/pypy.html
|
.github/workflows/ci.yml
Outdated
python -m pip install --upgrade pip setuptools | ||
python -m pip install "cython${{ matrix.cython}}" | ||
- name: install trio | ||
# use -e? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think editable installs isn't the normal case and those are weird:tm:
So I think it's better to test non-editable installs of trio
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was randomly using Black's CI as a reference: https://github.com/search?q=repo%3Apsf%2Fblack+%22python+-m+pip+install+-e%22&type=code
I have no clue why they're doing -e
tho
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meh we'll find out if we need it
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2942 +/- ##
=======================================
Coverage 99.64% 99.64%
=======================================
Files 117 117
Lines 17564 17564
Branches 3166 3166
=======================================
Hits 17502 17502
Misses 43 43
Partials 19 19
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we ever find some way to run the whole test suite under Cython that might be worth switching over (too much effort if it doesn't already exist though), but for now this works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me
Looking around more for cython+pytest I found https://shwina.github.io/cython-testing/ and after messing around with that for a bit I made some progress and managed to run sync test functions, so "just" need to inject our async magic somewhere in there as well and I might close in on running the full test suite. I also somehow triggered the error from #2908 due to running against an old trio version in my messing around, despite cython being >3, so I wanna track that down and potentially report it upstream. But we can merge this for now, and then I'll open another PR if/when I make progress on running the full test suite. |
after some wrangling I've got Cython going in the CI. Though so much of CI is ~magic I probably have something configured badly.
I vote for testing cython<3 and cython>=3 on latest python, but if @njsmith or @Zac-HD or somebody else has any reasons to test older versions, or on non-ubuntu, or on other python versions (and pypy?). Could even go so far as to add it to
ci.sh
and test it on everything, which I think would add something like 4-7 seconds.test_cython.pyx
could of course also be much more extensive, though grepping forCython
I'm only getting a hit for the one comment insrc/trio/_core_run.py
so doesn't seem like there's a lot of code that has been specially adapted for Cython. Maybe catch some exceptions? pytest does not seem to be a thing for cython, so running the full test suite or whatever I think is out of the question.