Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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: |
Expand Down
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -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
5 changes: 3 additions & 2 deletions docker/backend/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:10
FROM debian:bookworm

# install dependencies
RUN apt-get update -qq && \
Expand All @@ -10,7 +10,8 @@ RUN mkdir code
WORKDIR /code
COPY requirements.txt ./

RUN pip3 install -Ur requirements.txt
# --break-system-packages to allow pip to install inside of the docker container
RUN pip3 install -Ur requirements.txt --break-system-packages
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you add a comment we do this deliberately?


# run app
EXPOSE 5000
Expand Down
9 changes: 5 additions & 4 deletions docker/tester/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM debian:buster-20210408-slim
FROM debian:bookworm

# install dependencies
RUN apt-get update -qq && \
Expand All @@ -16,11 +16,12 @@ RUN apt-get update -qq && \
# build app
RUN mkdir code
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

# --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

# run app
ENTRYPOINT ["pytest"]
6 changes: 1 addition & 5 deletions high_templar/authentication.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 0 additions & 1 deletion high_templar/backend_adapter/binder.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
12 changes: 7 additions & 5 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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==1.2
frozendict==2.4.6
aiohttp==3.11.10
Jinja2==3.0.3
werkzeug==2.1.2
4 changes: 2 additions & 2 deletions run
Original file line number Diff line number Diff line change
Expand Up @@ -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
21 changes: 10 additions & 11 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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==1.2',
'frozendict == 2.4.6',
'aiohttp == 3.11.10',
'Jinja2 == 3.0.3',
'werkzeug == 2.1.2',
],
test_suite='tests'
)
2 changes: 1 addition & 1 deletion test
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
set -e

docker-compose run tester "$@"
docker compose run tester "$@"
10 changes: 5 additions & 5 deletions tests/requirements.txt
Original file line number Diff line number Diff line change
@@ -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
frozendict==1.2.0
pika==1.2.0
pytest==7.4.4
frozendict==2.4.6
pika==1.3.2