dynamically add supported Python versions to tox matrix, drawing from package metadata (requires-python)#326
Open
zacharyburnett wants to merge 5 commits intoOpenAstronomy:mainfrom
Open
Conversation
11af006 to
35089ae
Compare
Contributor
Author
|
EDIT: never mind it was a dumb issue with conditionals, ignore this for now! @Cadair if you have time, could you take a look at why it's failing here: https://github.com/OpenAstronomy/github-actions-workflows/actions/runs/19116707014/job/54627509255?pr=326#step:5:13 it looks to me like it's trying to install the script as a package, though I'm not sure why |
67770c8 to
dfa841f
Compare
astrofrog
reviewed
Nov 7, 2025
e824962 to
602c646
Compare
0c4cdd1 to
f792b1f
Compare
f792b1f to
c6edc3f
Compare
43ac311 to
13f5ab5
Compare
python-requires
python-requiresrequires-python
requires-pythonrequires-python
requires-pythonrequires-python)
928d17a to
5af0ed7
Compare
ad72251 to
339dabd
Compare
Cadair
reviewed
Mar 10, 2026
Cadair
reviewed
Mar 10, 2026
8b954b5 to
1ea502c
Compare
zacharyburnett
commented
Mar 10, 2026
… package metadata (`requires-python`)
Co-authored-by: Stuart Mumford <stuart@cadair.com>
1ea502c to
e1a7215
Compare
zacharyburnett
commented
Mar 10, 2026
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.
closes #325
adds
fill,fill_platforms, andfill_factorsparameters to thetox.ymlworkflow call.fill: truewill append toxenvs to the existingenvs:list, namely the currently supported Python versions, with factors fromfill_factorsand repeated for each platform infill_platforms.Python versions are first drawn from the current public Python releases that are not yet end-of-life (pulled from
endoflife.dateAPI), and then filtered based on therequires-pythonpins in the package metadata, if it exists.For instance, setting
for
jwst(which currently specifiesrequires-python = ">=3.11,<3.14") adds the following toxenvs toenvs:To read the metadata, I imported
peppyproject, a Python project metadata abstraction library I wrote to convertsetup.cfgtopyproject.toml(but it also works well in this use case, as it will input metadata frompyproject.toml,setup.cfg, orsetup.py).