Skip to content

Commit a40a740

Browse files
committed
Migrate to uv
1 parent 606f853 commit a40a740

File tree

6 files changed

+835
-24
lines changed

6 files changed

+835
-24
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: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -93,18 +93,6 @@ For more information please visit: https://github.com/qwc-services/qwc-docker
9393
Development
9494
-----------
9595

96-
Create a virtual environment:
97-
98-
python3 -m venv .venv
99-
100-
Activate virtual environment:
101-
102-
source .venv/bin/activate
103-
104-
Install requirements:
105-
106-
pip install -r requirements.txt
107-
10896
Set the `CONFIG_PATH` environment variable to the path containing the service config and permission files when starting this service (default: `config`).
10997

11098
export CONFIG_PATH=../qwc-docker/volumes/config
@@ -113,6 +101,6 @@ Configure environment:
113101

114102
echo FLASK_ENV=development >.flaskenv
115103

116-
Start local service:
104+
Install dependencies and run service:
117105

118-
python src/server.py
106+
uv run src/server.py

pyproject.toml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
[project]
2+
name = "qwc-permalink-service"
3+
version = "v2024.12.14"
4+
description = "QWC Permalink Service"
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-restx~=1.3.0",
12+
"psycopg2~=2.9.9",
13+
"SQLAlchemy~=2.0.29",
14+
"qwc-services-core~=1.3.34"
15+
]
16+
17+
[dependency-groups]
18+
dev = [
19+
"flask-cors>=5.0.0",
20+
"python-dotenv>=1.0.1",
21+
]

0 commit comments

Comments
 (0)