Skip to content

Commit 5ec940f

Browse files
committed
Switch to uv for dependency locking
1 parent f8451ac commit 5ec940f

File tree

7 files changed

+743
-25
lines changed

7 files changed

+743
-25
lines changed

.github/workflows/test.yml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,8 @@ on:
55

66
jobs:
77
build:
8-
env:
9-
UV_SYSTEM_PYTHON: 1
108
runs-on: ubuntu-latest
11-
strategy:
12-
matrix:
13-
python-version: [ '3.11', '3.12']
14-
fail-fast: false
15-
name: Tests with Python ${{ matrix.python-version }}
9+
name: Run tests
1610
services:
1711
postgres:
1812
image: postgis/postgis:13-3.1-alpine
@@ -36,9 +30,8 @@ jobs:
3630
- name: Setup python
3731
uses: actions/setup-python@v1
3832
with:
39-
python-version: ${{ matrix.python-version }}
40-
architecture: x64
41-
- run: uv pip install -r requirements.txt
33+
python-version-file: ".python-version"
34+
- run: uv sync --locked --all-extras
4235
- run: createdb jedeschule_test
4336
env:
4437
PGHOST: localhost
@@ -47,7 +40,7 @@ jobs:
4740
PGUSER: postgres
4841
- run: |
4942
set -e
50-
alembic upgrade head
51-
python test_models.py
43+
uv run alembic upgrade head
44+
uv run python test_models.py
5245
env:
5346
DATABASE_URL: postgresql://postgres:[email protected]:5432/jedeschule_test

.github/workflows/test_scraper_changes.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@ jobs:
1717
- name: Setup python
1818
uses: actions/setup-python@v1
1919
with:
20-
python-version: 3.11
21-
architecture: x64
22-
- run: uv pip install -r requirements.txt
23-
- run: ./test_changes.sh
20+
python-version-file: ".python-version"
21+
- run: uv sync --locked --all-extras
22+
- run: uv run ./test_changes.sh

.python-version

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

Dockerfile

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ FROM scrapinghub/scrapinghub-stack-scrapy:2.11
22

33
COPY . .
44

5-
RUN pip install -r requirements.txt
5+
COPY --from=ghcr.io/astral-sh/uv:latest /uv /uvx /bin/
6+
7+
RUN uv pip install -r requirements.txt
68

79
# Install pg_isready to await db start
810
RUN apt-get update && \

pyproject.toml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
[project]
2+
name = "jedeschule-scraper"
3+
version = "0.1.0"
4+
description = "Web scrapers for the jedeschule.codefor.de project"
5+
readme = "README.md"
6+
requires-python = ">=3.12"
7+
dependencies = [
8+
"alembic==1.3.3",
9+
"geoalchemy2==0.8.4",
10+
"psycopg2==2.9.10",
11+
"pyproj==3.6.1",
12+
"requests==2.32.0",
13+
"scrapy==2.11.2",
14+
"sqlalchemy==1.3.10",
15+
"xlrd==1.1.0",
16+
]

requirements.txt

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

uv.lock

Lines changed: 715 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)