-
-
Notifications
You must be signed in to change notification settings - Fork 132
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
Please remove cap on python version in pyproject.toml #625
Comments
It is likely that when pandas supports version 3.12, there may be a period of time between pandas support of 3.12 and pandas-stubs support of 3.12, because there are possible deprecations in the python typing spec that are still undecided as to when they will be implemented. While I can't affirmatively assert that pandas-stubs will not work on 3.12, I also can't affirmatively assert that pandas-stubs will work on 3.12 without testing it. Because of this limitation of poetry, we could consider changing the build system. Would like the opinion of @twoertwein and @breno-jesus-fernandes on this topic. |
pandas-stubs should work with any python version (zero runtime) - the important part is the type checker :) I would even be fine going with |
Yes, it's true that pandas-stubs presumably works with any python version which pandas supports. But having pandas capped at <3.12 causes the following problem for downstream projects which also use poetry:
For some time, setting the downstream project's python cap to <4 would cause poetry's solver to select a really old version of pandas-stubs (along with pandas 1.1 IIRC) which had no such cap. Again, this is not your project's fault, but it is forcing us downstream to follow whatever you do, rather than let the solver do its work. For project that don't get much love (a lot of scientific packages, unfortunately) this results in an increasing number of packages that have to be forced-unpinned, which is just really icky from a rational packaging perspective. Changing your build system to a less-opinionated and more standards-based solver would be great, if you are willing to change your developer workflow and CI. @henryiii has a packaging guide that suggests pdm using flit or hatchling as the build backend, along with the gotchas. |
Hmm interings points ... We could for while follow the suggestion from @joelb123 and @twoertwein and just remove the cap, but after that we could migrate the dependency system to something like pdm which provides a flexible build system, simple to use and follow the peps. |
It is invalid to add an upper pin to the Requires-Python metadata slot, regardless of what backend you use. Regardless of what you support, the ecosystem simply isn't designed to allow this metadata slot to have an upper bound. There was a discussion about fixing this, but it would require the ability to detect upper caps, which would require quite a bit of new code in If it's helpful, numba (which is the definition of a package that can't support unseen versions of Python) removed this cap, and is now getting much better failure messages. Poetry's locking solver on downstream projects is usually the issue. Poetry's single setting for two distinct ideas (the filling of the metadata slot, which affects all downstream projects, and the bounds on the locking solve, which is only a local setting) is what generally causes this to be misconfigured, as you can't perform a locking solve without setting this to the lowest capped value and thereby ruining your package metadata. |
Ah, thanks, @henryiii. I have updated the title of the issue to reflect what I should have asked for. Also thank to you stubbers for listening. This isn't an urgent issue for me, just a long-standing peeve that has risen to be above the level of the noise because the poetry crowd has thumbed their noses at the problem. |
I think you meant "cap on" |
I will not reject if someone provides a PR with a maintainable and easy-to-use poetry alternative - but I must admit, I'm very happy with poetry overall. It is fast, ensures packages are compatible with each other's versions, and simplifies many workflows (from environment creation to publishing to pypi)! I much rather we use If we replace poetry, it might be good/consistent to pick whatever pandas uses (although I'm not a fan of conda). |
pandas-stubs's current upper bound on python version blocks every downstream package that also uses poetry from specifying python <4.
Note that this is a separate issue from actually supporting python 3.12; pandas 2.0 does not yet support python 3.12, so actual support of python 3.12 isn't possible at this time. But the persnickety solver that pandas uses means that downstream users like me will have to wait on you to uncap your python version. By that time, though, many of us will have moved on to other things, while our packages will stop building even though they may work perfectly well under 3.12.
This issue is extensively discussed in Henry Schreiner's blog post on poetry's decisions on capping. Unless you can affirmatively assert that pandas-stubs will not work on 3.12 at the time that pandas supports 3.12, you shouldn't dismiss all us downstream users in our optimism and force us to update our pyprojects.toml at some future time. As someone pointed out in a closed poetry issue on this topic, it took 4 years to force a much-used dependency (isort) to change a single character misreporting its compatibility.
Yes, this is really poetry's problem, not yours. Until they change things (and they have refused), the proper solution is to use a different build tool. But capping the python version contributes to a growing dependency hell.
The text was updated successfully, but these errors were encountered: