admin管理员组

文章数量:1393874

I'm looking for a way to programmatically list all minor Python releases consistent with a required_python string parsed from a pyproject.toml file.

For example, suppose the parsed required_python string is >=3.10. Then as of today the script should return:

["3.10", "3.11", "3.12", "3.13"]  # note: doesn't include pre-releases

(Unless other scripting languages or tools simplify the job considerably, I have a slight preference for the solution to be in python itself as the rest of the script used to get the required_python string is in python.)


Background: I am trying to set up a Github Actions workflow with a matrix strategy that includes all supported Python versions of a package. The plan is to first extract those versions in a prior job and then feed them into the matrix.

My best plan so far involves parsing / to manually check all releases consistent with the requirement string. But this seems an awful lot of code for something that seems like there should be a much easier solution.

本文标签: continuous integrationList all Python releases satisfying requirementsStack Overflow