From e5f612656c7363bb6851b4048d39d49a731e7be9 Mon Sep 17 00:00:00 2001 From: Bob Booij-Liewes Date: Mon, 9 Dec 2024 13:39:05 +0100 Subject: [PATCH 1/5] Start update debian 12 support --- high_templar/backend_adapter/binder.py | 1 - requirements.txt | 2 +- setup.py | 2 +- tests/requirements.txt | 2 +- 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/high_templar/backend_adapter/binder.py b/high_templar/backend_adapter/binder.py index c03e9ac..f0b0b42 100644 --- a/high_templar/backend_adapter/binder.py +++ b/high_templar/backend_adapter/binder.py @@ -25,7 +25,6 @@ def __init__(self, app): self.base_url = app.config['API_URL'] self.forward_ip = app.config.get('FORWARD_IP') self.header_definition = {**DEFAULT_HEADERS, **app.config.get('CONNECTION_HEADERS', {})} - self.headers = {} async def get_authentication(self, websocket) -> Authentication: diff --git a/requirements.txt b/requirements.txt index 37c137c..d168c2f 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,4 +3,4 @@ aio-pika==6.4.1 hypercorn== 0.9.0 quart== 0.11.2 aiohttp_requests==0.1.2 -frozendict==1.2 +frozendict==2.4.6 diff --git a/setup.py b/setup.py index 14fb780..7fb537d 100755 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ 'quart == 0.11.2', 'aiohttp >= 3.6.2', 'aiohttp_requests>=0.1.2', - 'frozendict==1.2', + 'frozendict==2.4.6', ], test_suite='tests' ) diff --git a/tests/requirements.txt b/tests/requirements.txt index 7ad10ae..4928502 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -2,5 +2,5 @@ websockets==9.1 requests2==2.16.0 wiremock==1.2.0 pytest==6.1.1 -frozendict==1.2.0 +frozendict==2.4.6 pika==1.2.0 From 2e00df2299fd0bb5062c88dd1f163685c6028a15 Mon Sep 17 00:00:00 2001 From: Bob Booij-Liewes Date: Wed, 18 Dec 2024 20:28:34 +0100 Subject: [PATCH 2/5] Update comparing key sets after frozen dict update The new frozen dict actually does not let you just set attributes after creating the dict, just like it is actually frozen :P. --- high_templar/authentication.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/high_templar/authentication.py b/high_templar/authentication.py index de7bf98..4c2b42e 100644 --- a/high_templar/authentication.py +++ b/high_templar/authentication.py @@ -14,13 +14,9 @@ class Permission(frozendict): Make a comparable object from permission """ - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self.key_set = set(self.keys()) - def __lt__(self, other: 'Permission'): # If the keys are not the same, we can not compare then - if self.key_set != other.key_set: + if set(self.keys()) != set(other.keys()): return False has_diff = False From 8e4797628bc7ddccd1c922ea0cc2be4e451f7c4f Mon Sep 17 00:00:00 2001 From: Bob Booij-Liewes Date: Wed, 18 Dec 2024 20:29:57 +0100 Subject: [PATCH 3/5] Update infra for deb 12 --- docker/backend/Dockerfile | 4 ++-- docker/tester/Dockerfile | 6 +++--- requirements.txt | 10 ++++++---- test | 2 +- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/docker/backend/Dockerfile b/docker/backend/Dockerfile index f2f338a..c219b3a 100644 --- a/docker/backend/Dockerfile +++ b/docker/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:10 +FROM debian:12 # install dependencies RUN apt-get update -qq && \ @@ -10,7 +10,7 @@ RUN mkdir code WORKDIR /code COPY requirements.txt ./ -RUN pip3 install -Ur requirements.txt +RUN pip3 install -Ur requirements.txt --break-system-packages # run app EXPOSE 5000 diff --git a/docker/tester/Dockerfile b/docker/tester/Dockerfile index 319e5fe..2d7fb61 100644 --- a/docker/tester/Dockerfile +++ b/docker/tester/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:buster-20210408-slim +FROM debian:12 # install dependencies RUN apt-get update -qq && \ @@ -19,8 +19,8 @@ WORKDIR /code COPY requirements.txt /requirements.txt COPY tests/requirements.txt /requirements.tests.txt -RUN pip3 -q install -Ur /requirements.txt -RUN pip3 -q install -Ur /requirements.tests.txt +RUN pip3 -q install -Ur /requirements.txt --break-system-packages +RUN pip3 -q install -Ur /requirements.tests.txt --break-system-packages # run app ENTRYPOINT ["pytest"] diff --git a/requirements.txt b/requirements.txt index d168c2f..160f5eb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,6 +1,8 @@ -python-dotenv>= 0.6.3 -aio-pika==6.4.1 -hypercorn== 0.9.0 +python-dotenv==0.21.1 +aio-pika==9.3.1 +hypercorn==0.14.3 quart== 0.11.2 -aiohttp_requests==0.1.2 frozendict==2.4.6 +aiohttp==3.11.10 +Jinja2==3.0.3 +werkzeug==2.1.2 diff --git a/test b/test index a1151af..740e45e 100755 --- a/test +++ b/test @@ -1,4 +1,4 @@ #!/bin/sh set -e -docker-compose run tester "$@" +docker compose run tester "$@" From 73fe6e9d243218446c733a20a87a7322ea5ba345 Mon Sep 17 00:00:00 2001 From: Bob Booij-Liewes Date: Wed, 18 Dec 2024 20:30:16 +0100 Subject: [PATCH 4/5] Update docker compose XXX TODO split commits better, docker-compose -> docker compose is not split over 2 commits --- run | 4 ++-- tests/requirements.txt | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/run b/run index 3f44ddb..9e8e14d 100755 --- a/run +++ b/run @@ -6,7 +6,7 @@ if [ "$1" = "--no-build" ] then echo "Skipping build" else - docker-compose build --parallel $SERVICES + docker compose build --parallel $SERVICES fi -docker-compose up "$@" $SERVICES +docker compose up "$@" $SERVICES diff --git a/tests/requirements.txt b/tests/requirements.txt index 4928502..71757bc 100644 --- a/tests/requirements.txt +++ b/tests/requirements.txt @@ -1,6 +1,6 @@ -websockets==9.1 -requests2==2.16.0 +websockets==13.1 +requests==2.32.2 wiremock==1.2.0 -pytest==6.1.1 +pytest==7.4.4 frozendict==2.4.6 -pika==1.2.0 +pika==1.3.2 From 62628de4f6b31cd25e2ce545c67c359460c14452 Mon Sep 17 00:00:00 2001 From: Pieter van Beerendonk Date: Thu, 1 May 2025 17:36:41 +0200 Subject: [PATCH 5/5] Test suite for debian 9, 10, 11 Added support for latest debian version. --- .github/workflows/ci.yml | 12 ++++++------ .travis.yml | 7 ++++--- docker/backend/Dockerfile | 3 ++- docker/tester/Dockerfile | 5 +++-- setup.py | 21 ++++++++++----------- 5 files changed, 25 insertions(+), 23 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 951a9af..a3d214d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,26 +8,26 @@ jobs: steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Run tests with pytest - run: docker-compose run --rm tester + run: docker compose run --rm tester - name: Stop containers if: always() - run: docker-compose stop + run: docker compose stop lint: runs-on: ubuntu-latest steps: - name: Checkout code - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: Setup python - uses: actions/setup-python@v2 + uses: actions/setup-python@v5 with: - python-version: 3.7 + python-version: 3.11 - name: Install requirements run: | diff --git a/.travis.yml b/.travis.yml index 4625095..fa143ce 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,13 +1,14 @@ sudo: false language: python python: - - "3.5" - - "3.6" + # support debian 9, 10, 11 - "3.7" + - "3.9" + - "3.11" cache: pip: true install: - - docker-compose up + - docker compose up - pip install -Ur tests/requirements.txt script: - cd tests && pytest diff --git a/docker/backend/Dockerfile b/docker/backend/Dockerfile index c219b3a..c85e266 100644 --- a/docker/backend/Dockerfile +++ b/docker/backend/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:12 +FROM debian:bookworm # install dependencies RUN apt-get update -qq && \ @@ -10,6 +10,7 @@ RUN mkdir code WORKDIR /code COPY requirements.txt ./ +# --break-system-packages to allow pip to install inside of the docker container RUN pip3 install -Ur requirements.txt --break-system-packages # run app diff --git a/docker/tester/Dockerfile b/docker/tester/Dockerfile index 2d7fb61..907c624 100644 --- a/docker/tester/Dockerfile +++ b/docker/tester/Dockerfile @@ -1,4 +1,4 @@ -FROM debian:12 +FROM debian:bookworm # install dependencies RUN apt-get update -qq && \ @@ -16,9 +16,10 @@ RUN apt-get update -qq && \ # build app RUN mkdir code WORKDIR /code - COPY requirements.txt /requirements.txt COPY tests/requirements.txt /requirements.tests.txt + +# --break-system-packages to allow pip to install inside of the docker container RUN pip3 -q install -Ur /requirements.txt --break-system-packages RUN pip3 -q install -Ur /requirements.tests.txt --break-system-packages diff --git a/setup.py b/setup.py index 7fb537d..3ccda2a 100755 --- a/setup.py +++ b/setup.py @@ -27,22 +27,21 @@ 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', - 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.3', - 'Programming Language :: Python :: 3.4', - 'Programming Language :: Python :: 3.5', - 'Programming Language :: Python :: 3.6', + 'Programming Language :: Python :: 3.7', + 'Programming Language :: Python :: 3.9', + 'Programming Language :: Python :: 3.11', 'Topic :: Internet :: WWW/HTTP :: Dynamic Content', 'Topic :: Software Development :: Libraries :: Python Modules' ], install_requires=[ - 'python-dotenv >= 0.6.3', - 'aio-pika==6.4.1', - 'hypercorn >= 0.9.0', + 'python-dotenv == 0.21.1', + 'aio-pika == 9.3.1', + 'hypercorn == 0.14.3', 'quart == 0.11.2', - 'aiohttp >= 3.6.2', - 'aiohttp_requests>=0.1.2', - 'frozendict==2.4.6', + 'frozendict == 2.4.6', + 'aiohttp == 3.11.10', + 'Jinja2 == 3.0.3', + 'werkzeug == 2.1.2', ], test_suite='tests' )