Restrict setuptools version in CI workflow#171
Restrict setuptools version in CI workflow#171alexanderwerning wants to merge 6 commits intomasterfrom
Conversation
pkg_resources was removed in setuptools 82, but sacred depends on it pypa/setuptools#5174
Python 3.7 reached end of life in mid 2023, the setuptools version mismatch breaks tests
There was a problem hiding this comment.
Pull request overview
This PR aims to keep CI green by preventing setuptools upgrades that remove pkg_resources (which is still required by the sacred dependency used in the repo’s [all]/test extras).
Changes:
- Pin
setuptoolsto a fixed version during CI dependency installation. - Remove the Ubuntu 22.04 / Python 3.7 CI job from the test matrix.
- Stabilize a
to_listdoctest output by forcingnp.int64dtype.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
.github/workflows/tests.yml |
Pins setuptools in the CI install step and adjusts the OS/Python matrix (dropping 3.7/ubuntu-22.04). |
padertorch/utils.py |
Adjusts a doctest to explicitly use np.int64 for consistent pretty-printed output. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| - name: Install python dependencies | ||
| run: | | ||
| python -m pip install --upgrade pip setuptools wheel | ||
| python -m pip install --upgrade pip setuptools==75.3.4 wheel |
There was a problem hiding this comment.
Pinning to an exact setuptools==75.3.4 is more restrictive than necessary for the stated issue (pkg_resources removal in setuptools 82) and may require extra maintenance. Consider using a bounded constraint (e.g., <82) and/or adding an inline comment explaining the pin so it's clear when/why it can be relaxed.
| python -m pip install --upgrade pip setuptools==75.3.4 wheel | |
| # Pin setuptools below 82 to avoid pkg_resources removal; keep minimum at 75.3.4 for compatibility. | |
| python -m pip install --upgrade pip "setuptools>=75.3.4,<82" wheel |
| python-version: [3.8, 3.9, "3.10", "3.11", "3.12"] | ||
| os: [ubuntu-latest] | ||
| include: | ||
| - os: ubuntu-22.04 | ||
| python-version: 3.7 | ||
| - os: macos-latest | ||
| python-version: "3.12" |
There was a problem hiding this comment.
This hunk removes the Ubuntu 22.04 / Python 3.7 job, which (a) changes CI coverage and (b) leaves a now-dead reference to ubuntu-22.04 later in the workflow (Install linux dependencies uses if: ... || matrix.os == 'ubuntu-22.04'). If dropping 3.7/22.04 is intended, please also update the later if condition accordingly (and consider noting the coverage change in the PR description).
Restrict installation of linux dependencies to only 'ubuntu-latest'.
pkg_resources was removed in setuptools 82, but sacred depends on it.
For more information see: pypa/setuptools#5174