Skip to content
This repository was archived by the owner on Oct 23, 2023. It is now read-only.

Commit 462f575

Browse files
authored
Merge pull request #221 from CSCfi/dependabot/pip/aiohttp-3.8.1
Bump aiohttp from 3.7.4.post0 to 3.8.1
2 parents 9469a70 + 42e257d commit 462f575

18 files changed

+552
-812
lines changed

.github/workflows/s2i-build.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ jobs:
1818

1919
- name: Install requirements
2020
run: |
21-
wget https://github.com/openshift/source-to-image/releases/download/v1.2.0/source-to-image-v1.2.0-2a579ecd-linux-amd64.tar.gz
22-
tar -xvf source-to-image-v1.2.0-2a579ecd-linux-amd64.tar.gz
21+
wget https://github.com/openshift/source-to-image/releases/download/v1.3.1/source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz
22+
tar -xvf source-to-image-v1.3.1-a5a77147-linux-amd64.tar.gz
2323
sudo cp s2i /usr/local/bin
2424
- name: Build image
2525
run: |
26-
s2i build . centos/python-36-centos7 cscfi/beacon-python
26+
s2i build . centos/python-38-centos7 cscfi/beacon-python

Dockerfile

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,24 @@
1-
FROM python:3.8-alpine3.13 as BUILD
1+
FROM python:3.8-alpine3.15 as BUILD
22

33
RUN apk add --update \
44
&& apk add --no-cache build-base curl-dev linux-headers bash git musl-dev\
5-
&& apk add --no-cache libressl-dev libffi-dev autoconf bzip2-dev xz-dev\
5+
&& apk add --no-cache openssl-dev libffi-dev autoconf bzip2-dev xz-dev\
66
&& apk add --no-cache python3-dev rust cargo \
77
&& rm -rf /var/cache/apk/*
88

99
COPY requirements.txt /root/beacon/requirements.txt
10-
COPY setup.py /root/beacon/setup.py
11-
COPY beacon_api /root/beacon/beacon_api
1210

1311
ENV CYTHONIZE=1
1412

1513
RUN pip install --upgrade pip && \
16-
pip install -r /root/beacon/requirements.txt && \
17-
pip install /root/beacon
14+
pip install Cython==0.29.26 && \
15+
pip install -r /root/beacon/requirements.txt
16+
17+
COPY setup.py /root/beacon/setup.py
18+
COPY beacon_api /root/beacon/beacon_api
19+
RUN pip install /root/beacon
1820

19-
FROM python:3.8-alpine3.13
21+
FROM python:3.8-alpine3.15
2022

2123
RUN apk add --no-cache --update bash
2224

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@ Documentation: https://beacon-python.readthedocs.io
1010
### Quick start
1111

1212
`beacon-python` Web Server requires:
13-
* Python 3.6+;
14-
* running DB [PostgreSQL Server](https://www.postgresql.org/) 9.6+ (recommended 11.6).
13+
* Python 3.8+;
14+
* running DB [PostgreSQL Server](https://www.postgresql.org/) 9.6+ (recommended 13).
1515

1616
```shell
1717
git clone https://github.com/CSCfi/beacon-python
@@ -30,7 +30,7 @@ docker run -e POSTGRES_USER=beacon \
3030
-e POSTGRES_PASSWORD=beacon \
3131
-v "$PWD/data":/docker-entrypoint-initdb.d \
3232
-e POSTGRES_DB=beacondb \
33-
-p 5432:5432 postgres:11.6
33+
-p 5432:5432 postgres:13
3434
```
3535

3636
#### Run beacon-python

beacon_api/api/exceptions.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,17 @@ def process_exception_data(request: Dict, host: str, error_code: int, error: str
3535
# include datasetIds only if they are specified
3636
# as per specification if they don't exist all datatsets will be queried
3737
# Only one of `alternateBases` or `variantType` is required, validated by schema
38-
oneof_fields = ["alternateBases", "variantType", "start", "end", "startMin", "startMax", "endMin", "endMax", "datasetIds"]
38+
oneof_fields = [
39+
"alternateBases",
40+
"variantType",
41+
"start",
42+
"end",
43+
"startMin",
44+
"startMax",
45+
"endMin",
46+
"endMax",
47+
"datasetIds",
48+
]
3949
data["alleleRequest"].update({k: request.get(k) for k in oneof_fields if k in request})
4050

4151
return data
@@ -65,11 +75,7 @@ class BeaconUnauthorised(web.HTTPUnauthorized):
6575
def __init__(self, request: Dict, host: str, error: str, error_message: str) -> None:
6676
"""Return custom unauthorized exception."""
6777
data = process_exception_data(request, host, 401, error)
68-
headers_401 = {
69-
"WWW-Authenticate": f'Bearer realm="{CONFIG_INFO.url}"\n\
70-
error="{error}"\n\
71-
error_description="{error_message}"'
72-
}
78+
headers_401 = {"WWW-Authenticate": f"""Bearer realm=\"{CONFIG_INFO.url}\",error=\"{error},\" error_description=\"{error_message}\""""}
7379
super().__init__(
7480
content_type="application/json",
7581
text=ujson.dumps(data, escape_forward_slashes=False),

beacon_api/app.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,17 @@ def main():
125125
# sslcontext.load_cert_chain(ssl_certfile, ssl_keyfile)
126126
# sslcontext = ssl.create_default_context(ssl.Purpose.CLIENT_AUTH)
127127
# sslcontext.check_hostname = False
128-
web.run_app(init(), host=os.environ.get("HOST", "0.0.0.0"), port=os.environ.get("PORT", "5050"), shutdown_timeout=0, ssl_context=None) # nosec # nosec
128+
web.run_app(
129+
init(),
130+
host=os.environ.get("HOST", "0.0.0.0"), # nosec
131+
port=os.environ.get("PORT", "5050"),
132+
shutdown_timeout=0,
133+
ssl_context=None,
134+
)
129135

130136

131137
if __name__ == "__main__":
132-
if sys.version_info < (3, 6):
133-
LOG.error("beacon-python requires python 3.6")
138+
if sys.version_info < (3, 8):
139+
LOG.error("beacon-python requires python 3.8")
134140
sys.exit(1)
135141
main()

deploy/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: '3.2'
33
services:
44
postgres:
55
hostname: postgres
6-
image: postgres:11.6
6+
image: postgres:13
77
environment:
88
POSTGRES_USER: beacon
99
POSTGRES_DB: beacondb
@@ -20,7 +20,7 @@ services:
2020
environment:
2121
DATABASE_URL: postgres
2222
links:
23-
- postgres:postgres
23+
- postgres:postgres
2424
ports:
2525
- 5050:5050
2626
restart: on-failure

deploy/test/docker-compose.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ version: '3.2'
33
services:
44
postgres:
55
hostname: postgres
6-
image: postgres:11.6
6+
image: postgres:13
77
environment:
88
POSTGRES_USER: beacon
99
POSTGRES_DB: beacondb
@@ -42,4 +42,4 @@ services:
4242
- 8000:8000
4343
volumes:
4444
- ./mock_auth.py:/mock_auth.py
45-
entrypoint: ["python", "/mock_auth.py", "0.0.0.0", "8000"]
45+
entrypoint: [ "python", "/mock_auth.py", "0.0.0.0", "8000" ]

docs/db.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Database
44
========
55

6-
We use a PostgreSQL database (recommended version 11.6) for working with beacon data.
6+
We use a PostgreSQL database (recommended version 13) for working with beacon data.
77
For more information on setting up the database consult :ref:`database-setup`.
88

99
.. attention:: We recommend https://pgtune.leopard.in.ua/ for establishing PostgreSQL

docs/instructions.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ Instructions
33

44
.. note:: In order to run ``beacon-python`` Web Server requirements are as specified below:
55

6-
* Python 3.6+;
7-
* running DB `PostgreSQL Server <https://www.postgresql.org/>`_ 9.6+ (recommended 11.6).
6+
* Python 3.8+;
7+
* running DB `PostgreSQL Server <https://www.postgresql.org/>`_ 9.6+ (recommended 13).
88

99
.. _env-setup:
1010

@@ -165,7 +165,7 @@ Starting PostgreSQL using Docker:
165165
-e POSTGRES_PASSWORD=beacon \
166166
-e POSTGRES_DB=beacondb \
167167
-v "$PWD/data":/docker-entrypoint-initdb.d \
168-
-p 5432:5432 postgres:11.6
168+
-p 5432:5432 postgres:13
169169
170170
.. hint:: If one has their own database the ``beacon_init`` utility can be skipped,
171171
and make use of their own database by:

requirements.txt

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
aiohttp==3.7.4.post0
1+
aiohttp==3.8.1
22
aiohttp-cors==0.7.0
33
asyncpg==0.25.0
4-
jsonschema==3.2.0; python_version < '3.7'
5-
jsonschema==4.3.2; python_version >= '3.7'
4+
jsonschema==4.3.2
65
Cython==0.29.26
7-
cyvcf2==0.10.1; python_version < '3.7'
8-
cyvcf2; python_version >= '3.7'
9-
uvloop==0.14.0; python_version < '3.7'
10-
uvloop==0.16.0; python_version >= '3.7'
6+
cyvcf2==0.30.14
7+
uvloop==0.16.0
118
aiocache==0.11.1
12-
ujson==4.3.0; python_version < '3.7'
13-
ujson==5.1.0; python_version >= '3.7'
14-
aiomcache==0.6.0
9+
ujson==5.1.0
1510
Authlib==0.15.5
1611
gunicorn==20.1.0

setup.py

Lines changed: 7 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,25 @@
3333
"Topic :: Internet :: WWW/HTTP :: HTTP Servers",
3434
"Topic :: Scientific/Engineering :: Bio-Informatics",
3535
"License :: OSI Approved :: Apache Software License",
36-
"Programming Language :: Python :: 3.6",
3736
"Programming Language :: Python :: 3.7",
37+
"Programming Language :: Python :: 3.8",
3838
],
3939
install_requires=[
4040
"asyncpg==0.25.0",
41-
"aiohttp==3.7.4.post0",
41+
"aiohttp==3.8.1",
4242
"Authlib==0.15.5",
4343
"aiohttp-cors==0.7.0",
44-
"jsonschema==3.2.0; python_version < '3.7'",
45-
"jsonschema==4.3.2; python_version >= '3.7'",
44+
"jsonschema==4.3.2",
4645
"gunicorn==20.1.0",
47-
"uvloop==0.14.0; python_version < '3.7'",
48-
"uvloop==0.16.0; python_version >= '3.7'",
49-
"cyvcf2==0.10.1; python_version < '3.7'",
50-
"cyvcf2; python_version >= '3.7'",
46+
"uvloop==0.16.0",
47+
"cyvcf2==0.30.14",
5148
"aiocache==0.11.1",
52-
"aiomcache==0.6.0",
53-
"ujson==4.3.0; python_version < '3.7'",
54-
"ujson==5.1.0; python_version >= '3.7'",
49+
"ujson==5.1.0",
5550
],
5651
extras_require={
5752
"vcf": [
58-
"cyvcf2==0.10.1; python_version < '3.7'",
5953
"numpy==1.21.5",
60-
"cyvcf2; python_version >= '3.7'",
54+
"cyvcf2==0.30.14",
6155
"Cython==0.29.26",
6256
],
6357
"test": [
@@ -68,7 +62,6 @@
6862
"tox==3.24.4",
6963
"flake8==4.0.1",
7064
"flake8-docstrings==1.6.0",
71-
"asynctest==0.13.0",
7265
"aioresponses==0.7.2",
7366
"black==21.12b0",
7467
],

0 commit comments

Comments
 (0)