Skip to content

Commit 53fad2e

Browse files
Migrate from pipenv to uv (#107)
1 parent 1594a94 commit 53fad2e

8 files changed

Lines changed: 2109 additions & 2091 deletions

File tree

.github/workflows/ci.yml

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ defaults:
77
run:
88
shell: bash
99

10+
env:
11+
UV_LOCKED: 1
12+
1013
jobs:
1114
test:
1215
runs-on: ubuntu-latest
@@ -30,21 +33,15 @@ jobs:
3033
uses: actions/setup-python@v5
3134
with:
3235
python-version: ${{ matrix.python-version }}
33-
cache: pipenv
34-
35-
- name: Install pipenv
36-
run: pip install pipenv
3736

38-
# we have to check this first because
39-
# installing autofixes the lock
40-
- name: Check Pipfile.lock
41-
run: pipenv verify
37+
- name: Install the latest version of uv
38+
uses: astral-sh/setup-uv@v6
4239

4340
- name: Install dependencies
44-
run: pipenv install --categories="packages dev-packages ci" --deploy
41+
run: uv sync --group ci
4542

4643
- name: Run Tests
47-
run: pipenv run pytest --cov=tin
44+
run: uv run pytest --cov=tin
4845

4946
- name: Run Coveralls
5047
uses: AndreMiras/coveralls-python-action@develop
@@ -77,15 +74,13 @@ jobs:
7774
uses: actions/setup-python@v5
7875
with:
7976
python-version: ${{ matrix.python-version }}
80-
cache: pipenv
8177

82-
- name: Install pipenv
83-
run: pip install pipenv
78+
- name: Install the latest version of uv
79+
uses: astral-sh/setup-uv@v6
8480

8581
- name: Install dependencies
86-
run: pipenv install --dev
82+
run: uv sync
8783

8884
- name: Build Docs
89-
run: |
90-
cd docs
91-
pipenv run make html SPHINXOPTS="-W --keep-going"
85+
run: uv run make html SPHINXOPTS="-W --keep-going"
86+
working-directory: docs

.github/workflows/deploy-docs.yml

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,18 +22,16 @@ jobs:
2222
uses: actions/setup-python@v5
2323
with:
2424
python-version: ${{ matrix.python-version }}
25-
cache: pipenv
2625

27-
- name: Install pipenv
28-
run: pip install pipenv
26+
- name: Install the latest version of uv
27+
uses: astral-sh/setup-uv@v6
2928

3029
- name: Install dependencies
31-
run: pipenv install --dev
30+
run: uv sync
3231

33-
- name: Build docs
34-
run: |
35-
cd docs
36-
pipenv run make html
32+
- name: Build Docs
33+
run: uv run make html SPHINXOPTS="-W --keep-going"
34+
working-directory: docs
3735

3836
- name: Upload docs artifact
3937
uses: actions/upload-pages-artifact@v3

Dockerfile

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
FROM python:3.11-slim-bookworm
22

3-
ENV PYTHONUNBUFFERED=1 PIPENV_VENV_IN_PROJECT=1 C_FORCE_ROOT=1
3+
ENV PYTHONUNBUFFERED=1 C_FORCE_ROOT=1
44

5-
COPY Pipfile .
6-
COPY Pipfile.lock .
5+
COPY pyproject.toml .
6+
COPY uv.lock .
77

8-
RUN apt-get update -y && apt-get install -y --no-install-recommends curl firejail
8+
ENV UV_LINK_MODE=copy \
9+
UV_COMPILE_BYTECODE=1 \
10+
UV_PYTHON_DOWNLOADS=never \
11+
UV_PROJECT_ENVIRONMENT="/venv"
912

10-
RUN pip install pipenv && \
11-
pipenv install --dev
13+
RUN apt-get update -y && apt-get install -y --no-install-recommends curl firejail
1214

13-
ENV PATH="/.venv/bin:$PATH"
15+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
16+
RUN uv sync --frozen
1417

1518
WORKDIR /app

Pipfile

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)