Replies: 3 comments 1 reply
-
The behaviour of poetry is as you describe, but it is possible that this is not particularly relevant. are your users installing your package from source, using the poetry lockfile provides something like a proof that requirements are consistent and that users will be able to install them. But it says very little about what they will actually install. That is because only the requirements, and not the solution, make it into wheels eg as published to pypi. So what users get at install time will depend on what tool they use to do the installation (poetry? pip? other?), what other requirements they have in their project, what environmental constraints they themselves provide, etc |
Beta Was this translation helpful? Give feedback.
-
It's possible to specify different versions of deps based on the python version, but it's a bit manual: https://python-poetry.org/docs/dependency-specification/#multiple-constraints-dependencies |
Beta Was this translation helpful? Give feedback.
-
Answered in the replies, or at least pushed me to further think about what I really need. Thanks! |
Beta Was this translation helpful? Give feedback.
-
I've got the following pyproject.toml:
which (I had thought) means my project needs at least Python 3.8 and at least numpy 1.21 (up to the semver upper bounds).
So a user with Python 3.8 would get numpy 1.24.4 (the last 3.8-compatible version), since that combo meets those requirements, and a user with Python 3.9 could get numpy 1.25 and above, which also meets them.
But that doesn't seem to be happening. Even on a system with Python 3.9,
poetry lock
resolves to numpy 1.24.4. So it seems poetry always resolves to versions that will work with all (ie the lowest) allowed Python.Am I right in this? Is poetry fundamentally not the right tool if instead I want the behavior stated above of users on 3.8/3.9 getting different numpy versions? I understand I could use markers but then its like I'm manually doing dependency resolutions and gets complicated quickly with lots of packages. Thanks for any info.
Beta Was this translation helpful? Give feedback.
All reactions