Conversation
* add workaround for py39 on macos installed with broken setuptools Signed-off-by: Stephen L Arnold <[email protected]>
|
I don't understand the pupose of the tox.ini changes. And I don't like the idea of a release workflow as we also need to concurrently release on PyPI. I actually plan to finish another refactoring of the workflow as you can see at #307 . Could you test that on non-Windows stuff and disregard the "deprecated module" error? |
.github/workflows/ci.yml
Outdated
| os: [ubuntu-latest, windows-latest] | ||
| fail-fast: false | ||
| matrix: | ||
| os: [ubuntu-22.04, macos-latest, windows-latest] |
There was a problem hiding this comment.
| os: [ubuntu-22.04, macos-latest, windows-latest] | |
| # macOS in Intel, macOS on ARM, Ubuntu on x64, Ubuntu on ARM, Windows on X64 | |
| os: [macos-13, macos-latest, ubuntu-latest, ubuntu-24.04-arm, windows-latest, windows-2025] |
.github/workflows/ci.yml
Outdated
| cache: 'pip' | ||
| cache-dependency-path: '**/test-requirements' | ||
| env: | ||
| SETUPTOOLS_USE_DISTUTILS: ${{ matrix.os == 'macos-latest' && matrix.python-version == '3.9' && 'stdlib' || 'local' }} |
There was a problem hiding this comment.
Distutils is history. Let’s drop it.
There was a problem hiding this comment.
Still required until py39 and py310 are history
| python -m pip install --upgrade pip | ||
| python -m pip install -e .[dev] | ||
| python -m pip install 'tox-gh-actions<4.0.0' | ||
| pip install tox tox-gh-actions |
There was a problem hiding this comment.
Not really needed with tox -e py in GitHub Actions.
There was a problem hiding this comment.
tox -e py is implicitly selecting whatever python version is the environment default and we don't want that.
There was a problem hiding this comment.
We specified the Python environment in the python action step.
| cache: 'pip' | ||
| cache-dependency-path: '**/test-requirements' | ||
| env: | ||
| SETUPTOOLS_USE_DISTUTILS: ${{ matrix.os == 'macos-latest' && matrix.python-version == '3.9' && 'stdlib' || 'local' }} |
There was a problem hiding this comment.
This is about specifically what versions of bundled python modules are installed with the (now older) python on the Github CI runners. It has nothing to do with the project packaging.
There was a problem hiding this comment.
Yes, and we don't need distutils in any Python version.
|
I can confirm that is not true; we use setuptools.
…--
Cheers,
Aᴀʀᴏɴ
|
574de9c to
2d52dec
Compare
…lease * py313 is not quite ready yet but everything else should be green Signed-off-by: Stephen L Arnold <[email protected]>
2d52dec to
5503276
Compare
It's just release automation, and should work for pypi if you uncomment the last job.
That ^^ refactor branch is broken in CI for the py313 issue, as well as on the windows CI runners. Works on linux and macos with the same distutils workaround. |
|
aaronliu0130
left a comment
There was a problem hiding this comment.
Thanks for taking the time to write all this! We definitely could use release automation, but as it stands I feel like this is too overcomplicated. You'll also probably need to rework this after the tox.ini changes in #317 are merged.
| bash | ||
|
|
||
| deps = | ||
| -e .[test,dev] |
There was a problem hiding this comment.
Is there an advantage for this over "extras"?
There was a problem hiding this comment.
Visibility? otherwise it's just -e .
There was a problem hiding this comment.
Does that change anything? AFAIK tox sandboxes the environment anyways.
| passenv = | ||
| DISPLAY | ||
| XAUTHORITY | ||
| HOME | ||
| USERNAME | ||
| USER | ||
| XDG_* | ||
| CI | ||
| OS | ||
| PYTHONIOENCODING | ||
| PIP_DOWNLOAD_CACHE | ||
|
|
||
| setenv = | ||
| PYTHONPATH = {toxinidir} | ||
|
|
||
| allowlist_externals = | ||
| bash |
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| os: [macos-15, macos-latest, ubuntu-latest, ubuntu-22.04, ubuntu-24.04-arm, windows-latest, windows-2025] |
There was a problem hiding this comment.
I thought wheels were platform-independent.
There was a problem hiding this comment.
non-platform wheels are, but the point here is the platform environments are different.
There was a problem hiding this comment.
Hm, I don't quite get what you're saying. Could you elaborate on the possible differences?
There was a problem hiding this comment.
I don't quite get what your objection and/or alternative is. Can you elaborate more on what you want? I'm not trying to be weird here, but the really simple/short workflows don't seem to "last" very long due to arbitrary changes in runner environments. I just had to fix coverage workflows in several different repos this week after GitHub suddenly decided to stop finding the right version ov llvm-cov (after the same workflows were working fine for literally years).
| @@ -1,20 +1,100 @@ | |||
| [tox] | |||
| envlist = py38, py39, py3.10, py311, py312, pypy3 | |||
| envlist = pypy3,py3{9,10,11,12,13}-{linux,macos,windows} | |||
There was a problem hiding this comment.
I'm fairly sure a machine where you run tox can only have one OS loaded at a time. Is this needed?
There was a problem hiding this comment.
That ^^ matrix is how tox constructs env commands, including PLATFORM matrix.
There was a problem hiding this comment.
What is the PLATFORM matrix for?
| {envpython} -m pytest {posargs:} | ||
| {envpython} -m pylint cpplint.py | ||
| {envpython} -m flake8 cpplint.py | ||
| bash -c 'rm -rf build/ dist/ __pycache__/ *.egg-info/ .coverage' |
There was a problem hiding this comment.
Is there a reason to specifically use bash here? Why not
| bash -c 'rm -rf build/ dist/ __pycache__/ *.egg-info/ .coverage' | |
| rm -rf build/ dist/ __pycache__/ *.egg-info/ .coverage |
There was a problem hiding this comment.
In this case either bash or rm needs to be in the allow list. Bash is usually my default "allow" and that gets used to run any other shell commands. In this it's just "rm".
There was a problem hiding this comment.
GitHub workflows have an allowlist for commands?
| runs-on: ${{ matrix.os }} | ||
| defaults: | ||
| run: | ||
| shell: bash |
There was a problem hiding this comment.
I don't see any bash-specific features used.
There was a problem hiding this comment.
Better that than dash. It's generally better to set what you want and not let GH runner environment decide.
There was a problem hiding this comment.
But we're only using sh features.
There was a problem hiding this comment.
IMO this is a very good addition to any GHA workflow. Keeping to strictly sh is not normal behaviour for devs now - and there are some subtle gotchas when not using an explicit shell , c.f. rhysd/actionlint#374
|
Please rebase because |
|
There's too many problems and conflicts now that Christian's pyproject.toml has been merged. Please separate out the release workflow into a new PR if you wish to pursue it. |
Sorry, I couldn't wait for open PRs to merge so I tested the 2 C-compat PRs (#306 and #308) and this cleanup PR in the relevant workflow and our project CI is Green again. This PR also contains a GH release workflow to publish GH release from a tag push. Thanks!