CI: Test on the range of supported Python versions (and supporting changes)#858
Open
LukeShu wants to merge 2 commits intoyaqwsx:masterfrom
Open
CI: Test on the range of supported Python versions (and supporting changes)#858LukeShu wants to merge 2 commits intoyaqwsx:masterfrom
LukeShu wants to merge 2 commits intoyaqwsx:masterfrom
Conversation
Contributor
Author
|
v2: Minor touch-up of how I install the |
The error message does not mention 'v9' or 'v9-testing', which it has supported for some time.
I wanted to make a change, but was worried about breaking things for older Pythons, so let's adjust CI to test on all supported versions (setup.py says `python_requires='>=3.7'`), so I can be confident in the changes. You know, what CI is for. Ideally, this would just be adding a dimension to the matrix and adding a call to `actions/setup-python`. Well, turns out: - setup-kicad/setup.sh needs some quite a bit of modification to work with the actions/setup-python install of Python. On the bright side, I think I managed to clean it up a bit. The ugly part is that we have to build wxPython for that install of Python (we use the system install of wxWidgets though, which is important because _pcbnew.so links against the system wxWidgets). This is tricky for Python >=3.12 because supporting newer Python and older wxWidgets in the same wxPython actually requires us to modify wxPython a bit. This adds maybe 15min to the run; perhaps we could improve that with caching, but if so: that is for another commit. - The actions/setup-python install is user-writable, so we shouldn't use `sudo` when `pip install`ing things to it. - On several supported versions of Python, pip uses build isolation by default. This means that pcbnew.py isn't visible when setup.py is being evaluated. I opted to solve this by moving the pcbnew check from build-time:setup.py run-time:kikit/ui.py. - kikit/typing.py (since KiKit v1.0.3, 2022-03-01) uses typing.Protocol, which was added in Python 3.8. So I bumped setup.py's python_requires to 3.8. - PcbDraw doesn't support Python 3.13 yet, because it uses Pillow~=9.0 and Pillow didn't support 3.13 until 11.something. So we need to install PcbDraw to a different Python than the one we're using for KiKit. PS: FWIW, I verified that the tests do not pass with KiCad v7, affirming the existing `matrix.kicad-version` to already have have the widest possible range of versions.
Contributor
Author
|
Rebased to resolve merge conflicts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I wanted to make a change, but was worried about breaking things for older Pythons, so let's adjust CI to test on all supported versions (setup.py says
python_requires='>=3.7'), so I can be confident in the changes. You know, what CI is for.Ideally, this would just be adding a dimension to the matrix and adding a call to
actions/setup-python. Well, turns out:setup-kicad/setup.sh needs some quite a bit of modification to work with the actions/setup-python install of Python. On the bright side, I think I managed to clean it up a bit.
The ugly part is that we have to build wxPython for that install of Python (we use the system install of wxWidgets though, which is important because _pcbnew.so links against the system wxWidgets). This is tricky for Python >=3.12 because supporting newer Python and older wxWidgets in the same wxPython actually requires us to modify wxPython a bit. This adds maybe 15min to the run; perhaps we could improve that with caching, but if so: that is for another commit.
The actions/setup-python install is user-writable, so we shouldn't use
sudowhenpip installing things to it.On several supported versions of Python, pip uses build isolation by default. This means that pcbnew.py isn't visible when setup.py is being evaluated. I opted to solve this by moving the pcbnew check from build-time:setup.py run-time:kikit/ui.py.
kikit/typing.py (since KiKit v1.0.3, 2022-03-01) uses typing.Protocol, which was added in Python 3.8. So I bumped setup.py's python_requires to 3.8.
PcbDraw doesn't support Python 3.13 yet, because it uses Pillow~=9.0 and Pillow didn't support 3.13 until 11.something. So we need to install PcbDraw to a different Python than the one we're using for KiKit.
PS: FWIW, I verified that the tests do not pass with KiCad v7, affirming the existing
matrix.kicad-versionto already have have the widest possible range of versions.