-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Wildcard version constraint not functioning as expected #8418
Comments
pep440 seems sadly self-contradictory about the meaning of wildcards, recommend just not using them https://peps.python.org/pep-0440/#examples says
but: 3.1.0.dev0 starts with 3.1 and is earlier than 3.1: so the things that pep440 says are equivalent are not equivalent |
There seems to be movement to clarify this in pep440 python/peps@a703204
Although, I think it's clear that poetry is going against pep440 based on the Handling of pre-releases section:
~Emphasis added.
I believe this should be configurable like so: |
I am also having some problems. I want my project to support Python from I first tried this: |
|
I thought I was being clever and went with |
What is the actual, intended behavior from Building the following specifications using Python [tool.poetry.dependencies]
python = ">=3.9, <3.13" Will create a PKG-INFO with: [...]
Requires-Python: >=3.9,<3.13
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
[...] [tool.poetry.dependencies]
python = ">=3.9, <=3.12" Will create a PKG-INFO with: [...]
Requires-Python: >=3.9,<=3.12
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
[...] [tool.poetry.dependencies]
python = ">=3.9, <=3.12.*" Will create a PKG-INFO with: [...]
Requires-Python: >=3.9,<=3.12
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
[...] But if you build with Python Is the answer to never use less-than-or-equal in upper bounded versions or awaiting the resolution of the PEP issues mentioned by @dimbleby and @BeRT2me? |
advice is unchanged, don't use wildcards |
and does that mean <=3.12 implies a wildcard patch-number i.e. 3.12.*, so the recommendation to specify 3.12 as allowed is to use <3.13? |
please read the thread, you are just reliving a conversation that has already happened |
-vvv
option) and have included the output below.Issue
I'm just getting started with poetry, but I think I'm misunderstanding how the wildcard version constraints are implemented.
I'm specifying a python version as
python = "3.8.*"
in the toml file, before I start using poetry to add packagessuch as
poetry add psychopy
, but get the following errorI was able to solve this by using
python = "~3.8"
orpython = ">=3.8, <3.9"
explicitly, but according to the wildcard documentation (linked above),3.8.*
and~3.8
should have been equivalentThe text was updated successfully, but these errors were encountered: