Skip to content

Commit 0108fc5

Browse files
committed
test
1 parent 5dce4ea commit 0108fc5

File tree

8 files changed

+2255
-2154
lines changed

8 files changed

+2255
-2154
lines changed

.github/workflows/backend-checks.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,13 @@ jobs:
1919
- uses: actions/setup-python@v5
2020
with:
2121
python-version: "3.11.6"
22-
- run: |
23-
pip install pdm==2.21.0 uv==0.5.5
24-
pdm config use_uv true
25-
26-
- name: Cache PDM
27-
uses: actions/cache@v4
28-
id: cache-deps
29-
with:
30-
path: backend/.venv
31-
key: pdm-${{ hashFiles('**/pdm.lock') }}-2
22+
- run: pip install uv==0.5.5
3223

3324
- name: Install python dependencies
34-
if: steps.cache-deps.outputs.cache-hit != 'true'
35-
run: pdm install
25+
run: uv sync
3626

3727
- name: Check missing not pushed migrations
38-
run: pdm run python manage.py makemigrations --check
28+
run: uv run python manage.py makemigrations --check
3929
env:
4030
DJANGO_SETTINGS_MODULE: pycon.settings.test
4131
STRIPE_SECRET_API_KEY: ""

.github/workflows/backend-test.yml

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -39,26 +39,16 @@ jobs:
3939
- uses: actions/setup-python@v5
4040
with:
4141
python-version: "3.11.6"
42-
- run: |
43-
pip install pdm==2.21.0 uv==0.5.5 codecov
44-
pdm config use_uv true
45-
46-
- name: Cache PDM
47-
uses: actions/cache@v4
48-
id: cache-deps
49-
with:
50-
path: backend/.venv
51-
key: pdm-${{ hashFiles('**/pdm.lock') }}-1
42+
- run: pip install uv==0.5.5 codecov
5243

5344
- name: Install python dependencies
54-
if: steps.cache-deps.outputs.cache-hit != 'true'
55-
run: pdm install
45+
run: uv sync
5646

5747
- name: pytest
5848
run: |
5949
set +e
6050
CPUS=$(nproc --all)
61-
OUTPUT=$(pdm run pytest --cov-report xml --cov=. --cov-fail-under 80 --durations 10 -n $CPUS)
51+
OUTPUT=$(uv run pytest --cov-report xml --cov=. --cov-fail-under 80 --durations 10 -n $CPUS)
6252
STATUS=$?
6353
echo "$OUTPUT"
6454
cd ..

Dockerfile.python.local

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,7 @@ ARG FUNCTION_DIR
99
RUN mkdir -p ${FUNCTION_DIR}
1010
WORKDIR ${FUNCTION_DIR}
1111

12-
RUN pip install pdm==2.21.0 uv==0.5.5
13-
RUN pdm config use_uv true
14-
15-
COPY pyproject.toml pdm.lock ${FUNCTION_DIR}
12+
RUN pip install uv==0.5.5
1613

1714
RUN mkdir -p ${FUNCTION_DIR}/assets
1815

backend/Dockerfile

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ RUN apt-get update -y && apt-get install -y \
1717

1818
ENV LIBRARY_PATH=/lib:/usr/lib
1919

20-
RUN pip install pdm==2.21.0 uv==0.5.5
20+
RUN pip install uv==0.5.5
2121

2222
ARG TARGETPLATFORM
2323

@@ -78,10 +78,9 @@ RUN if [ "$TARGETPLATFORM" = "linux/arm64" ]; then \
7878
fi
7979

8080

81-
COPY pyproject.toml pdm.lock ${FUNCTION_DIR}
81+
COPY pyproject.toml uv.lock ${FUNCTION_DIR}
8282

83-
RUN pdm config use_uv true
84-
RUN pdm install --prod
83+
RUN uv sync --no-dev
8584

8685
# Create GraphQL schema
8786

backend/pdm.lock

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

backend/pyproject.toml

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
[build-system]
2-
requires = ["pdm-backend"]
3-
build-backend = "pdm.backend"
4-
51
[tool]
62
[tool.ruff]
73
line-length = 88
@@ -45,9 +41,6 @@ known-first-party = [
4541
]
4642

4743

48-
[tool.pdm.build]
49-
includes = []
50-
5144
[project]
5245
requires-python = "<3.13,>=3.11"
5346
dependencies = ["django==5.1.1", "django-environ==0.10.0", "django-model-utils==4.5.1", "django-timezone-field==7.0", "certifi==2024.7.4", "chardet==5.2.0", "idna==3.7", "requests==2.32.3", "urllib3==2.2.2", "aniso8601==9.0.1", "whitenoise==6.7.0", "django-ordered-model==3.5", "uWSGI==2.0.26", "django-storages==1.14.4", "sentry-sdk==2.11.0", "boto3==1.34.149", "pycountry<20.0,>=19.8", "countries<1.0.0,>=0.2.0", "django-ses==4.1.1", "hashids<2.0.0,>=1.2.0", "django-autocomplete-light==3.9.4", "django-queryinspect<2.0.0,>=1.1.0", "lxml<5.0.0,>=4.5.0", "unidecode<2.0.0,>=1.1.1", "strawberry-graphql==0.243.1", "Werkzeug<2.0.0,>=1.0.1", "django-import-export<4.0.0,>=3.2.0", "dal-admin-filters==1.1.0", "django-markdownify==0.9.5", "psycopg2==2.9.9", "django-imagekit==5.0.0", "pillow==10.4.0", "redis[hiredis]==5.0.2", "google-api-python-client<3.0.0,>=2.94.0", "google-auth<3.0.0,>=2.22.0", "opencv-python<5.0.0.0,>=4.8.0.74", "argon2-cffi<24.0.0,>=23.1.0", "stripe==10.5.0", "djangorestframework==3.15.2", "l18n<2022.0,>=2021.3", "wagtail==6.2.2", "wagtail-localize==1.10", "celery==5.4.0", "wagtail-headless-preview==0.8.0", "Jinja2>=3.1.3", "icalendar>=5.0.11", "pyclamd>=0.4.0", "magika>=0.5.1", "tzdata>=2024.1", "wagtail-factories==4.2.1", "google-auth-oauthlib>=1.2.1", "PyJWT>=2.8.0", "cryptography>=43.0.0", "openai>=1.52.0", "pydantic>=2.9.2", "gunicorn>=23.0.0", "tinycss2>=1.4.0"]
@@ -59,5 +52,5 @@ name = "Python Italia"
5952
[project.license]
6053
text = "MIT"
6154

62-
[project.optional-dependencies]
55+
[dependency-groups]
6356
dev = ["mypy<2.0.0,>=1.2.0", "pytest==7.4.3", "pytest-cov==4.1.0", "pytest-django==4.6.0", "factory-boy==3.3.0", "pdbpp<1.0.0,>=0.10.3", "requests-mock<2.0.0,>=1.11.0", "pytest-mock<4.0.0,>=3.12.0", "pytest-cache<2.0,>=1.0", "time-machine<3.0.0,>=2.13.0", "libcst<2.0.0,>=1.1.0", "wagtail-factories<5.0.0,>=4.1.0", "pytest-xdist>=3.5.0", "websockets>=12.0", "typer>=0.12.3"]

0 commit comments

Comments
 (0)