Skip to content

Commit e089ce8

Browse files
committed
Convert pipenv to uv
1 parent 4f9eb33 commit e089ce8

File tree

10 files changed

+833
-582
lines changed

10 files changed

+833
-582
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
.venv
12
db.sqlite3
23
local_settings.py
34
settings_local.py

.github/workflows/django-ci.yml

Lines changed: 12 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -19,34 +19,25 @@ jobs:
1919

2020
steps:
2121

22-
- uses: actions/checkout@v3
22+
- uses: actions/checkout@v4
2323

24-
- name: Set up Python ${{ matrix.python-version }}
25-
uses: actions/setup-python@v4
24+
- name: Install uv and set the python version
25+
uses: astral-sh/setup-uv@v6
2626
with:
27+
enable-cache: true
28+
version: "0.8.24"
2729
python-version: ${{ matrix.python-version }}
2830

29-
- name: Install Dependencies
30-
run: |
31-
python -m pip install --upgrade pip
32-
python -m pip install pipenv
33-
python -m pip install pre-commit
31+
- name: Install the project
32+
run: uv sync --locked --all-extras --dev
3433

3534
- name: pre-commit
3635
run: |
37-
pre-commit run --all-files
38-
39-
- name: Check requirements.txt is up to date
40-
run: |
41-
pipenv requirements --hash >requirements.txt.new
42-
diff -usw requirements.txt requirements.txt.new
43-
44-
- name: Install requirements
45-
run: pipenv sync
36+
uvx [email protected] run --all-files
4637
4738
- name: Run Tests
4839
run: |
49-
pipenv run python manage.py test
50-
pipenv run python manage.py makemigrations
51-
pipenv run python manage.py migrate
52-
pipenv run python manage.py check
40+
uv run ./manage.py test
41+
uv run ./manage.py makemigrations
42+
uv run ./manage.py migrate
43+
uv run ./manage.py check

.pre-commit-config.yaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# SPDX-FileCopyrightText: 2022-2024 Tim Hawes <[email protected]>
1+
# SPDX-FileCopyrightText: 2022-2025 Tim Hawes <[email protected]>
22
#
33
# SPDX-License-Identifier: CC0-1.0
44

@@ -7,6 +7,7 @@ repos:
77
rev: v5.0.0
88
hooks:
99
- id: trailing-whitespace
10+
exclude: ^requirements\.txt$
1011
- id: end-of-file-fixer
1112
- id: check-added-large-files
1213
- id: check-ast
@@ -18,3 +19,7 @@ repos:
1819
rev: v3.19.0
1920
hooks:
2021
- id: pyupgrade
22+
- repo: https://github.com/astral-sh/uv-pre-commit
23+
rev: 0.8.24
24+
hooks:
25+
- id: uv-export

.python-version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
3.12
1+
3.13

Dockerfile

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
1-
# SPDX-FileCopyrightText: 2024 Tim Hawes <[email protected]>
1+
# SPDX-FileCopyrightText: 2024-2025 Tim Hawes <[email protected]>
22
#
33
# SPDX-License-Identifier: CC0-1.0
44

55
FROM python:3.13
6+
COPY --from=ghcr.io/astral-sh/uv:0.8.24 /uv /uvx /bin/
67

7-
WORKDIR /usr/src/app
8-
9-
COPY requirements.txt .
10-
RUN pip install --require-hashes -r requirements.txt
11-
12-
COPY . .
8+
COPY . /app
9+
WORKDIR /app
10+
RUN uv sync --locked
11+
ENV PATH="/app/.venv/bin:$PATH"
1312

1413
ENV DJANGO_SETTINGS_MODULE=hackdb.settings_docker
1514

Pipfile

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

Pipfile.lock

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

pyproject.toml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
[project]
2+
name = ""
3+
version = "0.0.1"
4+
requires-python = ">=3.10, <3.14"
5+
dependencies = [
6+
"django==5.2.*",
7+
"django-allauth[socialaccount]",
8+
"django-bootstrap5",
9+
"django-countries",
10+
"django-phonenumber-field[phonenumbers]",
11+
"django-extensions",
12+
"passlib",
13+
"ldif",
14+
"ldap3",
15+
"requests",
16+
"gunicorn",
17+
"tabulate",
18+
]
19+
20+
[dependency-groups]
21+
dev = []
22+
23+
[tool.uv]
24+
package = false
25+
26+
[[tool.uv.index]]
27+
name = "pypi"
28+
url = "https://pypi.org/simple"

requirements.txt

Lines changed: 276 additions & 28 deletions
Large diffs are not rendered by default.

uv.lock

Lines changed: 503 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)