Skip to content

Commit 6e16bb9

Browse files
committed
Sandbox: Optionally use uv package manager to save cycles
1 parent 8a3bf38 commit 6e16bb9

File tree

7 files changed

+47
-4
lines changed

7 files changed

+47
-4
lines changed

.github/workflows/codeql.yml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ jobs:
4343
cache-dependency-path: |
4444
setup.py
4545
46+
- name: Install uv
47+
uses: yezz123/setup-uv@v4
48+
4649
- name: Initialize CodeQL
4750
uses: github/codeql-action/init@v3
4851
with:
@@ -55,7 +58,7 @@ jobs:
5558

5659
- name: Install project
5760
run: |
58-
pip install --editable=.[test]
61+
uv pip install --editable=.[test]
5962
6063
- name: Perform CodeQL Analysis
6164
uses: github/codeql-action/analyze@v3

.github/workflows/docs.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,18 @@ jobs:
3030
cache: 'pip'
3131
cache-dependency-path: 'setup.py'
3232

33+
- name: Install uv
34+
uses: yezz123/setup-uv@v4
35+
3336
- name: Build docs
3437
run: |
38+
39+
# Activate `uv`.
40+
if command -v uv; then
41+
function pip() {
42+
uv pip "$@"
43+
}
44+
fi
45+
46+
# Build docs.
3547
cd docs && make check

.github/workflows/nightly.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,9 @@ jobs:
3232
cache: 'pip'
3333
cache-dependency-path: 'setup.py'
3434

35+
- name: Install uv
36+
uses: yezz123/setup-uv@v4
37+
3538
- name: Invoke tests
3639
run: |
3740

.github/workflows/release.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,14 @@ jobs:
1818
cache: 'pip'
1919
cache-dependency-path: 'setup.py'
2020

21+
- name: Install uv
22+
uses: yezz123/setup-uv@v4
23+
2124
- name: Build package
2225
run: |
23-
python -m pip install twine wheel
24-
python setup.py sdist bdist_wheel
25-
twine check dist/*.tar.gz
26+
uv pip install build twine wheel
27+
python -m build
28+
twine check dist/*
2629
2730
- name: Publish package to PyPI
2831
uses: pypa/gh-action-pypi-publish@release/v1

.github/workflows/tests.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ jobs:
4747
cache: 'pip'
4848
cache-dependency-path: setup.py
4949

50+
- name: Install uv
51+
uses: yezz123/setup-uv@v4
52+
5053
- name: Invoke tests
5154
run: |
5255

DEVELOP.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ CrateDB Python developer guide
55
Setup
66
=====
77

8+
Optionally install Python package and project manager ``uv``,
9+
in order to significantly speed up the package installation::
10+
11+
{apt,brew,pip,zypper} install uv
12+
alias pip="uv pip"
13+
814
To start things off, bootstrap the sandbox environment::
915

1016
git clone https://github.com/crate/crate-python

bootstrap.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,25 @@ function finalize() {
8787

8888
}
8989

90+
function activate_uv() {
91+
if command -v uv; then
92+
function pip() {
93+
uv pip "$@"
94+
}
95+
fi
96+
}
97+
function deactivate_uv() {
98+
unset -f pip
99+
}
100+
90101
function main() {
102+
activate_uv
91103
ensure_virtualenv
92104
activate_virtualenv
93105
before_setup
94106
setup_package
95107
run_buildout
108+
deactivate_uv
96109
finalize
97110
}
98111

0 commit comments

Comments
 (0)