-
Notifications
You must be signed in to change notification settings - Fork 295
workflow and automation cleanups #309
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
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
fail-fast: false | ||
matrix: | ||
os: [ubuntu-22.04, macos-latest, windows-latest] |
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Distutils is history. Let’s drop it.
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.
Still required until py39 and py310 are history
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.
Not true.
- name: Install dependencies | ||
run: | | ||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not really needed with tox -e py
in GitHub Actions.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Distutils is history.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
|
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there an advantage for this over "extras"?
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.
Visibility? otherwise it's just -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.
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 |
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.
Are these really needed?
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought wheels were platform-independent.
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.
non-platform wheels are, but the point here is the platform environments are different.
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.
Hm, I don't quite get what you're saying. Could you elaborate on the possible differences?
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 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That ^^ matrix is how tox constructs env commands, including PLATFORM matrix.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
GitHub workflows have an allowlist for commands?
@@ -11,29 +11,43 @@ concurrency: | |||
jobs: | |||
build-test: | |||
runs-on: ${{ matrix.os }} | |||
defaults: | |||
run: | |||
shell: bash |
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 don't see any bash-specific features used.
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But we're only using sh
features.
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.
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!