Skip to content

Commit 2cb23e3

Browse files
committed
Replace pip with uv for package installations across documentation and workflows
1 parent 2f853cf commit 2cb23e3

31 files changed

Lines changed: 137 additions & 106 deletions

.github/workflows/deploy-python-docs.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,18 @@ jobs:
5151
uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c # v6.0.0
5252
with:
5353
python-version: '3.12'
54-
cache: 'pip'
54+
55+
- name: Setup UV package manager
56+
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
57+
run: |
58+
curl -LsSf https://astral.sh/uv/install.sh | sh
59+
uv --version
5560
5661
- name: Install dependencies
5762
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'
5863
working-directory: bindings/python
5964
run: |
60-
pip install --upgrade pip
61-
pip install mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-macros-plugin mike
65+
uv pip install --system mkdocs-material mkdocs-git-revision-date-localized-plugin mkdocs-macros-plugin mike
6266
6367
- name: Validate docs token
6468
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push'

.github/workflows/release-python-packages.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@ jobs:
293293
294294
**Recommended (PyPI):**
295295
```bash
296-
pip install arcadedb-embedded==${{ needs.validate-version.outputs.python-version }}
296+
uv pip install arcadedb-embedded==${{ needs.validate-version.outputs.python-version }}
297297
```
298298
299299
### 🌍 Supported Platforms
@@ -309,7 +309,7 @@ jobs:
309309
- [Examples](https://github.com/${{ github.repository }}/tree/main/bindings/python/examples)
310310
311311
### 🔽 Direct Downloads
312-
All available wheels are attached below. Most users should install via pip (auto-selects correct wheel).
312+
All available wheels are attached below. Most users should install via uv (auto-selects correct wheel).
313313
314314
---
315315
**Based on ArcadeDB v${{ needs.validate-version.outputs.base-version }}**
@@ -349,7 +349,7 @@ jobs:
349349
<body>
350350
<h1>Links for arcadedb-embedded</h1>
351351
<p><strong>Alternative PyPI index with all 6 platforms</strong> (official PyPI only has 3 main platforms)</p>
352-
<p>Usage: <code>pip install --extra-index-url https://humemai.github.io/arcadedb-embedded-python/simple arcadedb-embedded</code></p>
352+
<p>Usage: <code>uv pip install --extra-index-url https://humemai.github.io/arcadedb-embedded-python/simple arcadedb-embedded</code></p>
353353
<p><em>Note: Intel Mac users can use the Apple Silicon wheel via Rosetta 2, or download the native Intel wheel for best performance.</em></p>
354354
<hr/>
355355
EOF

.github/workflows/test-python-bindings.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,12 @@ jobs:
142142
with:
143143
python-version: ${{ matrix.python-version }}
144144

145+
- name: Setup UV package manager
146+
shell: bash
147+
run: |
148+
curl -LsSf https://astral.sh/uv/install.sh | sh
149+
uv --version
150+
145151
- name: Download ArcadeDB JARs artifact
146152
# Skip for Linux: Docker build downloads JARs from ArcadeDB image directly
147153
# Only needed for native builds (macOS/Windows)
@@ -165,8 +171,7 @@ jobs:
165171
- name: Install Python build dependencies
166172
shell: bash
167173
run: |
168-
python -m pip install --upgrade pip
169-
pip install build wheel setuptools
174+
uv pip install --system build wheel setuptools
170175
171176
# Windows currently disabled, no symlink needed
172177
# - name: Create python3 symlink (Windows only)
@@ -203,7 +208,7 @@ jobs:
203208
shell: bash
204209
run: |
205210
cd bindings/python
206-
pip install test-install/*.whl pytest pytest-cov requests numpy
211+
uv pip install --system test-install/*.whl pytest pytest-cov requests numpy
207212
208213
- name: Run pytest on host
209214
id: pytest

.github/workflows/test-python-examples.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,11 +155,16 @@ jobs:
155155
with:
156156
python-version: ${{ matrix.python-version }}
157157

158+
- name: Setup UV package manager
159+
shell: bash
160+
run: |
161+
curl -LsSf https://astral.sh/uv/install.sh | sh
162+
uv --version
163+
158164
- name: Install Python build dependencies
159165
shell: bash
160166
run: |
161-
python -m pip install --upgrade pip
162-
pip install build wheel setuptools
167+
uv pip install --system build wheel setuptools
163168
164169
# Windows currently disabled, no symlink needed
165170
# - name: Create python3 symlink (Windows only)
@@ -183,7 +188,7 @@ jobs:
183188
shell: bash
184189
run: |
185190
cd bindings/python
186-
pip install dist/*embed*.whl
191+
uv pip install --system dist/*embed*.whl
187192
188193
- name: Install example dependencies
189194
shell: bash
@@ -193,18 +198,18 @@ jobs:
193198
# For Python 3.13+, wheels might only be on PyTorch official index
194199
if [[ "$OSTYPE" == "darwin"* ]]; then
195200
# macOS: Install CPU-only PyTorch (supports MPS acceleration)
196-
pip install torch --index-url https://download.pytorch.org/whl/cpu
197-
pip install "numpy<2.0" requests sentence-transformers
201+
uv pip install --system torch --index-url https://download.pytorch.org/whl/cpu
202+
uv pip install --system "numpy<2.0" requests sentence-transformers
198203
else
199204
# Linux & Windows: Install CPU-only PyTorch to save space (avoid CUDA)
200-
pip install torch --index-url https://download.pytorch.org/whl/cpu
201-
pip install numpy requests sentence-transformers
205+
uv pip install --system torch --index-url https://download.pytorch.org/whl/cpu
206+
uv pip install --system numpy requests sentence-transformers
202207
fi
203208
204209
- name: Download datasets
205210
shell: bash
206211
run: |
207-
pip install tqdm py7zr lxml
212+
uv pip install --system tqdm py7zr lxml
208213
cd bindings/python/examples
209214
echo "📥 Downloading MovieLens Small dataset..."
210215
python3 download_data.py movielens-small

bindings/python/Dockerfile.build

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,13 @@ FROM python:${PYTHON_VERSION}-slim AS python-builder
122122
# Install minimal build tooling (no external JDK needed; we use bundled JRE)
123123
RUN apt-get update && apt-get install -y \
124124
build-essential \
125+
curl \
125126
&& rm -rf /var/lib/apt/lists/*
126127

128+
# Install uv for faster, deterministic installs
129+
ENV PATH="/root/.cargo/bin:${PATH}"
130+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
131+
127132
WORKDIR /build
128133

129134
# Copy filtered JARs from jre-builder (already has exclusions applied)
@@ -148,7 +153,7 @@ COPY bindings/python/README.md ./
148153
COPY ../../pom.xml /arcadedb/pom.xml
149154

150155
# Install Python build dependencies
151-
RUN pip install --no-cache-dir build wheel setuptools jpype1
156+
RUN uv pip install --system build wheel setuptools jpype1
152157

153158
# Re-declare build args for this stage (required after FROM)
154159
ARG PACKAGE_NAME
@@ -197,15 +202,20 @@ FROM python:${PYTHON_VERSION}-slim AS tester
197202
# Keep build-essential in case pytest or wheels need compilation on some platforms
198203
RUN apt-get update && apt-get install -y \
199204
build-essential \
205+
curl \
200206
&& rm -rf /var/lib/apt/lists/*
201207

208+
# Install uv for faster, deterministic installs
209+
ENV PATH="/root/.cargo/bin:${PATH}"
210+
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
211+
202212
WORKDIR /test
203213

204214
# Copy the wheel from builder
205215
COPY --from=python-builder /build/dist/*.whl /tmp/
206216

207217
# Install the wheel and test dependencies
208-
RUN pip install --no-cache-dir /tmp/*.whl pytest pytest-cov
218+
RUN uv pip install --system /tmp/*.whl pytest pytest-cov
209219

210220
# Copy tests
211221
COPY --from=python-builder /build/tests ./tests/

bindings/python/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Quick links:
2525
### Installation
2626

2727
```bash
28-
pip install arcadedb-embedded
28+
uv pip install arcadedb-embedded
2929
```
3030

3131
**Requirements:**
@@ -143,8 +143,8 @@ source .venv/bin/activate
143143
.venv\Scripts\activate
144144

145145
# Install build and test dependencies
146-
pip install build
147-
pip install -e ".[test]"
146+
uv pip install build
147+
uv pip install -e ".[test]"
148148
```
149149

150150
### Build the Package

bindings/python/build-native.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ done
7777
if [[ -z "$PYTHON_WITH_BUILD" ]]; then
7878
echo -e "${RED}❌ build module not found or broken in any Python installation${NC}"
7979
echo -e "${YELLOW}💡 Please ensure build module is properly installed:${NC}"
80-
echo -e "${YELLOW} 1. If you have a venv, activate it and run: pip install build${NC}"
80+
echo -e "${YELLOW} 1. If you have a venv, activate it and run: uv pip install build${NC}"
8181
echo -e "${YELLOW} 2. Otherwise, create a venv:${NC}"
8282
echo -e "${YELLOW} python3 -m venv .build-env${NC}"
8383
echo -e "${YELLOW} source .build-env/bin/activate${NC}"
84-
echo -e "${YELLOW} pip install build${NC}"
84+
echo -e "${YELLOW} uv pip install build${NC}"
8585
echo -e "${YELLOW} ./build.sh${NC}"
8686
exit 1
8787
fi

bindings/python/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,7 @@ fi
326326
echo ""
327327
echo -e "${BLUE}💡 Next steps:${NC}"
328328
echo -e " 📦 Install the package:"
329-
echo -e " ${YELLOW}pip install dist/arcadedb_embedded-*.whl${NC}"
329+
echo -e " ${YELLOW}uv pip install dist/arcadedb_embedded-*.whl${NC}"
330330
echo ""
331331
echo -e " 🧪 Run tests:"
332332
echo -e " ${YELLOW}pytest tests/${NC}"

bindings/python/docs/development/architecture.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -504,7 +504,7 @@ The Python binding is distributed as a **single, self-contained package** (`arca
504504
- **Zero Configuration**: No external Java installation required.
505505

506506
```python
507-
# pip install arcadedb-embedded
507+
# uv pip install arcadedb-embedded
508508
import arcadedb_embedded as arcadedb
509509

510510
db = arcadedb.create_database("./mydb")

bindings/python/docs/development/build-architecture.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ Initially, we were creating `py3-none-any` wheels because:
5454

5555
- `pyproject.toml` alone doesn't communicate platform-specificity to setuptools
5656
- Without `setup.py`, setuptools assumes "pure Python" package
57-
- Result: All platforms got same wheel name, pip couldn't select correct one
57+
- Result: All platforms got same wheel name, uv pip couldn't select correct one
5858

5959
**The Solution - setup.py**:
6060

@@ -76,7 +76,7 @@ setup(
7676
This simple class tells setuptools "this package has binary content" which:
7777

7878
- Triggers platform-specific wheel naming
79-
- Makes pip download the correct wheel for each platform
79+
- Makes uv pip download the correct wheel for each platform
8080
- Enables platform tags like `macosx_11_0_arm64`, `manylinux_2_17_x86_64`, etc.
8181

8282
**Without setup.py**: All platforms → `arcadedb_embedded-X.Y.Z-py3-none-any.whl` (wrong!)
@@ -412,7 +412,7 @@ docker build -f Dockerfile.build -t arcadedb-python-builder .
412412

413413
```bash
414414
# Install wheel
415-
pip install dist/arcadedb_embedded-*.whl
415+
uv pip install dist/arcadedb_embedded-*.whl
416416

417417
# Run tests
418418
pytest tests/

0 commit comments

Comments
 (0)