Skip to content

Commit

Permalink
feat: add uv to most images
Browse files Browse the repository at this point in the history
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
  • Loading branch information
henryiii committed May 21, 2024
1 parent 5cfabef commit bbac5a5
Show file tree
Hide file tree
Showing 8 changed files with 73 additions and 9 deletions.
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/nox@2024.04.15
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`` and ``muslllinux powerpc64le`` 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" || "$AUDITWHEEL_POLICY" != musllinux* || "$AUDITWHEEL_ARCH" != "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
22 changes: 22 additions & 0 deletions docker/build_scripts/requirements-tools/uv
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file was autogenerated by uv via the following command:
# nox -s update_python_dependencies
uv==0.1.45 \
--hash=sha256:088af576fb0e0462cd5f718d03fb1a9f16ce5ae61fdb2a9d3ea938fc826cecc1 \
--hash=sha256:0f6cfe885f109bacc055edd5df2c837616ae2238b9324a9d37835a96b204ab2f \
--hash=sha256:110e0f45ddb2fe832ce50b0308be90e5439e0c02d3ffe042feeb3f759811f31f \
--hash=sha256:2ca2d5a5e06c5f71c7b213e14fa59129e63b77de3ffbcf84ecc98d647d73a821 \
--hash=sha256:346aa2d0a4ad3c0c3f7852c1edf5e5a8e5d2ef34c7474e9089877291c2da979c \
--hash=sha256:40fab956bc7af50dfa4bda14e5871528f57603eb9bf8595eb3144aace0ed8c47 \
--hash=sha256:4e5d55f0f8b6ae416c72d78106e224c8e8338356da21ddebecc7b1723de80924 \
--hash=sha256:68718add6ee2cef2816f9bf8a1dbf2d8cf63d98ddf45840f340029f65a49fd89 \
--hash=sha256:7fdb235aaf420fa8ac9009999b1654a23540f03e25c35094543c2f48d7c41aef \
--hash=sha256:87e77d25e8f358c0d5de1983497ee4cf4cea8fc73373d1ef1063533352db2f89 \
--hash=sha256:8e2eeea4eec0e09f7d67378152428b5308dba8b33990d045d7a31d19bf18ca1f \
--hash=sha256:90b68c80dddebeca69b26a2af1e2e683804bcf2b5f22d107af03d9156d6218c6 \
--hash=sha256:a39141e179fea043151a165c9155031e7976b0e4b076c0c33a45b58a420134e0 \
--hash=sha256:a601eed14d484d36d421e4208911a56aaf758ea6c385ef8edf8ad9f8ead57ce1 \
--hash=sha256:b94180009264f3f7ee74250f8e4f99c8cb0cb3633e3a9c9c66cdef3eb69be575 \
--hash=sha256:cd7f2f64fdded940342dc37234c11ae3508222c3c9b6b0eac5879dcd586010fa \
--hash=sha256:ddb93620c9e01fa83573c2648df4bee3fa548ca940de51c8a2c3566a23a0c776 \
--hash=sha256:de81501c0b03160d0944906d1a713f108258360e20c58385974acb7253b56166
# 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

0 comments on commit bbac5a5

Please sign in to comment.