Skip to content

Commit 5dc09d8

Browse files
committed
switch from poetry to uv, use python 3.12
1 parent cc17878 commit 5dc09d8

40 files changed

+1941
-3232
lines changed

.github/workflows/backend.yml

+13-13
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ jobs:
1515
working-directory: backend
1616
steps:
1717
- uses: actions/checkout@v4
18-
- run: pipx install poetry==1.7.1
19-
- uses: actions/setup-python@v4
18+
- name: uv
19+
id: setup-uv
20+
uses: astral-sh/setup-uv@v4
2021
with:
21-
python-version: '3.11'
22-
cache: 'poetry'
23-
cache-dependency-path: backend/poetry.lock
24-
- run: |
25-
poetry env use python3.11
26-
poetry install --sync
22+
version: "0.5.5"
23+
enable-cache: true
24+
cache-dependency-glob: "./backend/uv.lock"
25+
- name: uv sync
26+
run: uv sync --frozen --group dev
2727
- uses: actions/setup-node@v4
2828
with:
2929
node-version: '20'
@@ -42,20 +42,20 @@ jobs:
4242
npm run build
4343
working-directory: ${{ github.workspace }}/authpage
4444
- name: Pytest
45-
run: poetry run pytest
45+
run: uv run pytest
4646
env:
4747
QUERY_TEST: true
4848
- name: Black
49-
run: poetry run black src tests
49+
run: uv run black src tests
5050
- name: Ruff
51-
run: poetry run ruff src tests
51+
run: uv run ruff check src tests
5252
- name: Cache mypy results
5353
uses: actions/cache@v3
5454
with:
55-
key: mypy-${{ hashFiles('backend/poetry.lock') }}
55+
key: mypy-${{ hashFiles('backend/uv.lock') }}
5656
path: backend/.mypy_cache
5757
- name: Mypy
58-
run: poetry run mypy
58+
run: uv run mypy
5959
services:
6060
postgres:
6161
image: ghcr.io/dsav-dodeka/postgres:localdev

.github/workflows/ci.yml

+15-13
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ permissions:
1313

1414
jobs:
1515
backend-ci:
16-
uses: DSAV-Dodeka/dodeka/.github/workflows/backend.yml@main
16+
uses: DSAV-Dodeka/dodeka/.github/workflows/backend.yml@uv-312
1717

1818
config-deploy:
1919
runs-on: ubuntu-latest
@@ -22,13 +22,15 @@ jobs:
2222
working-directory: deploy
2323
steps:
2424
- uses: actions/checkout@v4
25-
- run: pipx install poetry==1.7.1
26-
- uses: actions/setup-python@v4
25+
- name: uv
26+
id: setup-uv
27+
uses: astral-sh/setup-uv@v4
2728
with:
28-
python-version: '3.11'
29-
cache: 'poetry'
30-
cache-dependency-path: deploy/poetry.lock
31-
- run: poetry install
29+
version: "0.5.5"
30+
enable-cache: true
31+
cache-dependency-glob: "./deploy/uv.lock"
32+
- name: uv sync
33+
run: uv sync --frozen
3234
# Build config using tiptenbrink/confspawn
3335
- uses: taiki-e/install-action@v2
3436
with:
@@ -50,25 +52,25 @@ jobs:
5052
needs: [backend-ci, config-deploy]
5153
strategy:
5254
matrix:
53-
target: ['localdev', 'staging', 'production' ]
54-
uses: DSAV-Dodeka/dodeka/.github/workflows/db.yml@main
55+
target: ['localdev' ]
56+
uses: DSAV-Dodeka/dodeka/.github/workflows/db.yml@uv-312
5557
with:
5658
env: ${{ matrix.target }}
5759

5860
build-server:
5961
needs: [backend-ci, config-deploy]
6062
strategy:
6163
matrix:
62-
target: ['localdev', 'staging', 'production' ]
63-
uses: DSAV-Dodeka/dodeka/.github/workflows/server.yml@main
64+
target: ['localdev' ]
65+
uses: DSAV-Dodeka/dodeka/.github/workflows/server.yml@uv-312
6466
with:
6567
env: ${{ matrix.target }}
6668

6769
build-kv:
6870
needs: [backend-ci, config-deploy]
6971
strategy:
7072
matrix:
71-
target: ['localdev', 'staging', 'production' ]
72-
uses: DSAV-Dodeka/dodeka/.github/workflows/kv.yml@main
73+
target: ['localdev' ]
74+
uses: DSAV-Dodeka/dodeka/.github/workflows/kv.yml@uv-312
7375
with:
7476
env: ${{ matrix.target }}

.github/workflows/db.yml

+10-8
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,18 @@ jobs:
2121
working-directory: deploy
2222
steps:
2323
- uses: actions/checkout@v4
24-
- run: pipx install poetry==1.7.1
25-
- uses: actions/setup-python@v4
24+
- name: uv
25+
id: setup-uv
26+
uses: astral-sh/setup-uv@v4
2627
with:
27-
python-version: '3.10'
28-
cache: 'poetry'
29-
cache-dependency-path: deploy/poetry.lock
30-
- run: poetry install
28+
version: "0.5.5"
29+
enable-cache: true
30+
cache-dependency-glob: "./deploy/uv.lock"
31+
- name: uv sync
32+
run: uv sync --frozen
3133
- name: Config
3234
run: |
33-
poetry run confspawn -c config.toml -s ./build/container/db -t ./context -e ${{ inputs.env }}
35+
uv run confspawn -c config.toml -s ./build/container/db -t ./context -e ${{ inputs.env }}
3436
- name: Login to GitHub Container Registry
3537
uses: docker/login-action@v3
3638
with:
@@ -51,7 +53,7 @@ jobs:
5153
run: echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
5254
# We need to use the image name in each tag, so we set that to an env as well
5355
- name: Image name
54-
run: echo "IMAGE_NM=$(poetry run confenv -c config.toml -v db.image_name -e ${{ inputs.env }})" >> $GITHUB_ENV
56+
run: echo "IMAGE_NM=$(uv run confenv -c config.toml -v db.image_name -e ${{ inputs.env }})" >> $GITHUB_ENV
5557

5658
##### not-production will get :<env> and :<env>-<commit sha>, production only gets :<commit sha>
5759
##### because for production the 'latest' should only be on a release

.github/workflows/kv.yml

+12-10
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,24 @@ jobs:
2121
working-directory: deploy
2222
steps:
2323
- uses: actions/checkout@v4
24-
- run: pipx install poetry==1.7.1
25-
- uses: actions/setup-python@v4
24+
- name: uv
25+
id: setup-uv
26+
uses: astral-sh/setup-uv@v4
2627
with:
27-
python-version: '3.10'
28-
cache: 'poetry'
29-
cache-dependency-path: deploy/poetry.lock
30-
- run: poetry install
28+
version: "0.5.5"
29+
enable-cache: true
30+
cache-dependency-glob: "./deploy/uv.lock"
31+
- name: uv sync
32+
run: uv sync --frozen
3133
# Build config using tiptenbrink/confspawn
3234
- name: Config
3335
run: |
34-
poetry run confspawn -c config.toml -s ./build/container/kv -t ./context -e ${{ inputs.env }}
35-
poetry run confspawn -c config.toml -s ./build/container/librejson -t ./contextlibrejson -e ${{ inputs.env }}
36+
uv run confspawn -c config.toml -s ./build/container/kv -t ./context -e ${{ inputs.env }}
37+
uv run confspawn -c config.toml -s ./build/container/librejson -t ./contextlibrejson -e ${{ inputs.env }}
3638
# Set env from config.toml
3739
- name: Set env.REJSON_VERSION
3840
run: |
39-
export REJSON_VERSION=$(poetry run confenv -c config.toml -v kv.redisjson_version)
41+
export REJSON_VERSION=$(uv run confenv -c config.toml -v kv.redisjson_version)
4042
echo "REJSON_VERSION=$REJSON_VERSION" >> $GITHUB_ENV
4143
# If librejson was previously built and stored in cache, use it
4244
- name: Load cached librejson.so
@@ -72,7 +74,7 @@ jobs:
7274
run: echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
7375
# We need to use the image name in each tag, so we set that to an env as well
7476
- name: Image name
75-
run: echo "IMAGE_NM=$(poetry run confenv -c config.toml -v kv.image_name -e ${{ inputs.env }})" >> $GITHUB_ENV
77+
run: echo "IMAGE_NM=$(uv run confenv -c config.toml -v kv.image_name -e ${{ inputs.env }})" >> $GITHUB_ENV
7678

7779
##### not-production will get :<env> and :<env>-<commit sha>, production only gets :<commit sha>
7880
##### because for production the 'latest' should only be on a release

.github/workflows/server.yml

+12-10
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,19 @@ jobs:
2121
working-directory: deploy
2222
steps:
2323
- uses: actions/checkout@v4
24-
- run: pipx install poetry==1.7.1
25-
- uses: actions/setup-python@v4
24+
- name: uv
25+
id: setup-uv
26+
uses: astral-sh/setup-uv@v4
2627
with:
27-
python-version: '3.10'
28-
cache: 'poetry'
29-
cache-dependency-path: deploy/poetry.lock
30-
- run: poetry install
28+
version: "0.5.5"
29+
enable-cache: true
30+
cache-dependency-glob: "./deploy/uv.lock"
31+
- name: uv sync
32+
run: uv sync --frozen
3133
- name: Config
3234
run: |
33-
poetry run confspawn -c config.toml -s ./build/container/server -t ./context/backend -e ${{ inputs.env }}
34-
poetry run confspawn -c config.toml -s ./build/container/authpage -t ./context/envauthpage -e ${{ inputs.env }}
35+
uv run confspawn -c config.toml -s ./build/container/server -t ./context/backend -e ${{ inputs.env }}
36+
uv run confspawn -c config.toml -s ./build/container/authpage -t ./context/envauthpage -e ${{ inputs.env }}
3537
3638
# First the lock file and project declaration are moved
3739
# Then the source is moved
@@ -41,7 +43,7 @@ jobs:
4143
- name: Move source
4244
working-directory: ${{ github.workspace }}
4345
run: |
44-
mv backend/poetry.lock deploy/context/backend
46+
mv backend/uv.lock deploy/context/backend
4547
mv backend/pyproject.toml deploy/context/backend
4648
mv backend/src deploy/context/backend/src
4749
mv authpage deploy/context/authpage
@@ -85,7 +87,7 @@ jobs:
8587
run: echo "SHA_SHORT=$(git rev-parse --short HEAD)" >> $GITHUB_ENV
8688
# We need to use the image name in each tag, so we set that to an env as well
8789
- name: Image name
88-
run: echo "IMAGE_NM=$(poetry run confenv -c config.toml -v server.image_name -e ${{ inputs.env }})" >> $GITHUB_ENV
90+
run: echo "IMAGE_NM=$(uv run confenv -c config.toml -v server.image_name -e ${{ inputs.env }})" >> $GITHUB_ENV
8991

9092
##### not-production will get :<env> and :<env>-<commit sha>, production only gets :<commit sha>
9193
##### because for production the 'latest' should only be on a release

.gitignore

-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
*.pyd
44
.coverage
55
__pycache__
6-
.python-version
76
.DS_Store
87
.vscode

actions.nu

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@ let backend_dir = root backend_dir
66

77
def main [action: string] {
88
cd $backend_dir
9-
poetry run python actions/actions.py $action
9+
uv run python actions/actions.py $action
1010
}

backend/.python-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.12

backend/README.md

Whitespace-only changes.

0 commit comments

Comments
 (0)