Skip to content

Commit 8201cd6

Browse files
committed
Update dependencies (and necessary code changes) to the latest versions and move to pip-tools style dependency management.
1 parent 4b3ec11 commit 8201cd6

File tree

21 files changed

+362
-69
lines changed

21 files changed

+362
-69
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
fastapi
2+
uvicorn
+33-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,33 @@
1-
fastapi==0.70.0
2-
uvicorn==0.15.0
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
4+
#
5+
# pip-compile requirements.in
6+
#
7+
annotated-types==0.5.0
8+
# via pydantic
9+
anyio==3.7.1
10+
# via starlette
11+
click==8.1.5
12+
# via uvicorn
13+
fastapi==0.100.0
14+
# via -r requirements.in
15+
h11==0.14.0
16+
# via uvicorn
17+
idna==3.4
18+
# via anyio
19+
pydantic==2.0.2
20+
# via fastapi
21+
pydantic-core==2.1.2
22+
# via pydantic
23+
sniffio==1.3.0
24+
# via anyio
25+
starlette==0.27.0
26+
# via fastapi
27+
typing-extensions==4.7.1
28+
# via
29+
# fastapi
30+
# pydantic
31+
# pydantic-core
32+
uvicorn==0.22.0
33+
# via -r requirements.in

code/ch4-templates/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
def main():
1414
configure(dev_mode=True)
1515
# noinspection PyTypeChecker
16-
uvicorn.run(app, host='127.0.0.1', port=8000, debug=True)
16+
uvicorn.run(app, host='127.0.0.1', port=8000)
1717

1818

1919
def configure(dev_mode: bool):

code/ch4-templates/requirements.in

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
fastapi
2+
uvicorn
3+
aiofiles
4+
5+
# This is now available on PyPI.org so we'll be using that one going forward.
6+
fastapi-chameleon
7+
8+
starlette

code/ch4-templates/requirements.txt

+43-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,43 @@
1-
fastapi==0.70.0
2-
uvicorn==0.15.0
3-
aiofiles
4-
5-
# This is now available on PyPI.org so we'll be using that one going forward.
6-
fastapi-chameleon==0.1.12
7-
8-
starlette==0.16.0
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
4+
#
5+
# pip-compile requirements.in
6+
#
7+
aiofiles==23.1.0
8+
# via -r requirements.in
9+
annotated-types==0.5.0
10+
# via pydantic
11+
anyio==3.7.1
12+
# via starlette
13+
chameleon==4.0.1
14+
# via fastapi-chameleon
15+
click==8.1.5
16+
# via uvicorn
17+
fastapi==0.100.0
18+
# via
19+
# -r requirements.in
20+
# fastapi-chameleon
21+
fastapi-chameleon==0.1.14
22+
# via -r requirements.in
23+
h11==0.14.0
24+
# via uvicorn
25+
idna==3.4
26+
# via anyio
27+
pydantic==2.0.2
28+
# via fastapi
29+
pydantic-core==2.1.2
30+
# via pydantic
31+
sniffio==1.3.0
32+
# via anyio
33+
starlette==0.27.0
34+
# via
35+
# -r requirements.in
36+
# fastapi
37+
typing-extensions==4.7.1
38+
# via
39+
# fastapi
40+
# pydantic
41+
# pydantic-core
42+
uvicorn==0.22.0
43+
# via -r requirements.in

code/ch5-viewmodels/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
def main():
1414
configure(dev_mode=True)
1515
# noinspection PyTypeChecker
16-
uvicorn.run(app, host='127.0.0.1', port=8000, debug=True)
16+
uvicorn.run(app, host='127.0.0.1', port=8000)
1717

1818

1919
def configure(dev_mode: bool):

code/ch5-viewmodels/requirements.in

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
fastapi
2+
uvicorn
3+
aiofiles
4+
5+
# This is now available on PyPI.org, so we'll be using that one going forward.
6+
fastapi-chameleon
7+
8+
starlette

code/ch5-viewmodels/requirements.txt

+43-8
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,43 @@
1-
fastapi==0.70.0
2-
uvicorn==0.15.0
3-
aiofiles
4-
5-
# This is now available on PyPI.org, so we'll be using that one going forward.
6-
fastapi-chameleon==0.1.12
7-
8-
starlette==0.16.0
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
4+
#
5+
# pip-compile requirements.in
6+
#
7+
aiofiles==23.1.0
8+
# via -r requirements.in
9+
annotated-types==0.5.0
10+
# via pydantic
11+
anyio==3.7.1
12+
# via starlette
13+
chameleon==4.0.1
14+
# via fastapi-chameleon
15+
click==8.1.5
16+
# via uvicorn
17+
fastapi==0.100.0
18+
# via
19+
# -r requirements.in
20+
# fastapi-chameleon
21+
fastapi-chameleon==0.1.14
22+
# via -r requirements.in
23+
h11==0.14.0
24+
# via uvicorn
25+
idna==3.4
26+
# via anyio
27+
pydantic==2.0.2
28+
# via fastapi
29+
pydantic-core==2.1.2
30+
# via pydantic
31+
sniffio==1.3.0
32+
# via anyio
33+
starlette==0.27.0
34+
# via
35+
# -r requirements.in
36+
# fastapi
37+
typing-extensions==4.7.1
38+
# via
39+
# fastapi
40+
# pydantic
41+
# pydantic-core
42+
uvicorn==0.22.0
43+
# via -r requirements.in

code/ch50-conclusion/placeholder.txt

Whitespace-only changes.

code/ch6-users-and-forms/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
def main():
1414
configure(dev_mode=True)
1515
# noinspection PyTypeChecker
16-
uvicorn.run(app, host='127.0.0.1', port=8000, debug=True)
16+
uvicorn.run(app, host='127.0.0.1', port=8000)
1717

1818

1919
def configure(dev_mode: bool):
+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
fastapi
2+
uvicorn
3+
aiofiles
4+
python-multipart
5+
6+
# This is now available on PyPI.org, so we'll be using that one going forward.
7+
fastapi-chameleon
8+
9+
starlette
+45-9
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,45 @@
1-
fastapi==0.70.0
2-
uvicorn==0.15.0
3-
aiofiles
4-
python-multipart
5-
6-
# This is now available on PyPI.org, so we'll be using that one going forward.
7-
fastapi-chameleon==0.1.12
8-
9-
starlette==0.16.0
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
4+
#
5+
# pip-compile requirements.in
6+
#
7+
aiofiles==23.1.0
8+
# via -r requirements.in
9+
annotated-types==0.5.0
10+
# via pydantic
11+
anyio==3.7.1
12+
# via starlette
13+
chameleon==4.0.1
14+
# via fastapi-chameleon
15+
click==8.1.5
16+
# via uvicorn
17+
fastapi==0.100.0
18+
# via
19+
# -r requirements.in
20+
# fastapi-chameleon
21+
fastapi-chameleon==0.1.14
22+
# via -r requirements.in
23+
h11==0.14.0
24+
# via uvicorn
25+
idna==3.4
26+
# via anyio
27+
pydantic==2.0.2
28+
# via fastapi
29+
pydantic-core==2.1.2
30+
# via pydantic
31+
python-multipart==0.0.6
32+
# via -r requirements.in
33+
sniffio==1.3.0
34+
# via anyio
35+
starlette==0.27.0
36+
# via
37+
# -r requirements.in
38+
# fastapi
39+
typing-extensions==4.7.1
40+
# via
41+
# fastapi
42+
# pydantic
43+
# pydantic-core
44+
uvicorn==0.22.0
45+
# via -r requirements.in

code/ch7-databases/data/package.py

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
class Package(SqlAlchemyBase):
1111
__tablename__ = 'packages'
12+
# For SQLAlchemy 2.0 compatibility
13+
# (see https://docs.sqlalchemy.org/en/20/errors.html#error-zlpr)
14+
__allow_unmapped__ = True
1215

1316
id: str = sa.Column(sa.String, primary_key=True)
1417
created_date: datetime.datetime = sa.Column(sa.DateTime, default=datetime.datetime.now, index=True)

code/ch7-databases/data/release.py

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
import datetime
2+
23
import sqlalchemy
34
import sqlalchemy.orm as orm
5+
46
from data.modelbase import SqlAlchemyBase
57

68

code/ch7-databases/main.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
def main():
1717
configure(dev_mode=True)
1818
# noinspection PyTypeChecker
19-
uvicorn.run(app, host='127.0.0.1', port=8000, debug=True)
19+
uvicorn.run(app, host='127.0.0.1', port=8000)
2020

2121

2222
def configure(dev_mode: bool):

code/ch7-databases/requirements.in

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
fastapi
2+
uvicorn
3+
aiofiles
4+
python-multipart
5+
6+
# This is now available on PyPI.org, so we'll be using that one going forward.
7+
fastapi-chameleon
8+
9+
starlette
10+
SQLAlchemy
11+
progressbar2
12+
python-dateutil
13+
passlib

code/ch7-databases/requirements.txt

+59-13
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,59 @@
1-
fastapi==0.70.0
2-
uvicorn==0.15.0
3-
aiofiles
4-
python-multipart
5-
6-
# This is now available on PyPI.org, so we'll be using that one going forward.
7-
fastapi-chameleon==0.1.12
8-
9-
starlette==0.16.0
10-
SQLAlchemy==1.4.25
11-
progressbar2
12-
python-dateutil
13-
passlib
1+
#
2+
# This file is autogenerated by pip-compile with Python 3.11
3+
# by the following command:
4+
#
5+
# pip-compile requirements.in
6+
#
7+
aiofiles==23.1.0
8+
# via -r requirements.in
9+
annotated-types==0.5.0
10+
# via pydantic
11+
anyio==3.7.1
12+
# via starlette
13+
chameleon==4.0.1
14+
# via fastapi-chameleon
15+
click==8.1.5
16+
# via uvicorn
17+
fastapi==0.100.0
18+
# via
19+
# -r requirements.in
20+
# fastapi-chameleon
21+
fastapi-chameleon==0.1.14
22+
# via -r requirements.in
23+
h11==0.14.0
24+
# via uvicorn
25+
idna==3.4
26+
# via anyio
27+
passlib==1.7.4
28+
# via -r requirements.in
29+
progressbar2==4.2.0
30+
# via -r requirements.in
31+
pydantic==2.0.2
32+
# via fastapi
33+
pydantic-core==2.1.2
34+
# via pydantic
35+
python-dateutil==2.8.2
36+
# via -r requirements.in
37+
python-multipart==0.0.6
38+
# via -r requirements.in
39+
python-utils==3.7.0
40+
# via progressbar2
41+
six==1.16.0
42+
# via python-dateutil
43+
sniffio==1.3.0
44+
# via anyio
45+
sqlalchemy==2.0.18
46+
# via -r requirements.in
47+
starlette==0.27.0
48+
# via
49+
# -r requirements.in
50+
# fastapi
51+
typing-extensions==4.7.1
52+
# via
53+
# fastapi
54+
# pydantic
55+
# pydantic-core
56+
# python-utils
57+
# sqlalchemy
58+
uvicorn==0.22.0
59+
# via -r requirements.in

code/ch8-async-databases/data/package.py

+3
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99

1010
class Package(SqlAlchemyBase):
1111
__tablename__ = 'packages'
12+
# For SQLAlchemy 2.0 compatibility
13+
# (see https://docs.sqlalchemy.org/en/20/errors.html#error-zlpr)
14+
__allow_unmapped__ = True
1215

1316
id: str = sa.Column(sa.String, primary_key=True)
1417
created_date: datetime.datetime = sa.Column(sa.DateTime, default=datetime.datetime.now, index=True)

code/ch8-async-databases/main.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,7 @@
1515

1616
def main():
1717
configure(dev_mode=True)
18-
# noinspection PyTypeChecker
19-
uvicorn.run(app, host='127.0.0.1', port=8000, debug=True)
18+
uvicorn.run(app, host='127.0.0.1', port=8000)
2019

2120

2221
def configure(dev_mode: bool):

0 commit comments

Comments
 (0)