Skip to content

Commit 62aa414

Browse files
committed
CI: pip -> uv
There are central Python tools being rewritten in performant, compiled rust via the astral.sh project. `uv` as a drop-in replacement of `pip` is one of them, another one, `ruff`, we are already using.
1 parent 14250be commit 62aa414

File tree

10 files changed

+92
-82
lines changed

10 files changed

+92
-82
lines changed

.github/workflows/codeql.yml

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,18 +37,13 @@ jobs:
3737

3838
- name: Install Packages
3939
run: |
40-
sudo apt-get update
41-
sudo apt-get install --yes cmake openmpi-bin libfftw3-dev libfftw3-mpi-dev libopenmpi-dev libhdf5-openmpi-dev
42-
43-
python -m pip install --upgrade pip
44-
python -m pip install --upgrade pipx
45-
python -m pip install --upgrade wheel
46-
python -m pip install --upgrade numpy
47-
python -m pip install --upgrade mpi4py
48-
python -m pip install --upgrade pytest
49-
python -m pip install --upgrade pytest-benchmark
50-
python -m pip install --upgrade cmake
51-
python -m pipx install cmake
40+
sudo apt update
41+
sudo apt install --yes cmake openmpi-bin libfftw3-dev libfftw3-mpi-dev libopenmpi-dev libhdf5-openmpi-dev
42+
43+
curl -LsSf https://astral.sh/uv/install.sh | sh
44+
45+
sudo uv pip install --system --upgrade cmake mpi4py numpy pytest pytest-benchmark wheel
46+
uvx pip install cmake
5247
5348
- name: Configure (C++)
5449
if: ${{ matrix.language == 'cpp' }}

.github/workflows/dependencies/clang-san-openmpi.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
set -eu -o pipefail
99

10-
sudo apt-get -qqq update
11-
sudo apt-get install -y \
10+
sudo apt -qqq update
11+
sudo apt install -y \
1212
build-essential \
1313
ca-certificates \
1414
ccache \
@@ -28,13 +28,13 @@ sudo apt-get install -y \
2828
python3-pip \
2929
wget
3030

31-
python3 -m pip install -U pip
32-
python3 -m pip install -U build packaging setuptools[core] wheel
33-
python3 -m pip install -U cmake
34-
python3 -m pip install -U -r requirements_mpi.txt
35-
python3 -m pip install -U -r src/python/impactx/dashboard/requirements.txt
36-
python3 -m pip install -U -r examples/requirements.txt
37-
python3 -m pip install -U -r tests/python/requirements.txt
31+
curl -LsSf https://astral.sh/uv/install.sh | sh
32+
33+
sudo uv pip install --system -U build cmake packaging setuptools[core] wheel
34+
sudo uv pip install --system -U -r requirements_mpi.txt
35+
sudo uv pip install --system -U -r src/python/impactx/dashboard/requirements.txt
36+
sudo uv pip install --system -U -r examples/requirements.txt
37+
sudo uv pip install --system -U -r tests/python/requirements.txt
3838

3939
# cmake-easyinstall
4040
#

.github/workflows/dependencies/clang-tidy.sh

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
set -eu -o pipefail
99

10-
sudo apt-get -qqq update
11-
sudo apt-get install -y \
10+
sudo apt -qqq update
11+
sudo apt install -y \
1212
build-essential \
1313
ca-certificates \
1414
ccache \
@@ -27,13 +27,13 @@ sudo apt-get install -y \
2727
python3-pip \
2828
wget
2929

30-
python3 -m pip install -U pip
31-
python3 -m pip install -U build packaging setuptools[core] wheel
32-
python3 -m pip install -U cmake
33-
python3 -m pip install -U -r requirements_mpi.txt
34-
python3 -m pip install -U -r src/python/impactx/dashboard/requirements.txt
35-
python3 -m pip install -U -r examples/requirements.txt
36-
python3 -m pip install -U -r tests/python/requirements.txt
30+
curl -LsSf https://astral.sh/uv/install.sh | sh
31+
32+
sudo uv pip install --system -U build cmake packaging setuptools[core] wheel
33+
sudo uv pip install --system -U -r requirements_mpi.txt
34+
sudo uv pip install --system -U -r src/python/impactx/dashboard/requirements.txt
35+
sudo uv pip install --system -U -r examples/requirements.txt
36+
sudo uv pip install --system -U -r tests/python/requirements.txt
3737

3838
# cmake-easyinstall
3939
#

.github/workflows/dependencies/gcc-openmpi.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
set -eu -o pipefail
99

10-
sudo apt-get -qqq update
11-
sudo apt-get install -y \
10+
sudo apt -qqq update
11+
sudo apt install -y \
1212
build-essential \
1313
ca-certificates \
1414
ccache \
@@ -24,14 +24,14 @@ sudo apt-get install -y \
2424
python3-pip \
2525
wget
2626

27-
python3 -m pip install -U pip
28-
python3 -m pip install -U build packaging setuptools[core] wheel
29-
python3 -m pip install -U cmake
30-
python3 -m pip install -U -r requirements_mpi.txt
31-
python3 -m pip install -U -r src/python/impactx/dashboard/requirements.txt
32-
python3 -m pip install -U -r examples/requirements.txt
33-
python3 -m pip install -U -r tests/python/requirements.txt
27+
curl -LsSf https://astral.sh/uv/install.sh | sh
28+
29+
sudo uv pip install --system -U build cmake packaging setuptools[core] wheel
30+
sudo uv pip install --system -U -r requirements_mpi.txt
31+
sudo uv pip install --system -U -r src/python/impactx/dashboard/requirements.txt
32+
sudo uv pip install --system -U -r examples/requirements.txt
33+
sudo uv pip install --system -U -r tests/python/requirements.txt
3434

3535
# extra tests
36-
python3 -m pip install -U -r examples/requirements_torch_cpu.txt
37-
python3 -m pip install -U openPMD-validator
36+
sudo uv pip install --system -U -r examples/requirements_torch_cpu.txt
37+
sudo uv pip install --system -U openPMD-validator

.github/workflows/dependencies/gcc.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
set -eu -o pipefail
99

10-
sudo apt-get -qqq update
11-
sudo apt-get install -y \
10+
sudo apt -qqq update
11+
sudo apt install -y \
1212
build-essential \
1313
ca-certificates \
1414
ccache \
@@ -22,14 +22,14 @@ sudo apt-get install -y \
2222
python3-pip \
2323
wget
2424

25-
python3 -m pip install -U pip
26-
python3 -m pip install -U build packaging setuptools[core] wheel
27-
python3 -m pip install -U cmake
28-
python3 -m pip install -U -r requirements.txt
29-
python3 -m pip install -U -r src/python/impactx/dashboard/requirements.txt
30-
python3 -m pip install -U -r examples/requirements.txt
31-
python3 -m pip install -U -r tests/python/requirements.txt
25+
curl -LsSf https://astral.sh/uv/install.sh | sh
26+
27+
sudo uv pip install --system -U build cmake packaging setuptools[core] wheel
28+
sudo uv pip install --system -U -r requirements.txt
29+
sudo uv pip install --system -U -r src/python/impactx/dashboard/requirements.txt
30+
sudo uv pip install --system -U -r examples/requirements.txt
31+
sudo uv pip install --system -U -r tests/python/requirements.txt
3232

3333
# extra tests
34-
python3 -m pip install -U -r examples/requirements_torch_cpu.txt
35-
python3 -m pip install -U openPMD-validator
34+
sudo uv pip install --system -U -r examples/requirements_torch_cpu.txt
35+
sudo uv pip install --system -U openPMD-validator

.github/workflows/dependencies/hip-openmpi.sh

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/r
3636
| sudo tee -a /etc/profile.d/rocm.sh
3737
# we should not need to export HIP_PATH=/opt/rocm/hip with those installs
3838

39-
sudo apt-get update
39+
sudo apt update
4040

4141
# Ref.: https://rocmdocs.amd.com/en/latest/Installation_Guide/Installation-Guide.html#installing-development-packages-for-cross-compilation
4242
# meta-package: rocm-dkms
4343
# OpenCL: rocm-opencl
4444
# other: rocm-dev rocm-utils
45-
sudo apt-get install -y --no-install-recommends \
45+
sudo apt install -y --no-install-recommends \
4646
build-essential \
4747
gfortran \
4848
libhdf5-openmpi-dev \
@@ -59,7 +59,7 @@ sudo apt-get install -y --no-install-recommends \
5959
rocsparse-dev${VERSION}
6060

6161
# hiprand-dev is a new package that does not exist in old versions
62-
sudo apt-get install -y --no-install-recommends hiprand-dev${VERSION} || true
62+
sudo apt install -y --no-install-recommends hiprand-dev${VERSION} || true
6363

6464
# activate
6565
#
@@ -68,6 +68,10 @@ hipcc --version
6868
which clang
6969
which clang++
7070

71+
# uv
72+
#
73+
curl -LsSf https://astral.sh/uv/install.sh | sh
74+
7175
# cmake-easyinstall
7276
#
7377
sudo curl -L -o /usr/local/bin/cmake-easyinstall https://raw.githubusercontent.com/ax3l/cmake-easyinstall/main/cmake-easyinstall

.github/workflows/dependencies/nvcc11-openmpi.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
set -eu -o pipefail
99

10-
sudo apt-get -qqq update
11-
sudo apt-get install -y \
10+
sudo apt -qqq update
11+
sudo apt install -y \
1212
build-essential \
1313
ca-certificates \
1414
cmake \
@@ -26,8 +26,8 @@ sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda
2626
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64 /" \
2727
| sudo tee /etc/apt/sources.list.d/cuda.list
2828

29-
sudo apt-get update
30-
sudo apt-get install -y \
29+
sudo apt update
30+
sudo apt install -y \
3131
cuda-command-line-tools-11-7 \
3232
cuda-compiler-11-7 \
3333
cuda-cupti-dev-11-7 \
@@ -39,6 +39,10 @@ sudo apt-get install -y \
3939
libcusparse-dev-11-7
4040
sudo ln -s cuda-11.7 /usr/local/cuda
4141

42+
# uv
43+
#
44+
curl -LsSf https://astral.sh/uv/install.sh | sh
45+
4246
# cmake-easyinstall
4347
#
4448
sudo curl -L -o /usr/local/bin/cmake-easyinstall https://raw.githubusercontent.com/ax3l/cmake-easyinstall/main/cmake-easyinstall

.github/workflows/macos.yml

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -37,14 +37,16 @@ jobs:
3737
set -e
3838
- name: install pip dependencies
3939
run: |
40-
python3 -m pip install --upgrade pip
41-
python3 -m pip install --upgrade build packaging setuptools[core] wheel pytest pytest-benchmark
42-
python3 -m pip install --upgrade -r requirements_mpi.txt
43-
python3 -m pip install --upgrade -r src/python/impactx/dashboard/requirements.txt
44-
python3 -m pip install --upgrade -r examples/requirements.txt
45-
python3 -m pip install --upgrade -r tests/python/requirements.txt
46-
python3 -m pip install --upgrade pipx
47-
python3 -m pipx install openPMD-validator
40+
curl -LsSf https://astral.sh/uv/install.sh | sh
41+
42+
uv pip install --system --upgrade pip
43+
uv pip install --system --upgrade build packaging setuptools[core] wheel pytest pytest-benchmark
44+
uv pip install --system --upgrade -r requirements_mpi.txt
45+
uv pip install --system --upgrade -r src/python/impactx/dashboard/requirements.txt
46+
uv pip install --system --upgrade -r examples/requirements.txt
47+
uv pip install --system --upgrade -r tests/python/requirements.txt
48+
uv pip install --system --upgrade pipx
49+
uvx pip install openPMD-validator
4850
- name: CCache Cache
4951
uses: actions/cache@v4
5052
# - once stored under a key, they become immutable (even if local cache path content changes)

.github/workflows/stubs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ jobs:
3838
- name: Dependencies
3939
run: |
4040
.github/workflows/dependencies/gcc-openmpi.sh
41-
python3 -m pip install -U pybind11-stubgen pre-commit
41+
sudo uv pip install --system -U pybind11-stubgen pre-commit
4242
4343
- name: Set Up Cache
4444
uses: actions/cache@v4

.github/workflows/windows.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
Invoke-WebRequest https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_12_2.tar.gz -OutFile hdf5-1_12_2.tar.gz
3939
7z.exe x -r hdf5-1_12_2.tar.gz
4040
7z.exe x -r hdf5-1_12_2.tar
41+
42+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
4143
- name: Install Dependencies
4244
env:
4345
# Work-around for windows-latest GH runner issue, see
@@ -80,13 +82,14 @@ jobs:
8082
$env:HDF5_DIR = "C:/Program Files/HDF_Group/HDF5/1.12.2/cmake/"
8183
$env:HDF5_USE_STATIC_LIBRARIES = "ON"
8284
83-
python3 -m pip install -U pip
84-
python3 -m pip install -U build packaging setuptools[core] wheel
85-
python3 -m pip install -U -r requirements.txt
86-
python3 -m pip install -U -r src/python/impactx/dashboard/requirements.txt
87-
python3 -m pip install -U -r examples/requirements.txt
88-
python3 -m pip install -U -r tests/python/requirements.txt
89-
python3 -m pip install -U openPMD-validator
85+
uv venv
86+
uv pip install --system -U pip
87+
uv pip install --system -U build packaging setuptools[core] wheel
88+
uv pip install --system -U -r requirements.txt
89+
uv pip install --system -U -r src/python/impactx/dashboard/requirements.txt
90+
uv pip install --system -U -r examples/requirements.txt
91+
uv pip install --system -U -r tests/python/requirements.txt
92+
uv pip install --system -U openPMD-validator
9093
- name: Build
9194
env:
9295
# Work-around for windows-latest GH runner issue, see
@@ -157,6 +160,8 @@ jobs:
157160
Invoke-WebRequest https://github.com/HDFGroup/hdf5/archive/refs/tags/hdf5-1_12_2.tar.gz -OutFile hdf5-1_12_2.tar.gz
158161
7z.exe x -r hdf5-1_12_2.tar.gz
159162
7z.exe x -r hdf5-1_12_2.tar
163+
164+
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
160165
- name: Install Dependencies
161166
shell: cmd
162167
run: |
@@ -201,13 +206,13 @@ jobs:
201206
set "HDF5_DIR=C:/Program Files/HDF_Group/HDF5/1.12.2/cmake/"
202207
set "HDF5_USE_STATIC_LIBRARIES=ON"
203208
204-
python3 -m pip install -U pip
205-
python3 -m pip install -U build packaging setuptools[core] wheel
206-
python3 -m pip install -U -r requirements.txt
207-
python3 -m pip install -U -r src/python/impactx/dashboard/requirements.txt
208-
python3 -m pip install -U -r examples/requirements.txt
209-
python3 -m pip install -U -r tests/python/requirements.txt
210-
python3 -m pip install -U openPMD-validator
209+
uv pip install --system -U pip
210+
uv pip install --system -U build packaging setuptools[core] wheel
211+
uv pip install --system -U -r requirements.txt
212+
uv pip install --system -U -r src/python/impactx/dashboard/requirements.txt
213+
uv pip install --system -U -r examples/requirements.txt
214+
uv pip install --system -U -r tests/python/requirements.txt
215+
uv pip install --system -U openPMD-validator
211216
- name: Build
212217
shell: cmd
213218
env:

0 commit comments

Comments
 (0)