Skip to content
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

Allow Python versions higher than 3.9 #878

Merged
merged 1 commit into from
Oct 12, 2024

Conversation

norpadon
Copy link
Contributor

It is currently impossible to add equinox to a modern Python project using Poetry, because the current pyproject.toml says that it only supports Python 3.9

This PR fixes this

@patrick-kidger
Copy link
Owner

I think this is correct as-written. ~=3.9 means that anything in the 3.x series above 3.9 is acceptable.

See the PyPA documentation here: https://packaging.python.org/en/latest/specifications/version-specifiers/#compatible-release

For some reason Poetry appears to use a nonstandard interpretation of this: https://python-poetry.org/docs/dependency-specification/#tilde-requirements

If my understanding is correct then I believe this is a bug in Poetry, and it should be reported there. (A quick search on their GitHub looks like this might have come up before: python-poetry/poetry#380)

(These days I would strongly recommend using uv instead. Similar to poetry, fewer bugs, much faster.)

@norpadon
Copy link
Contributor Author

norpadon commented Oct 12, 2024

Oh, I think you are correct. The problem was on my (importing) side: I was specifying requirements as

python = ">=3.12"

But it theoretically includes python = "4.0", which is technically not compatible with python = "~=3.9".
So I fixed the problem on my side by changing python version requirements to "~=3.12"

This is indeed a technically correct behaviour, but I am not sure whether being "technically correct" is worth it, given that the likelihood of python4.x being released is negligibly small. Almost every other python package has ">=" in python version requirements, and equinox is the first package I had this issue with. Maybe switching to ">=3.9" on the equinox side is simply better for the user experience.

@patrick-kidger patrick-kidger merged commit 2e33f25 into patrick-kidger:main Oct 12, 2024
2 checks passed
@patrick-kidger
Copy link
Owner

Agreed. Whilst Poetry is definitely wrong here, it's a pragmatic choice for us to allow compatibility in this way. Merged! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants