Skip to content

Commit 0e9fb95

Browse files
authored
Merge pull request #6 from Molmed/DEVELOP-1339-fix-security-advisory
WIP: Develop 1339 - update app to run on Python 3.6
2 parents 2c0fbe1 + b599b4d commit 0e9fb95

File tree

14 files changed

+427
-139
lines changed

14 files changed

+427
-139
lines changed

.python-version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.6.12

.travis.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
language: python
22

33
python:
4-
- "3.5"
4+
- "3.6.12"
55

66
before_install:
77
- sudo python -m pip install pipenv

Pipfile

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,17 @@ python_version = "3.6"
99

1010
[packages]
1111

12-
aiohttp = "==2.3.7"
12+
aiohttp = "==3.7.4"
1313
rq = "==0.10.0"
1414
redis = "==2.10.6"
1515
aiodns = "==1.1.1"
1616
cchardet = "==2.1.1"
17-
pyyaml = "==3.12"
18-
yarl = "==0.18.0"
17+
pyyaml = "==5.4"
18+
yarl = "==1.6.3"
1919

2020

2121
[dev-packages]
2222

2323
mock = "*"
2424
nose = "*"
25+
fakeredis = "*"

Pipfile.lock

Lines changed: 360 additions & 119 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,24 @@ The web service enqueues certain job functions in the RQ/Redis queue, where they
77

88
The downloaded files are deleted on successful verification, and retained if any error occurs.
99

10+
Pre-requisites
11+
--------------
12+
You will need python 3.6 and redis.
13+
14+
Install redis with:
15+
16+
apt-get install redis-server
17+
18+
And start it with:
19+
20+
redis-server
21+
22+
1023
Trying it out
1124
-------------
1225

1326
python3 -m pip install pipenv
1427
pipenv install --deploy
15-
apt-get install redis-server
1628

1729
Try running it:
1830

archive_verify/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
__version__ = "1.0.0"
1+
__version__ = "1.0.5"

archive_verify/handlers.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
import json
21
import logging
32
import os
43

54
from aiohttp import web
6-
from redis import Redis
5+
import archive_verify.redis_client as redis_client
76
from rq import Queue
87

98
from archive_verify.workers import verify_archive
@@ -31,7 +30,7 @@ async def verify(request):
3130
# use a supplied path if available, otherwise construct it from the src_root and archive
3231
archive_path = path or os.path.join(src_root, archive)
3332

34-
redis_conn = Redis()
33+
redis_conn = redis_client.get_redis_instance()
3534
q = Queue(connection=redis_conn)
3635

3736
# Enqueue the verify_archive function with the user supplied input parameters.
@@ -63,7 +62,7 @@ async def status(request):
6362
"""
6463
job_id = str(request.match_info['job_id'])
6564

66-
redis_conn = Redis()
65+
redis_conn = redis_client.get_redis_instance()
6766
q = Queue(connection=redis_conn)
6867
job = q.fetch_job(job_id)
6968

archive_verify/redis_client.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
from redis import Redis
2+
3+
4+
def get_redis_instance():
5+
return Redis()

logs/.gitkeep

Whitespace-only changes.

requirements.txt

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,28 @@
1-
aiohttp==2.3.7
21
aiodns==1.1.1
3-
pyyaml==3.12
4-
rq==0.10.0
2+
aiohttp==3.7.4
3+
async-timeout==3.0.1
4+
attrs==21.2.0
55
cchardet==2.1.1
6-
yarl==0.18.0
6+
cffi==1.14.6
7+
chardet==3.0.4
8+
click==8.0.1
9+
fakeredis==1.6.1
10+
idna==3.2
11+
idna-ssl==1.1.0
12+
importlib-metadata==4.8.1
13+
mock==4.0.3
14+
multidict==5.2.0
15+
nose==1.3.7
16+
packaging==21.0
17+
pbr==5.1.1
18+
pycares==4.0.0
19+
pycparser==2.20
20+
pyparsing==2.4.7
21+
PyYAML==5.4
22+
redis==2.10.6
23+
rq==0.10.0
24+
six==1.16.0
25+
sortedcontainers==2.4.0
26+
typing-extensions==3.10.0.2
27+
yarl==1.6.3
28+
zipp==3.6.0

0 commit comments

Comments
 (0)