Skip to content
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

pythonRuntimeDepsCheckHook fails on non PEP-440 compliant builder kernel versions #337209

Open
adisbladis opened this issue Aug 25, 2024 · 0 comments

Comments

@adisbladis
Copy link
Member

Describe the bug

Builds that use a platform_release marker fails on some systems:

       last 10 log lines:
       >            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/mi72s33raf3kf07jyjg0grm759yjbgx3-python3.12-packaging-24.1/lib/python3.12/site-packages/packaging/specifiers.py", line 552, in contains
       >     normalized_item = _coerce_version(item)
       >                       ^^^^^^^^^^^^^^^^^^^^^
       >   File "/nix/store/mi72s33raf3kf07jyjg0grm759yjbgx3-python3.12-packaging-24.1/lib/python3.12/site-packages/packaging/specifiers.py", line 28, in _coerce_version
       >     version = Version(version)
       >               ^^^^^^^^^^^^^^^^
       >   File "/nix/store/mi72s33raf3kf07jyjg0grm759yjbgx3-python3.12-packaging-24.1/lib/python3.12/site-packages/packaging/version.py", line 202, in __init__
       >     raise InvalidVersion(f"Invalid version: '{version}'")
       > packaging.version.InvalidVersion: Invalid version: '6.5.0-1025-azure'

The code that triggers it is:

    if requirement.marker and not requirement.marker.evaluate():
        # ignore requirements with incompatible markers
        return True

Which internally gets a kernel version to compare the platform_release PEP-508 environment marker from the Python packaging module.

Steps To Reproduce

Steps to reproduce the behavior:

  1. Run a Python build with a platform_release marker on a kernel version that packaging.Version fails to parse

Expected behavior

Builds should not be affected by the kernel version on the builder.
platform_release and platform_version should be scrubbed from environment.

Additional context

Upstream packaging bug: pypa/packaging#774

Failing build: https://github.com/adisbladis/uv2nix/actions/runs/10545502596/job/29215801487

Notify maintainers

@mweinelt
@FRidh


Add a 👍 reaction to issues you find important.

@adisbladis adisbladis changed the title pythonRuntimeDepsCheckHook fails on non PEP-440 compliant kernel versions pythonRuntimeDepsCheckHook fails on non PEP-440 compliant builder kernel versions Aug 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant