Skip to content

packaging==24.0 is incompatible with setuptools==78.1.1 #3532

@DanielKongsgaard

Description

@DanielKongsgaard

🐞 bug report

Affected Rule

When updating requirements I hit the following error:

 ImportError: Cannot import `packaging.licenses`.
                Setuptools>=77.0.0 requires "packaging>=24.2" to work properly.
                Please make sure you have a suitable version installed.

Is this a regression?

Yes, but I am not sure when it was introduced.

Description

In //python/private/pypi/deps.bzl there is a list of pypi packages with packaging-24.0 and setuptools-78.1.1, which clearly doesn't satisfy the setup tools requirement described in the error.

I have a branch where I have run bazel run //tools/private/update_deps:update_pip_deps to update all the packages, and that seems to work fine, but I can see from the git history that packaging was manually downgraded in commit 309ee59 with commit message:

revert: Updated pip and packaging versions to work with free-threading packages (https://github.com/bazel-contrib/rules_python/pull/2514) (https://github.com/bazel-contrib/rules_python/pull/2584)
This reverts commit https://github.com/bazel-contrib/rules_python/commit/fbf8bc10a466c498fc80c6b58c939a87a8d9e929 (https://github.com/bazel-contrib/rules_python/pull/2514)

Also, update the CHANGELOG about the reverting.

Fixes https://github.com/bazel-contrib/rules_python/issues/908, which is about the `pip-compile` not using the right files
for performing the locking. It seems that the `pip` upgrade regressed
this error.

I don't know if this is still a problem, but if not a simple solution could be to just update all the packages or only packaging to a new enough release.

🔬 Minimal Reproduction

Since the problem seemed clear I haven't made a minimal reproduction, please let me know if that is still desired.

🔥 Exception or Error

 ImportError: Cannot import `packaging.licenses`.
                Setuptools>=77.0.0 requires "packaging>=24.2" to work properly.
                Please make sure you have a suitable version installed.

🌍 Your Environment

Operating System:

Both macOS and Linux.

Output of bazel version:

9.0.0

Rules_python version:

1.8.1

Anything else relevant?

No

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions