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 14, 2024
1 parent 0983f6f commit 80542d5
Show file tree
Hide file tree
Showing 8 changed files with 64 additions and 7 deletions.
9 changes: 6 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 @@ -30,13 +33,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
4 changes: 3 additions & 1 deletion docker/build_scripts/finalize.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ 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}
if [[ "$TOOL" != "uv" || "$AUDITWHEEL_POLICY" != musllinux* || ("$AUDITWHEEL_ARCH" != "s390x" && "$AUDITWHEEL_ARCH" != "powerpc64le") ]]; 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
20 changes: 20 additions & 0 deletions docker/build_scripts/requirements-tools/uv
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# This file was autogenerated by uv via the following command:
# nox -s update_python_dependencies
uv==0.1.43 \
--hash=sha256:04c5b815d5d679b962249c1e03606ab78163ba7eea0ba2b47bcfc9b2f19abfba \
--hash=sha256:177044b9002da3c278002d51fad8e6e730a6ed39a2b0cde4f4a66326698811f9 \
--hash=sha256:1d5fc94e8c1308213ce0909f69f4683bd1daaad08c451cadd4fe1a656fd7e119 \
--hash=sha256:326232a9750945192018f0b74ad7450cec2309a00dbee7291cf5cabc1665980e \
--hash=sha256:4be5a9fe315340f10900df29029b29fa75eb0722e3052a937991c35aa3af0869 \
--hash=sha256:537439f955e361e0d2113710ae5339fd7cb0cefb7274f7ed33351248ab22c254 \
--hash=sha256:58446aadbae300c92300ba6686c5f802a647478d894efc5725315a947d62345e \
--hash=sha256:99f9ee893a597374630df23a873e2888ad333e1d31bdca103914c2236ce77ed7 \
--hash=sha256:a4e4f86afbf5949da8a1eb376327866158bcfda3a92d25e74b0ce9988d7bf477 \
--hash=sha256:a5f16230631d4fd2d0b98a89759b256bdf647c3e7641b39e9632652137b3f901 \
--hash=sha256:a8c0447cdd2c54b58c33ad06305812e918c0bc5695370a60c12cc0045dcc5b32 \
--hash=sha256:b5365c163cdbc50bc97ebe2607357241cecb2d6c8e05916b4a495a0089a9e311 \
--hash=sha256:bd06f50cbbc1536d679aa1366011af04c7b613e84396e917bb0014a4b5de8e47 \
--hash=sha256:d2d3f592543aa9dd3bf59c5cfe2479d05fa07690449ddf94e225cd6d1567c743 \
--hash=sha256:e198f64dfc85d55cf8861a4a57aa6fbafe8f969261f6bceb400e4ac1ca595428 \
--hash=sha256:f495da8017453d5b185f6d2b3d57c6a60e063136aaa6e8bf92164bb3573cab45 \
--hash=sha256:f54666b392ca0db4d4b6a23aceb1fba1e7329dc1e2882a252afe407034de316c
12 changes: 10 additions & 2 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,15 @@ 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")
"Update the native dependencies"
deps = nox.project.load_toml(script)["dependencies"]
session.install(*deps)
session.run("python", "tools/update_native_dependencies.py", *session.posargs)


@nox.session(python="3.11", reuse_venv=True)
def update_interpreters_download(session):
session.install("packaging", "requests")
"Update all the Python interpreters"
deps = nox.project.load_toml(script)["dependencies"]
session.install(*deps)
session.run("python", "tools/update_interpreters_download.py", *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 80542d5

Please sign in to comment.