Skip to content

Commit ffad17d

Browse files
committed
Migrate to uv
1 parent 79b6b59 commit ffad17d

File tree

6 files changed

+827
-28
lines changed

6 files changed

+827
-28
lines changed

.dockerignore

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

Dockerfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
FROM sourcepole/qwc-uwsgi-base:alpine-v2023.10.26
1+
FROM sourcepole/qwc-uwsgi-base:alpine-v2025.01.24
22

3-
ADD requirements.txt /srv/qwc_service/requirements.txt
3+
WORKDIR /srv/qwc_service
4+
ADD pyproject.toml uv.lock ./
45

56
# git: Required for pip with git repos
67
# postgresql-dev g++ python3-dev: Required for psycopg2
78
RUN \
89
apk add --no-cache --update --virtual runtime-deps postgresql-libs && \
910
apk add --no-cache --update --virtual build-deps git postgresql-dev g++ python3-dev && \
10-
pip3 install --no-cache-dir -r /srv/qwc_service/requirements.txt && \
11+
uv sync --frozen && \
1112
apk del build-deps
1213

1314
ADD src /srv/qwc_service/

README.md

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -150,17 +150,9 @@ Endpoints:
150150
Development
151151
-----------
152152

153-
Create a virtual environment:
153+
Install dependencies:
154154

155-
python3 -m venv .venv
156-
157-
Activate virtual environment:
158-
159-
source .venv/bin/activate
160-
161-
Install requirements:
162-
163-
pip install -r requirements.txt
155+
uv sync
164156

165157
Set the `CONFIG_PATH` environment variable to the path containing the service config and permission files when starting this service (default: `config`).
166158

@@ -174,4 +166,4 @@ Configure development environment:
174166

175167
Start local service:
176168

177-
python src/server.py
169+
uv run src/server.py

pyproject.toml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
[project]
2+
name = "qwc-db-auth"
3+
version = "v2024.12.05"
4+
description = "Authentication with User DB"
5+
readme = "README.md"
6+
requires-python = ">=3.10"
7+
dependencies = [
8+
"Flask~=3.0.0",
9+
"Werkzeug~=3.0.6",
10+
"Flask-JWT-Extended~=4.6.0",
11+
"flask_login~=0.6.3",
12+
"Flask-WTF~=1.2.1",
13+
"Flask-Mail2~=1.0.2",
14+
"Pillow~=10.4.0",
15+
"psycopg2~=2.9.9",
16+
"SQLAlchemy~=2.0.29",
17+
"pyotp~=2.9.0",
18+
"qrcode~=7.4.2",
19+
"python-i18n~=0.3.9",
20+
"email_validator~=2.1.0.post1",
21+
"qwc-services-core~=1.3.34"
22+
]
23+
24+
[dependency-groups]
25+
dev = [
26+
"python-dotenv>=1.0.1",
27+
]

0 commit comments

Comments
 (0)