Repository navigation
Use uv for development, CI and docs builds - #436
Merged
Merged
Conversation
Contributor setup relied on virtualenvwrapper, pip and requirements files whose pins had drifted (ruff differed from pre-commit, lxml differed between tests and docs). Move to a single uv-based workflow. - Pin Python 3.14.10 as the development default in .python-version. Supported versions for users are unchanged: requires-python stays >=3.10, and the wheels and CI matrices still cover 3.10-3.15. - Replace the requirements files with dependency groups and uv.lock. Keep exact pins in the test group, because cibuildwheel installs it from pyproject.toml through test-groups and does not read the lockfile. - Set uv cache keys so C and build_support changes rebuild the extension. Git state and PYXMLSEC_STATIC_DEPS are left out on purpose: a static rebuild takes over a minute, and keying on the variable makes any `uv run` without it rebuild against the system libraries. - Move the GitHub workflows, manylinux script and Read the Docs config to uv. Replace `setup.py sdist` and `setup.py --version` with `uv build` and globs. - Add CONTRIBUTING.md with the full setup for static and system libraries, and update the README, docs and libs guides. - Remove the unused .travis.yml, which referenced the removed files. Tested locally on macOS only. The Linux and Windows runners, manylinux containers and Read the Docs build have not run with these changes yet.
The non-static macOS job on Python 3.11 failed at import with "lxml & xmlsec libxml2 library version mismatch". Runners preinstall several Pythons and uv uses a matching one before downloading its own, so the jobs ran on a mix: 3.11 and 3.12 on universal2 builds in /usr/local/bin, 3.14 on Homebrew's and 3.10 on a uv-managed build. - Set UV_PYTHON_PREFERENCE=only-managed so every macOS job uses uv's own Python. - Assign PYXMLSEC_LIBFILE before writing it to GITHUB_ENV. The command substitution inside echo hid the failed import, so the job only failed later during test collection. - Document the workaround in the CONTRIBUTING.md mismatch entry.
Non-static macOS jobs could fail at import with "lxml & xmlsec libxml2 library version mismatch". The static and non-static jobs share a uv cache, since the key only uses the Python version and lockfile, and they build wheels with the same filename. uv then installed the cached wheel from the other job instead of the one in dist/, so a static wheel with libxml2 2.14.6 ended up next to an lxml built against Homebrew's 2.15.4. Pass --refresh-package xmlsec so each job installs the wheel it just built. This corrects the diagnosis in the previous commit, which blamed preinstalled Pythons. Remove the CONTRIBUTING.md advice based on it, and keep UV_PYTHON_PREFERENCE=only-managed only so every job uses the same kind of Python.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Contributor setup relied on virtualenvwrapper, pip and requirements files whose pins had drifted (ruff differed from pre-commit, lxml differed between tests and docs). Move to a single uv-based workflow.
uv runwithout it rebuild against the system libraries.setup.py sdistandsetup.py --versionwithuv buildand globs.Tested locally on macOS only. The Linux and Windows runners, manylinux containers and Read the Docs build have not run with these changes yet.