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

feat: add uv (except musl s390x) #1614

Merged
merged 3 commits into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions .github/workflows/update-dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
schedule:
- cron: '0 18 * * 0' # "At 18:00 on Sunday."

env:
FORCE_COLOR: '1'

jobs:
update-dependencies:
name: Update dependencies
Expand All @@ -17,6 +20,8 @@ jobs:
- uses: wntrblm/[email protected]
with:
python-versions: "3.12"
- name: "Install uv"
run: pipx install uv
- name: "Setup bot user"
run: |
git config --global user.name "manylinux-bot[bot]"
Expand All @@ -30,13 +35,13 @@ jobs:
app_id: ${{ secrets.MANYLINUX_BOT_APP_ID }}
private_key: ${{ secrets.MANYLINUX_BOT_APP_PRIVATE_KEY }}
- name: "Run update native dependencies"
run: nox --force-color --error-on-missing-interpreters -s update_native_dependencies
run: nox -s update_native_dependencies
env:
GITHUB_API_TOKEN: ${{ steps.generate-token.outputs.token || github.token }}
- name: "Run update downloaded interpreters"
run: nox --force-color --error-on-missing-interpreters -s update_interpreters_download
run: nox -s update_interpreters_download
- name: "Run update python dependencies"
run: nox --force-color --error-on-missing-interpreters -s update_python_dependencies
run: nox -s update_python_dependencies
- name: Create Pull Request
if: github.ref == 'refs/heads/main' && github.repository == 'pypa/manylinux'
uses: peter-evans/create-pull-request@v5
Expand Down
13 changes: 12 additions & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,18 @@ All images currently contain:

- Development packages for all the libraries that PEP 571/599 list. One should not assume the presence of any other development package.

- The `auditwheel <https://pypi.python.org/pypi/auditwheel>`_ tool
- The following development tools, installed via `pipx <https://pypi.org/p/pipx>`_ (which is also available):
- `auditwheel <https://pypi.org/p/auditwheel>`_
- `cmake <https://pypi.org/p/cmake>`_
- `patchelf <https://pypi.org/p/patchelf>`_
- `swig <https://pypi.org/p/swig>`_
- `uv <https://pypi.org/p/uv>`_ (not available on ``musllinux s390x`` yet due to Rust limitations)

- All Python interpreters have the following packages pre-installed:
- `pip <https://pypi.org/p/pip>`_
- `build <https://pypi.org/p/build>`_
- `packaging <https://pypi.org/p/packaging>`_
- Before Python 3.12, `setuptools <https://pypi.org/p/setuptools>`_ and `wheel <https://pypi.org/p/wheel>`_ are also available. (Currently 3.12 too, but will be removed after 3.13 is released.)

- The manylinux-interpreters tool which allows to list all available interpreters & install ones missing from the image

Expand Down
5 changes: 4 additions & 1 deletion docker/build_scripts/finalize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,10 @@ pipx uninstall pip
# install other tools with pipx
for TOOL_PATH in $(find ${MY_DIR}/requirements-tools -type f); do
TOOL=$(basename ${TOOL_PATH})
pipx install --pip-args="--require-hashes -r ${TOOL_PATH} --only-binary" ${TOOL}
# uv doesn't provide musl s390x wheels due to Rust issues
if [[ "${TOOL}" != "uv" || "${BASE_POLICY}-${AUDITWHEEL_ARCH}" != "musllinux-s390x" ]]; then
pipx install --pip-args="--require-hashes -r ${TOOL_PATH} --only-binary" ${TOOL}
fi
done

# We do not need the precompiled .pyc and .pyo files.
Expand Down
21 changes: 21 additions & 0 deletions docker/build_scripts/requirements-tools/uv
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# This file was autogenerated by uv via the following command:
# nox -s update_python_dependencies
uv==0.2.3 \
--hash=sha256:12c25976c0ab62a9d0333afcaf80033dc04695907932a227b5950c9bf716ddee \
--hash=sha256:23e3321c9e4d006e6454ae3375c3e6ec71ba0cc9c73394bb4777f1ae8f2ceb2d \
--hash=sha256:304fbcd9272c7e81f62a46b9254daf68f7622e38b2a1e450f27f3a7cc9d70fb8 \
--hash=sha256:3227894999ae465b4f3b88b60a94500f85f9b479e39b7de1bd1c32db19245252 \
--hash=sha256:3b9b077561704f8d0733dc8ea46c084b6113be7618d88b2fadbe111f3986dac1 \
--hash=sha256:4a2c04f146c351ef534052472794c68ebd528239c622764c1fe762a6ae8e6e1f \
--hash=sha256:5867b54fad22eb8d9052d7c69192844b551fafa5ce6d951d5fd467059cb35b3d \
--hash=sha256:6e57a7f92462cd06f0f43112cebc98406eb1a1640345040108c8d7de5b9556ad \
--hash=sha256:6ef658ea907963e497c2d6a0a5502eb13796b97b843571d4acd3c8e1f6507d4a \
--hash=sha256:7116eac4eb0e7329ce74d95cb7fada29f0623a39ca34357c374877bb00b098f0 \
--hash=sha256:79a92bb307d0b62f859a5705880b1433e552db3631405f19bc8862638a54c71f \
--hash=sha256:8081eb30b5cde7661eade4d87c80e8876a3b23635e0823e727d98d1b0ce4d883 \
--hash=sha256:8108cf952d84bc25062de6402ff5db0485aedeedb2bd87f5e764534ae9ce07e4 \
--hash=sha256:882f3b55d298045d7f7b3073f54aa87aafbad10bae4e1a0fdd14807b15a918ca \
--hash=sha256:d87ebe10c030ede3598ce560f35a54fe1e14515018fb222707576e5c80d0b6fb \
--hash=sha256:de1bc4defcbce6077475f11d21437ac9469b0b641814690cdacf11d36d38aa2c \
--hash=sha256:f24700aa936814a682b49f033e64c4e61f360407c4176a4476fcc8ff82868b15
# via -r .nox/update_python_dependencies/tmp/uv.in
18 changes: 14 additions & 4 deletions noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@

import nox

nox.needs_version = ">=2024.4.15"
nox.options.default_venv_backend = "uv|virtualenv"


@nox.session
def update_python_dependencies(session):
"Update the base and per-python dependencies lockfiles"
if getattr(session.virtualenv, "venv_backend", "") != "uv":
session.install("uv>=0.1.23")

Expand Down Expand Up @@ -60,11 +64,17 @@ def update_python_dependencies(session):

@nox.session(python="3.11", reuse_venv=True)
def update_native_dependencies(session):
session.install("lastversion>=3.5.0", "packaging", "requests")
session.run("python", "tools/update_native_dependencies.py", *session.posargs)
"Update the native dependencies"
script = "tools/update_native_dependencies.py"
deps = nox.project.load_toml(script)["dependencies"]
session.install(*deps)
session.run("python", script, *session.posargs)


@nox.session(python="3.11", reuse_venv=True)
def update_interpreters_download(session):
session.install("packaging", "requests")
session.run("python", "tools/update_interpreters_download.py", *session.posargs)
"Update all the Python interpreters"
script = "tools/update_interpreters_download.py"
deps = nox.project.load_toml(script)["dependencies"]
session.install(*deps)
session.run("python", script, *session.posargs)
1 change: 1 addition & 0 deletions requirements-tools.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ auditwheel
cmake
patchelf
swig
uv
6 changes: 6 additions & 0 deletions tools/update_interpreters_download.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/usr/bin/env python

# /// script
# dependencies = ["packaging", "requests"]
# ///

from __future__ import annotations

import argparse
Expand Down
6 changes: 6 additions & 0 deletions tools/update_native_dependencies.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
#!/usr/bin/env python

# /// script
# dependencies = ["lastversion>=3.5.0", "packaging", "requests"]
# ///

import argparse
import hashlib
import re
Expand Down