Skip to content

Commit 38732c8

Browse files
committed
Switch to uv
1 parent e31ddae commit 38732c8

File tree

5 files changed

+934
-23
lines changed

5 files changed

+934
-23
lines changed

.github/workflows/python-tests.yml

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,20 +11,11 @@ jobs:
1111
uses: actions/checkout@v3
1212

1313
- name: Set up Python
14-
uses: actions/setup-python@v4
15-
with:
16-
python-version: "3.10"
17-
cache: "pip"
18-
cache-dependency-path: requirements.*.txt
19-
20-
- name: Install Python dependencies
21-
run: |
22-
python -m pip install --upgrade pip
23-
pip install -r requirements.prod.txt -r requirements.dev.txt
14+
uses: astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86 # v5.4.2
2415

2516
- name: Run pre-commit
2617
run: |
27-
pre-commit run --all-files --show-diff-on-failure
18+
uv run pre-commit run --all-files --show-diff-on-failure
2819
2920
- name: Run Python tests
3021
run: |

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.10

Makefile

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,24 +6,19 @@ help:
66
@echo " make run-prod: run webserver as in deployed environment."
77
@echo " make compile: compile the requirements specs."
88

9-
_uv:
10-
# ensure uv is installed
11-
pip install uv
12-
139
test:
14-
coverage run -m pytest -vvv
15-
coverage report
10+
uv run coverage run -m pytest -vvv
11+
uv run coverage report
1612

1713
mypy:
18-
mypy . | mypy-json-report > mypy-ratchet.json
14+
uv run mypy . | uv run mypy-json-report > mypy-ratchet.json
1915
git diff --exit-code mypy-ratchet.json
2016

21-
build: _uv
22-
uv pip install -r requirements.prod.txt -r requirements.dev.txt
23-
python manage.py collectstatic --no-input
17+
build:
18+
uv run manage.py collectstatic --no-input
2419
rm -f ccbv.sqlite
25-
python manage.py migrate
26-
python manage.py load_all_django_versions
20+
uv run manage.py migrate
21+
uv run manage.py load_all_django_versions
2722

2823
run-prod:
2924
gunicorn core.wsgi --log-file -

pyproject.toml

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,35 @@
1+
[project]
2+
name = "ccbv"
3+
version = "1.0.0"
4+
description = "Tool to view class hierarchies"
5+
requires-python = ">=3.10"
6+
dependencies = [
7+
"attrs>=21.4.0",
8+
"blessings>=1.7",
9+
"django~=3.1.14",
10+
"django-extensions>=3.1.3",
11+
"django-pygmy>=0.1.5",
12+
"django-sans-db>=1.2.0",
13+
"environs[django]>=9.5.0",
14+
"gunicorn>=20.1.0",
15+
"requests>=2.32.3",
16+
"sphinx>=8.1.3",
17+
"werkzeug>=2.0.2",
18+
"whitenoise>=5.3.0",
19+
]
20+
21+
[dependency-groups]
22+
dev = [
23+
"coverage[toml]>=6.5.0",
24+
"factory-boy>=3.2.0",
25+
"mypy>=0.931",
26+
"mypy-json-report>=0.1.3",
27+
"pre-commit>=2.15.0",
28+
"pytest>=7.1.2",
29+
"pytest-django>=4.5.2",
30+
"types-requests>=2.27.7",
31+
]
32+
133
[tool.coverage.run]
234
branch = true
335
dynamic_context = "test_function"

0 commit comments

Comments
 (0)