Skip to content

Commit 1c7e4ae

Browse files
authored
Update dependencies (FastAPI, uvicorn, etc.) (#337)
* update `generate_reqs` invoke task for latest pipenv * fastapi 0.61 -> 0.63 * uvicorn 0.11.8 -> 0.13.4 * sentry, scout updates, etc. * update requirements test * update Sources enum * linting fix (invalid-name) * use Sources enum instead of string * skip test_requirements if not python3.8
1 parent 348628d commit 1c7e4ae

File tree

7 files changed

+767
-515
lines changed

7 files changed

+767
-515
lines changed

Pipfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ python-dateutil = "*"
3434
requests = "*"
3535
scout-apm = "*"
3636
sentry-sdk = "*"
37-
uvicorn = "*"
37+
uvicorn = {extras = ["standard"],version = "*"}
3838

3939
[requires]
4040
python_version = "3.8"

Pipfile.lock

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

app/routers/v2.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,13 +14,15 @@ class Sources(str, enum.Enum):
1414
A source available for retrieving data.
1515
"""
1616

17-
jhu = "jhu"
18-
csbs = "csbs"
19-
nyt = "nyt"
17+
JHU = "jhu"
18+
CSBS = "csbs"
19+
NYT = "nyt"
2020

2121

2222
@V2.get("/latest", response_model=LatestResponse)
23-
async def get_latest(request: Request, source: Sources = "jhu"): # pylint: disable=unused-argument
23+
async def get_latest(
24+
request: Request, source: Sources = Sources.JHU
25+
): # pylint: disable=unused-argument
2426
"""
2527
Getting latest amount of total confirmed cases, deaths, and recoveries.
2628
"""
@@ -91,7 +93,7 @@ async def get_locations(
9193
# pylint: disable=invalid-name
9294
@V2.get("/locations/{id}", response_model=LocationResponse)
9395
async def get_location_by_id(
94-
request: Request, id: int, source: Sources = "jhu", timelines: bool = True
96+
request: Request, id: int, source: Sources = Sources.JHU, timelines: bool = True
9597
):
9698
"""
9799
Getting specific location by id.

requirements-dev.txt

Lines changed: 43 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,54 @@
1+
#
2+
# These requirements were autogenerated by pipenv
3+
# To regenerate from the project's Pipfile, run:
4+
#
5+
# pipenv lock --requirements --dev-only
6+
#
7+
18
-i https://pypi.org/simple
29
appdirs==1.4.4
3-
astroid==2.4.2
4-
async-asgi-testclient==1.4.4
10+
astroid==2.5.0; python_version >= '3.6'
11+
async-asgi-testclient==1.4.5
512
async-generator==1.10
613
asyncmock==0.4.2
7-
attrs==20.2.0
8-
bandit==1.6.2
14+
attrs==20.3.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
15+
bandit==1.7.0
916
black==19.10b0
10-
certifi==2020.6.20
17+
certifi==2020.12.5
1118
chardet==3.0.4
12-
click==7.1.2
13-
coverage==5.3
14-
coveralls==2.1.2
19+
click==7.1.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
20+
coverage==5.4; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4' and python_version < '4.0'
21+
coveralls==3.0.0
1522
docopt==0.6.2
16-
gitdb==4.0.5
17-
gitpython==3.1.8
23+
gitdb==4.0.5; python_version >= '3.4'
24+
gitpython==3.1.13; python_version >= '3.4'
1825
idna==2.10
19-
importlib-metadata==1.7.0 ; python_version < '3.8'
20-
iniconfig==1.0.1
21-
invoke==1.4.1
22-
isort==5.5.2
23-
lazy-object-proxy==1.4.3
26+
importlib-metadata==3.7.0; python_version < '3.8'
27+
iniconfig==1.1.1
28+
invoke==1.5.0
29+
isort==5.7.0
30+
lazy-object-proxy==1.5.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
2431
mccabe==0.6.1
25-
mock==4.0.2
26-
more-itertools==8.5.0
27-
multidict==4.7.6
28-
packaging==20.4
29-
pathspec==0.8.0
30-
pbr==5.5.0
31-
pluggy==0.13.1
32-
py==1.9.0
33-
pylint==2.6.0
34-
pyparsing==2.4.7
32+
mock==4.0.3; python_version >= '3.6'
33+
multidict==5.1.0; python_version >= '3.6'
34+
packaging==20.9; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
35+
pathspec==0.8.1
36+
pbr==5.5.1; python_version >= '2.6'
37+
pluggy==0.13.1; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
38+
py==1.10.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
39+
pylint==2.7.1
40+
pyparsing==2.4.7; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
3541
pytest-asyncio==0.14.0
36-
pytest-cov==2.10.1
37-
pytest==6.0.2
38-
pyyaml==5.3.1
39-
regex==2020.7.14
40-
requests==2.24.0
41-
responses==0.12.0
42-
six==1.15.0
43-
smmap==3.0.4
44-
stevedore==3.2.2
45-
toml==0.10.1
46-
typed-ast==1.4.1
47-
urllib3[secure]==1.25.10 ; python_version >= '3.5'
42+
pytest-cov==2.11.1
43+
pytest==6.2.2
44+
pyyaml==5.4.1
45+
regex==2020.11.13
46+
requests==2.25.1
47+
responses==0.12.1
48+
six==1.15.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
49+
smmap==3.0.5; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
50+
stevedore==3.3.0; python_version >= '3.6'
51+
toml==0.10.2; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
52+
typed-ast==1.4.2
53+
urllib3[secure]==1.26.3; python_version >= '3.5'
4854
wrapt==1.12.1
49-
zipp==3.1.0

requirements.txt

Lines changed: 41 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,41 +1,51 @@
1+
#
2+
# These requirements were autogenerated by pipenv
3+
# To regenerate from the project's Pipfile, run:
4+
#
5+
# pipenv lock --requirements
6+
#
7+
18
-i https://pypi.org/simple
29
aiocache[redis]==0.11.1
3-
aiofiles==0.5.0
4-
aiohttp==3.6.2
10+
aiofiles==0.6.0
11+
aiohttp==3.7.4
512
aioredis==1.3.1
6-
asgiref==3.2.10 ; python_version >= '3.5'
7-
async-timeout==3.0.1
13+
asgiref==3.3.1; python_version >= '3.5'
14+
async-timeout==3.0.1; python_full_version >= '3.5.3'
815
asyncache==0.1.1
9-
attrs==20.2.0
10-
cachetools==4.1.1
11-
certifi==2020.6.20
12-
cffi==1.14.2
16+
attrs==20.3.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
17+
cachetools==4.2.1
18+
certifi==2020.12.5
19+
cffi==1.14.5
1320
chardet==3.0.4
14-
click==7.1.2
15-
cryptography==3.1
16-
dataclasses==0.6 ; python_version < '3.7'
17-
fastapi==0.61.1
21+
click==7.1.2; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3, 3.4'
22+
cryptography==3.4.6
23+
dataclasses==0.6; python_version < '3.7'
24+
fastapi==0.63.0
1825
gunicorn==20.0.4
19-
h11==0.9.0
20-
hiredis==1.1.0
21-
httptools==0.1.1 ; sys_platform != 'win32' and sys_platform != 'cygwin' and platform_python_implementation != 'PyPy'
22-
idna-ssl==1.1.0 ; python_version < '3.7'
26+
h11==0.12.0; python_version >= '3.6'
27+
hiredis==1.1.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
28+
httptools==0.1.1
29+
idna-ssl==1.1.0; python_version < '3.7'
2330
idna==2.10
24-
multidict==4.7.6
25-
psutil==5.7.2
26-
pycparser==2.20
27-
pydantic[dotenv]==1.6.1
28-
pyopenssl==19.1.0
31+
multidict==5.1.0; python_version >= '3.6'
32+
psutil==5.8.0; python_version >= '2.6' and python_version not in '3.0, 3.1, 3.2, 3.3'
33+
pycparser==2.20; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
34+
pydantic[dotenv]==1.8
35+
pyopenssl==20.0.1
2936
python-dateutil==2.8.1
30-
python-dotenv==0.14.0
31-
requests==2.24.0
32-
scout-apm==2.16.1
33-
sentry-sdk==0.17.4
34-
six==1.15.0
35-
starlette==0.13.6
36-
urllib3[secure]==1.25.10 ; python_version >= '3.5'
37-
uvicorn==0.11.8
38-
uvloop==0.14.0 ; sys_platform != 'win32' and sys_platform != 'cygwin' and platform_python_implementation != 'PyPy'
37+
python-dotenv==0.15.0
38+
pyyaml==5.4.1
39+
requests==2.25.1
40+
scout-apm==2.18.0
41+
sentry-sdk==0.20.3
42+
six==1.15.0; python_version >= '2.7' and python_version not in '3.0, 3.1, 3.2, 3.3'
43+
starlette==0.13.6; python_version >= '3.6'
44+
typing-extensions==3.7.4.3
45+
urllib3[secure]==1.26.3; python_version >= '3.5'
46+
uvicorn[standard]==0.13.4
47+
uvloop==0.15.2
48+
watchgod==0.7
3949
websockets==8.1
4050
wrapt==1.12.1
41-
yarl==1.5.1
51+
yarl==1.6.3; python_version >= '3.6'

tasks.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,9 +72,11 @@ def test(ctx):
7272
@invoke.task
7373
def generate_reqs(ctx):
7474
"""Generate requirements.txt"""
75+
# NOTE: updated for pipenv 2020 release
76+
# TODO: make backwards compatible
7577
reqs = [
7678
"pipenv lock -r > requirements.txt",
77-
"pipenv lock -r --dev > requirements-dev.txt",
79+
"pipenv lock -r --dev-only > requirements-dev.txt",
7880
]
7981
[ctx.run(req) for req in reqs]
8082

tests/test_cli.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11
import subprocess
2+
import sys
3+
4+
import pytest
5+
6+
PYTHON_VERSION = float(f"{sys.version_info.major}.{sys.version_info.minor}")
27

38

49
def test_invoke_list():
@@ -8,6 +13,7 @@ def test_invoke_list():
813
assert return_code == 0
914

1015

16+
@pytest.mark.skipif(reason="Minor marker differences", condition=PYTHON_VERSION != 3.8)
1117
def test_requirements_txt():
1218
"""Validate that requirements.txt and requirements-dev.txt
1319
are up2date with Pipefile"""
@@ -25,7 +31,7 @@ def test_requirements_txt():
2531
)
2632

2733
return_code_2 = subprocess.call(
28-
"pipenv lock -r --dev \
34+
"pipenv lock -r --dev-only \
2935
> {}".format(
3036
req_dev_test_file_path
3137
),

0 commit comments

Comments
 (0)