-
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
Poetry refuses to upgrade projects that bound the Python version #4292
Comments
@NeilGirdhar it's still unclear to me how/why Poetry wants to use Python 3.10 here. Or where it would even get it from. Can you add the relevant part of your config? |
@rgommers It's not that Poetry "wants to use 3.10". I'm not an expert, but I'll do my best to explain. Suppose you have a project with
When When choosing the versions for the development environment, Poetry will reason that since your project could be installed on Python 3.10, and SciPy 1.7 is not compatible with 3.10, then Poetry should not choose SciPy 1.7 for the developer lock file. Of course, if you install your project using pip, you will still get SciPy 1.7. This issue is only about the development environment. |
Thanks, makes sense now.
I'm not sure if I'd consider it user error or a Poetry error. The I still don't get what the output is here. Why does it need to choose a fixed SciPy version, but is happy to not fix the Python version? If you want to lock exact versions as of today, the correct output is something like |
Yes, it could be user error. Perhaps the Poetry people can advise me 😄. As for your idea of specifying a different Python dependence for devevelopment and release, as far as I know, Poetry doesn't have this option.
The Python version is also fixed in your development environment. If you haven't played with poetry yet, feel free to try it out: pip install poetry
git clone [email protected]:NeilGirdhar/tjax.git
cd tjax
poetry install This will recreate my development environment on your machine. You can inspect the update process with: poetry update -vv | less |
Thanks for the example. I played with Poetry a little, and recommend it to people who prefer PyPI over conda-forge, but not enough to understand this type of dev workflow use case. |
It indeed refuses to upgrade
The diagnostic output from Poetry is impressively good I'd say. The proposed resolution seems fine to me. |
@rgommers Okay, so I should inherit your bound of <3.10? I wasn't sure, and thought that that would be unnecessary work in bumping that bound on all my projects every time a new Python version comes out. I guess that's what I should do then. |
It'd be nice if it wasn't needed, I think it's still odd that it is - but that's up to the Poetry devs. |
I just wanted to add that this is not entirely a Poetry problem. Pip will do the same. So, I was trying out 3.10 and if I run So, I understand the rationale, but some eager people for 3.10 will get bitten by this newly introduced bound, and I guess it probably won't be able to retroactively apply this to old versions of scipy on pypi. |
@hwalinga yes, this is a known problem with Pip. The current behavior makes very little sense. Defaulting to
We may be able to add wheels before 3.10.0 is released, but it's extra work and we take a little gamble then that CPython c API/ABI doesn't change anymore. If package installers don't fix this problem, the other option is at some point we'll upload a single sdist-only release which immediately errors out for all versions of Python. E.g. release a normal 1.8.1 with sdist + wheels, and then immediately after a "circuit breaker" sdist with a 1.8.0 version. That may sound like a heavy-handed approach, but imho it isn't - packages like TensorFlow and PyTorch upload no sdists at all exactly because of this issue, which would be a much worse solution for everyone (sdists kind of belong on PyPI). |
Perhaps you should open an issue? The poetry people have been very responsive. Normally, I would open the issue, but I'm completely out of my depth here, and you appear to be an expert 😄 If I understand correctly, in poetry's model, you want poetry to "derive facts" that only versions with wheels are considered if there are any wheels at all? Also, I'm just curious, but do packages ever go from releasing wheels to not releasing wheels?--in which case your idea would make it so that you would be stuck using past versions? |
Highly unusual. In most cases it's a temporary issue, like the release manager uploading an sdist first and the wheels after. I've done this before and gotten bug reports about it within an hour, it's an easy mistake to make. There's a way to accommodate those projects though that do it on purpose, there's a design tradeoff to make here between:
(2) seems good enough and would not break anything for projects that at some point decided to stop shipping wheels.
I will try to do that sometime in the next week, with some more context and a suggested design change. |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Please see my comment and @rgommers's reply here.
Because SciPy (and soon NumPy) have an upper bound version set to be "<3.10", Poetry refuses to upgrade SciPy on any project that leaves the Python version unbounded. Poetry says:
This means that all projects either need to inherit this upper bound in order to get updates. Does that make sense? Or would it be better for Poetry to not derive the above facts? After all, when
poetry update
is called, the Python version is fixed.The text was updated successfully, but these errors were encountered: