Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Fix CI and dev envs with uv >= 0.6.0#172

Merged
lkubb merged 1 commit into
salt-extensions:mainfrom
lkubb:fix/uv-060
Mar 21, 2025
Merged

Fix CI and dev envs with uv >= 0.6.0#172
lkubb merged 1 commit into
salt-extensions:mainfrom
lkubb:fix/uv-060

Conversation

@lkubb

@lkubb lkubb commented Mar 21, 2025

Copy link
Copy Markdown
Member

uv<0.6 releases used requires.txt from egg-info of the sdist as a
fallback. This has been changed. Since Salt requires its legacy
setup.py, which in turn requires setuptools<69, it could not be
built properly and its dependencies were never installed.

This constrains setuptools for all package builds. In theory, we
could limit this to the installation of Salt in noxfile.py, but the
--build-constraint parameter requires a file, which would need to be
included or created ad-hoc. Constraining setuptools in this way should
not cause problems in the near future, otherwise we can go this more
complicated way. I might have missed something since I'm not a Python
packaging pro. Better suggestions are welcome.

Edit: Turns out it's not uv's fault as evidenced by pip having the same problem. It's caused by setuptools>=75.6.0. I'll quote the corresponding message on the Saltstack Discord:

Okay, I traced this back to setuptools 75.6.0 (75.5.0 still works). Comparing the changes (pypa/setuptools@v75.5.0...v75.6.0), I would guess it's caused by this commit (not an expert here): pypa/setuptools@fbbfbfb (from pypa/setuptools#4701), specifically removing the call to pkginfo_to_metadata (which reads the sdist salt.egg-info/requires.txt: https://github.com/pypa/setuptools/blob/bf2ced2a61833915a307c73405da99b6408154c7/setuptools/_vendor/wheel/metadata.py#L155-L163) in favor of just copying the sdist PKG-INFO to the wheel METADATA.

`uv<0.6` releases used `requires.txt` from `egg-info` of the sdist as a
fallback. This has been changed. Since Salt requires its legacy
`setup.py`, which in turn requires `setuptools<69`, it could not be
built properly and its dependencies were never installed.

This constrains setuptools for all package builds. In theory, we
could limit this to the installation of Salt in `noxfile.py`, but the
`--build-constraint` parameter requires a file, which would need to be
included or created ad-hoc. Constraining setuptools in this way should
not cause problems in the near future, otherwise we can go this more
complicated way. I might have missed something since I'm not a Python
packaging pro. Better suggestions are welcome.
@lkubb lkubb merged commit 9b167c1 into salt-extensions:main Mar 21, 2025
@lkubb lkubb mentioned this pull request Mar 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant