-
-
Notifications
You must be signed in to change notification settings - Fork 14.1k
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 pre-/post-releases in pythonRuntimeDepsCheckHook #301698
Comments
I'm pretty sure this behavior is in place, so that pre-releases need an explicit opt in, and won't be automatically selected as the latest and greatest version. Many packages in fact don't want to upgrade to pre-release versions. Packages that do can usually opt in by specifying the pre-release version in the requirement specifier. That should make the comparison work. |
OK, not getting an alpha release by default does make sense for upstream behavior. However, I tried specifying pre-releases and still find the results a little odd, eg Getting back to nixpkgs, is there a policy about packaging developmental releases? My naive reaction is that they will often fail pythonRuntimeDepsCheckHook for most packages consuming them as a dependency, so it would be nice to avoid that, but I'm sure there is a lot of context I'm missing. For example, the exact python library that bit me was psycopg-pool, and I don't face the issue with a small patch to nixpkgs to build it from the |
Updating to prereleases should be possible, but making this an option is difficult, given that for packages with many consumers you would have to set it in each consumer. We thoroughly test the package set, so allowing prereleases unconditionally shouldn't be too bad. Closes: NixOS#301698
Updating to prereleases should be possible, but making this an option is difficult, given that for packages with many consumers you would have to set it in each consumer. We thoroughly test the package set, so allowing prereleases unconditionally shouldn't be too bad. Closes: NixOS#301698
Updating to prereleases should be possible, but making this an option is difficult, given that for packages with many consumers you would have to set it in each consumer. We thoroughly test the package set, so allowing prereleases unconditionally shouldn't be too bad. Closes: NixOS#301698
Updating to prereleases should be possible, but making this an option is difficult, given that for packages with many consumers you would have to set it in each consumer. We thoroughly test the package set, so allowing prereleases unconditionally shouldn't be too bad. Closes: NixOS#301698
There is no policy against packaging pre-releases, and it can even be helpful to ease the transition between Python releases. In practice, we're not seeing much of these kinds of conflicts.
A tagged version like that should have no pre-release tag. For sqlalchemy we just stripped it, as that was what they did themselves in their CI when building releases. Either way, we will be allowing prereleases after the NixOS 24.11 branch-off to make the Python 3.13 transition bearable. |
Updating to prereleases should be possible, but making this an option is difficult, given that for packages with many consumers you would have to set it in each consumer. We thoroughly test the package set, so allowing prereleases unconditionally shouldn't be too bad. Closes: #301698
Updating to prereleases should be possible, but making this an option is difficult, given that for packages with many consumers you would have to set it in each consumer. We thoroughly test the package set, so allowing prereleases unconditionally shouldn't be too bad. Closes: #301698
Describe the bug
In its current implementation,
python-runtime-deps-check-hook.py
instantiates aRequirement
frompackaging.requirements
, which has aSpecifierSet
withprereleases=False
. https://packaging.pypa.io/en/stable/requirements.htmlBecause of this, several Python packages within nixpkgs cause this hook to fail. One example is
psycopg.optional-dependencies.pool
. Upstream keeps the version at "x.y.dev1" except on release tags, butpsycopg-pool
is built from the release tag ofpsycopg
.In practice, that means that building any python package with any
~=
or>=
version specifiers forpsycopg-pool
, or any other python library with a version in nixpkgs likex.y.a2
,n.m.beta
, etc., will fail. (I'm not sure why thepackaging
package behaves like this, since it seems obvious that3.0.0.dev1 >= 2.0
is true, so I might raise an issue there).Unfortunately, you can't override the version specifier set of a
Requirement
, so the hook implementation would need to be slightly refactored to use aSpecifierSet
with the parameterprereleases=True
: https://packaging.pypa.io/en/stable/specifiers.html.I'm not sure if there's a better way to approach this, or if it makes more sense to generally try to avoid prerelease versions in nixpkgs, but this is currently breaking a build for me so I wanted to raise it. Thanks for your attention!
This issue was previously mentioned by @mweinelt at #270457 (comment), but the implementation was kept and the package in question was updated to a non-prerelease version.
Add a 👍 reaction to issues you find important.
The text was updated successfully, but these errors were encountered: