Skip to content

Comments

python3.pkgs.pythonRuntimeDepsCheckHook: init #270457

Closed
mweinelt wants to merge 76 commits intoNixOS:masterfrom
mweinelt:python-runtime-deps-check
Closed

python3.pkgs.pythonRuntimeDepsCheckHook: init #270457
mweinelt wants to merge 76 commits intoNixOS:masterfrom
mweinelt:python-runtime-deps-check

Conversation

@mweinelt
Copy link
Member

@mweinelt mweinelt commented Nov 27, 2023

Description of changes

Implements a hook, that checks whether all dependencies, as specified by
the wheel manifest, are present in the current environment.

Complains about missing packages, as well as version specifier
mismatches.

Requires at least packaging>=23.2 and creates a bootstrap version of it.
Not sure if this is necessary, or if we should just not check on bootstrap packages.

Breaks the build for some packages, e.g., when we prevent infinite
recursion, like on sphinxcontrib packages, which have a dependency on sphinx.
What do we want to do here? Will set dontCheckRuntimeDeps for now.

Fixes: #250865

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Priorities

Add a 👍 reaction to pull requests you find important.

@github-actions github-actions bot added the 6.topic: python Python is a high-level, general-purpose programming language. label Nov 27, 2023
@mweinelt mweinelt force-pushed the python-runtime-deps-check branch 4 times, most recently from a6ff14e to 30e73a2 Compare November 27, 2023 23:59
@ofborg ofborg bot added 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 8.has: package (new) This PR adds a new package labels Nov 28, 2023
@ofborg ofborg bot requested a review from bennofs November 28, 2023 06:12
@ofborg ofborg bot added 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches. labels Nov 28, 2023
@ofborg ofborg bot requested a review from fabaff November 28, 2023 06:50
@mweinelt
Copy link
Member Author

mweinelt commented Nov 28, 2023

Executing pythonRuntimeDepsCheck
Checking runtime dependencies for flask_sqlalchemy-3.1.1-py3-none-any.whl
  - sqlalchemy>=2.0.16 not satisifeid by version 2.0.21.dev0

Why is the version we pull from the tag 2.0.21.dev0? And why is that not greater than or equal 2.0.16?

    if package.version not in requirement.specifier:
        error(
            f"{package_name}{requirement.specifier} not satisifeid by version {package.version}"
        )
        return False

Not the whole truth. I delegate that to packaging.Requirement.

Solved in bdbeb01.

@mweinelt mweinelt force-pushed the python-runtime-deps-check branch from 11c1327 to 562ad5c Compare November 28, 2023 16:31
@ofborg ofborg bot added the 8.has: clean-up This PR removes packages or removes other cruft label Nov 28, 2023
@mweinelt mweinelt force-pushed the python-runtime-deps-check branch from 105d5d5 to 14e811e Compare November 29, 2023 00:29
@mweinelt mweinelt force-pushed the python-runtime-deps-check branch from fb3650f to 146297f Compare November 29, 2023 17:01
@mweinelt mweinelt mentioned this pull request Nov 30, 2023
13 tasks
@github-actions github-actions bot added the 6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab label Nov 30, 2023
@mweinelt mweinelt force-pushed the python-runtime-deps-check branch from 9e131c4 to c6ac6e8 Compare December 1, 2023 02:16
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/breaking-changes-announcement-for-unstable/17574/40

dotlambda and others added 21 commits December 1, 2023 17:58
The badly maintained tests require nose3, which requires the imp module,
which has been ripped out in 3.12.
Checking runtime dependencies for homeassistant-2023.11.3-py3-none-any.whl
  - httpx==0.25.0 not satisfied by version 0.25.2
  - yarl==1.9.2 not satisifeid by version 1.9.3
They use nose, which relies on the imp module, which was been removed
from Python 3.12.
Upstream has no released version with Python 3.12 supported yet, but a
patch was already merged, which works fine.
The `async_generator` module is a backport of async generators to
Python 3.5 and it started failing on 3.12, but pulling it is safe.
The `async_generator` module is a backport of async generators to
Python 3.5 and it started failing on 3.12, but pulling it is safe.
@mweinelt
Copy link
Member Author

mweinelt commented Dec 2, 2023

Continues over in #271586.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

6.topic: jupyter Interactive computing tooling: kernels, notebook, jupyterlab 6.topic: python Python is a high-level, general-purpose programming language. 8.has: clean-up This PR removes packages or removes other cruft 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 501+ This PR causes many rebuilds on Darwin and should normally target the staging branches. 10.rebuild-darwin: 5001+ This PR causes many rebuilds on Darwin and must target the staging branches. 10.rebuild-darwin-stdenv This PR causes stdenv to rebuild on Darwin and must target a staging branch. 10.rebuild-linux: 501+ This PR causes many rebuilds on Linux and should normally target the staging branches. 10.rebuild-linux: 5001+ This PR causes many rebuilds on Linux and must target the staging branches.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Restore python dependency validation

5 participants