From 45f5108717985dd3ece4bad8ed6d433639e94aff Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 13 Nov 2024 08:25:40 +0100 Subject: [PATCH 1/9] requirements.txt updated --- requirements.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index ca92baf..1fb4868 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -fastapi==0.115.3 +fastapi==0.115.5 uvicorn[standard]==0.32.0 python-jose==3.3.0 pycryptodome==3.21.0 From 2b9d7821c02388ba79bef023a2037052e1919730 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 13 Nov 2024 08:33:28 +0100 Subject: [PATCH 2/9] improved gitlab test matrix --- .gitlab-ci.yml | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 5543e53..75b4a78 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -141,12 +141,16 @@ test: DATABASE: sqlite:///../app/db.sqlite parallel: matrix: - - IMAGE: [ 'python:3.11-slim-bookworm', 'python:3.12-slim-bullseye' ] - REQUIREMENTS: - - requirements.txt - - .DEBIAN/requirements-bookworm-12.txt - - .DEBIAN/requirements-ubuntu-23.10.txt - - .DEBIAN/requirements-ubuntu-24.04.txt + - IMAGE: [ 'python:3.12-slim-bookworm' ] + REQUIREMENTS: [ 'requirements.txt' ] + - IMAGE: [ 'debian:bookworm' ] + REQUIREMENTS: [ '.DEBIAN/requirements-bookworm-12.txt' ] + - IMAGE: [ 'ubuntu:23.10' ] + REQUIREMENTS: [ '.DEBIAN/requirements-ubuntu-23.10.txt' ] + - IMAGE: [ 'ubuntu:24.04' ] + REQUIREMENTS: [ '.DEBIAN/requirements-ubuntu-24.04.txt' ] + - IMAGE: [ 'ubuntu:24.10' ] + REQUIREMENTS: [ '.DEBIAN/requirements-ubuntu-24.10.txt' ] before_script: - apt-get update && apt-get install -y python3-dev gcc - pip install -r $REQUIREMENTS From 47624f501907fc440d0782f24edcd850a10f2378 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 13 Nov 2024 08:37:07 +0100 Subject: [PATCH 3/9] Dockerfile - updated db dependencies --- Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile b/Dockerfile index 7d2e448..4f1b1d0 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,7 +10,7 @@ RUN apk update \ && apk add --no-cache --virtual build-deps gcc g++ python3-dev musl-dev pkgconfig \ && apk add --no-cache curl postgresql postgresql-dev mariadb-dev sqlite-dev \ && pip install --no-cache-dir --upgrade uvicorn \ - && pip install --no-cache-dir psycopg2==2.9.9 mysqlclient==2.2.4 pysqlite3==0.5.2 \ + && pip install --no-cache-dir psycopg2==2.9.10 mysqlclient==2.2.6 pysqlite3==0.5.4 \ && pip install --no-cache-dir -r /tmp/requirements.txt \ && apk del build-deps From 0b4bb65546b486d2c0c690454580cdd42e1c4f97 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 13 Nov 2024 08:55:00 +0100 Subject: [PATCH 4/9] added python3-pip to test --- .gitlab-ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 75b4a78..4eb086f 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -152,7 +152,7 @@ test: - IMAGE: [ 'ubuntu:24.10' ] REQUIREMENTS: [ '.DEBIAN/requirements-ubuntu-24.10.txt' ] before_script: - - apt-get update && apt-get install -y python3-dev gcc + - apt-get update && apt-get install -y python3-dev python3-pip gcc - pip install -r $REQUIREMENTS - pip install pytest httpx - mkdir -p app/cert @@ -254,7 +254,7 @@ semgrep-sast: test_coverage: # extends: test - image: python:3.11-slim-bookworm + image: python:3.12-slim-bookworm allow_failure: true stage: test rules: From 98ef64211bee661044b2c1ad91b545856518b993 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 13 Nov 2024 09:09:00 +0100 Subject: [PATCH 5/9] typings --- .gitlab-ci.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 4eb086f..622f7f2 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -166,7 +166,7 @@ test: dotenv: version.env junit: ['**/report.xml'] -.test:linux: +.test:apt: stage: test rules: - if: $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH @@ -205,15 +205,15 @@ test: - apt-get purge -qq -y fastapi-dls - apt-get autoremove -qq -y && apt-get clean -qq -test:debian: - extends: .test:linux +test:apt:debian: + extends: .test:apt image: debian:bookworm-slim -test:ubuntu: - extends: .test:linux +test:apt:ubuntu: + extends: .test:apt image: ubuntu:24.04 -test:archlinux: +test:pacman:archlinux: image: archlinux:base rules: - if: $CI_COMMIT_BRANCH && $CI_COMMIT_BRANCH != $CI_DEFAULT_BRANCH From 459c0e21affdab0aa51d1e2141bee3d94d66e015 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 13 Nov 2024 10:27:52 +0100 Subject: [PATCH 6/9] debugging --- .gitlab-ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 622f7f2..b47717c 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -152,6 +152,7 @@ test: - IMAGE: [ 'ubuntu:24.10' ] REQUIREMENTS: [ '.DEBIAN/requirements-ubuntu-24.10.txt' ] before_script: + - echo "$IMAGE with $REQUIREMENTS" - apt-get update && apt-get install -y python3-dev python3-pip gcc - pip install -r $REQUIREMENTS - pip install pytest httpx From 4ab1a2ed22f00dddcd2dd651a1d4d00ebed0c4e1 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 13 Nov 2024 10:28:08 +0100 Subject: [PATCH 7/9] added requirements for ubuntu 24.10 --- .DEBIAN/requirements-ubuntu-24.10.txt | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 .DEBIAN/requirements-ubuntu-24.10.txt diff --git a/.DEBIAN/requirements-ubuntu-24.10.txt b/.DEBIAN/requirements-ubuntu-24.10.txt new file mode 100644 index 0000000..7a65314 --- /dev/null +++ b/.DEBIAN/requirements-ubuntu-24.10.txt @@ -0,0 +1,10 @@ +# https://packages.ubuntu.com +fastapi==0.110.3 +uvicorn[standard]==0.30.3 +python-jose[pycryptodome]==3.3.0 +pycryptodome==3.20.0 +python-dateutil==2.9.0 +sqlalchemy==2.0.32 +markdown==3.6 +python-dotenv==1.0.1 +jinja2==3.1.3 From 286399d79aea0800bc6b68857c541cfc479963e4 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 13 Nov 2024 10:48:11 +0100 Subject: [PATCH 8/9] fixed test matrix --- .gitlab-ci.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index b47717c..d35d571 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -152,8 +152,10 @@ test: - IMAGE: [ 'ubuntu:24.10' ] REQUIREMENTS: [ '.DEBIAN/requirements-ubuntu-24.10.txt' ] before_script: - - echo "$IMAGE with $REQUIREMENTS" - - apt-get update && apt-get install -y python3-dev python3-pip gcc + - apt-get update && apt-get install -y python3-dev python3-pip python3-venv gcc + - python -m venv venv + - source venv/bin/activate + - pip install --upgrade pip - pip install -r $REQUIREMENTS - pip install pytest httpx - mkdir -p app/cert From 52dd425583962e9990869f16c5fe7aed7aa27114 Mon Sep 17 00:00:00 2001 From: Oscar Krause Date: Wed, 13 Nov 2024 13:41:07 +0100 Subject: [PATCH 9/9] fixes --- .gitlab-ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d35d571..6181631 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -153,7 +153,7 @@ test: REQUIREMENTS: [ '.DEBIAN/requirements-ubuntu-24.10.txt' ] before_script: - apt-get update && apt-get install -y python3-dev python3-pip python3-venv gcc - - python -m venv venv + - python3 -m venv venv - source venv/bin/activate - pip install --upgrade pip - pip install -r $REQUIREMENTS