Skip to content

Commit a677f6a

Browse files
committed
fix test failures d/t new 'fastaspi-mail' and pin httpx to 0.27.2 d/t removed 'app' arg
currently the httpx issue looks to be because of the pinnned older 'pytest-asyncio' Signed-off-by: Grant Ramsay <seapagan@gmail.com>
1 parent 5d08733 commit a677f6a

File tree

7 files changed

+809
-760
lines changed

7 files changed

+809
-760
lines changed

app/managers/email.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Define the Email Manager."""
1+
"""Define the Email Manager.""" # noqa: A005
22

33
from __future__ import annotations
44

@@ -8,6 +8,7 @@
88
from fastapi import BackgroundTasks # noqa: TC002
99
from fastapi.responses import JSONResponse
1010
from fastapi_mail import ConnectionConfig, FastMail, MessageSchema, MessageType
11+
from pydantic import SecretStr
1112

1213
from app.config.settings import get_settings
1314

@@ -25,7 +26,7 @@ def __init__(self, suppress_send: Optional[bool] = False) -> None:
2526
"""
2627
self.conf = ConnectionConfig(
2728
MAIL_USERNAME=get_settings().mail_username,
28-
MAIL_PASSWORD=get_settings().mail_password,
29+
MAIL_PASSWORD=SecretStr(get_settings().mail_password),
2930
MAIL_FROM=get_settings().mail_from,
3031
MAIL_PORT=get_settings().mail_port,
3132
MAIL_SERVER=get_settings().mail_server,

app/schemas/email.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""Define email Connection Schema."""
1+
"""Define email Connection Schema.""" # noqa: A005
22

33
from typing import Any
44

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ dependencies = [
2424
"rtoml>=0.11.0",
2525
"jinja2>=3.1.4",
2626
"fastapi-mail>=1.4.1",
27-
"httpx>=0.23.3",
27+
"httpx==0.27.2",
2828
"uvicorn[standard]>=0.32.0",
2929
"passlib[bcrypt]>=1.7.4",
3030
"sqlalchemy[asyncio]>=2.0.36",

requirements-dev.txt

Lines changed: 57 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,107 +1,107 @@
11
# This file was autogenerated by uv via the following command:
22
# uv export --no-hashes --no-emit-project --output-file=requirements-dev.txt
33
aiosmtpd==1.4.6
4-
aiosmtplib==2.0.2
4+
aiosmtplib==3.0.2
55
aiosqlite==0.20.0
66
alembic==1.14.1
77
annotated-types==0.7.0
8-
anyio==4.6.2.post1
8+
anyio==4.8.0
99
application-properties==0.8.2
10-
async-timeout==5.0.0 ; python_full_version < '3.11'
11-
asyncclick==8.1.7.2
10+
async-timeout==5.0.1 ; python_full_version < '3.11'
11+
asyncclick==8.1.8
1212
asyncpg==0.30.0
1313
asyncpg-stubs==0.30.0
14-
atpublic==5.0
15-
attrs==24.2.0
14+
atpublic==5.1
15+
attrs==25.1.0
1616
babel==2.16.0
1717
bcrypt==4.0.1
1818
beautifulsoup4==4.12.3
19-
blinker==1.8.2
20-
certifi==2024.8.30
19+
blinker==1.9.0
20+
certifi==2024.12.14
2121
cffi==1.17.1
2222
cfgv==3.4.0
23-
charset-normalizer==3.4.0
24-
click==8.1.7
23+
charset-normalizer==3.4.1
24+
click==8.1.8
2525
colorama==0.4.6
2626
columnar==1.4.1
27-
coverage==7.6.4
28-
cryptography==43.0.3
27+
coverage==7.6.10
28+
cryptography==44.0.0
2929
csscompressor==0.9.5
30-
deprecated==1.2.14
30+
deprecated==1.2.18
3131
distlib==0.3.9
3232
distro==1.9.0
3333
dnspython==2.7.0
3434
email-validator==2.2.0
3535
exceptiongroup==1.2.2 ; python_full_version < '3.11'
36-
faker==30.8.2
36+
faker==35.0.0
3737
fastapi==0.115.7
38-
fastapi-cli==0.0.5
39-
fastapi-mail==1.4.1
40-
filelock==3.16.1
38+
fastapi-cli==0.0.7
39+
fastapi-mail==1.4.2
40+
filelock==3.17.0
4141
ghp-import==2.1.0
42-
gitdb==4.0.11
42+
gitdb==4.0.12
4343
github-changelog-md==0.9.5
44-
gitpython==3.1.43
44+
gitpython==3.1.44
4545
greenlet==3.1.1
46-
griffe==1.5.1
46+
griffe==1.5.5
4747
h11==0.14.0
4848
htmlmin2==0.1.13
49-
httpcore==0.16.3
49+
httpcore==1.0.7
5050
httptools==0.6.4
51-
httpx==0.23.3
52-
identify==2.6.1
51+
httpx==0.27.2
52+
identify==2.6.6
5353
idna==3.10
54-
importlib-metadata==8.5.0 ; python_full_version < '3.10'
54+
importlib-metadata==8.6.1 ; python_full_version < '3.10'
5555
iniconfig==2.0.0
5656
jinja2==3.1.5
57-
jiter==0.7.0
57+
jiter==0.8.2
5858
jsmin==3.0.1
59-
mako==1.3.6
59+
mako==1.3.8
6060
markdown==3.7
6161
markdown-it-py==3.0.0
6262
markupsafe==3.0.2
6363
mdurl==0.1.2
6464
mergedeep==1.3.4
6565
mkdoc==0.1
6666
mkdocs==1.6.1
67-
mkdocs-autorefs==1.2.0
67+
mkdocs-autorefs==1.3.0
6868
mkdocs-get-deps==0.2.0
6969
mkdocs-git-revision-date-localized-plugin==1.3.0
7070
mkdocs-latest-git-tag-plugin==0.1.2
71-
mkdocs-material==9.5.43
71+
mkdocs-material==9.5.50
7272
mkdocs-material-extensions==1.3.1
7373
mkdocs-minify-plugin==0.8.0
7474
mkdocs-swagger-ui-tag==0.6.11
75-
mkdocstrings==0.26.2
76-
mkdocstrings-python==1.12.2
75+
mkdocstrings==0.27.0
76+
mkdocstrings-python==1.13.0
7777
mock==5.1.0
7878
mypy==1.14.1
7979
mypy-extensions==1.0.0
8080
nodeenv==1.9.1
81-
openai==1.54.0
82-
packaging==24.1
81+
openai==1.60.2
82+
packaging==24.2
8383
paginate==0.5.7
8484
passlib==1.7.4
8585
pastel==0.2.1
8686
pathspec==0.12.1
8787
platformdirs==4.3.6
8888
pluggy==1.5.0
89-
poethepoet==0.29.0
89+
poethepoet==0.32.2
9090
pprintpp==0.4.0
91-
pre-commit==4.0.1
91+
pre-commit==4.1.0
9292
psycopg2==2.9.10
9393
pycparser==2.22
9494
pydantic==2.10.6
9595
pydantic-core==2.27.2
96-
pydantic-settings==2.6.1
97-
pyfakefs==5.7.1
98-
pygithub==2.4.0
99-
pygments==2.18.0
96+
pydantic-settings==2.7.1
97+
pyfakefs==5.7.4
98+
pygithub==2.5.0
99+
pygments==2.19.1
100100
pyjwt==2.10.1
101-
pymarkdownlnt==0.9.24
102-
pymdown-extensions==10.12
101+
pymarkdownlnt==0.9.26
102+
pymdown-extensions==10.14.2
103103
pynacl==1.5.0
104-
pytest==8.3.3
104+
pytest==8.3.4
105105
pytest-asyncio==0.21.2
106106
pytest-clarity==1.0.1
107107
pytest-cov==6.0.0
@@ -118,34 +118,34 @@ python-multipart==0.0.20
118118
pytz==2024.2
119119
pyyaml==6.0.2
120120
pyyaml-env-tag==0.1
121-
regex==2024.9.11
121+
regex==2024.11.6
122122
requests==2.32.3
123-
rfc3986==1.5.0
124123
rich==13.9.4
124+
rich-toolkit==0.13.2
125125
rtoml==0.12.0
126126
ruff==0.9.3
127127
shellingham==1.5.4
128-
simple-toml-settings==0.8.0
129-
six==1.16.0
130-
smmap==5.0.1
128+
simple-toml-settings==0.9.0
129+
six==1.17.0
130+
smmap==5.0.2
131131
sniffio==1.3.1
132132
soupsieve==2.6
133133
sqlalchemy==2.0.37
134-
starlette==0.41.3
134+
starlette==0.45.3
135135
termcolor==2.5.0
136-
tomli==2.0.2
136+
tomli==2.2.1
137137
toolz==1.0.0
138-
tqdm==4.66.6
138+
tqdm==4.67.1
139139
typer==0.12.5
140-
types-passlib==1.7.7.20240819
140+
types-passlib==1.7.7.20241221
141141
typing-extensions==4.12.2
142-
urllib3==2.2.3
143-
uvicorn==0.32.0
142+
urllib3==2.3.0
143+
uvicorn==0.34.0
144144
uvloop==0.21.0 ; platform_python_implementation != 'PyPy' and sys_platform != 'cygwin' and sys_platform != 'win32'
145-
virtualenv==20.27.1
145+
virtualenv==20.29.1
146146
watchdog==6.0.0
147-
watchfiles==0.24.0
147+
watchfiles==1.0.4
148148
wcwidth==0.2.13
149-
websockets==13.1
150-
wrapt==1.16.0
151-
zipp==3.20.2 ; python_full_version < '3.10'
149+
websockets==14.2
150+
wrapt==1.17.2
151+
zipp==3.21.0 ; python_full_version < '3.10'

requirements.txt

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,55 @@
11
# This file was autogenerated by uv via the following command:
22
# uv export --no-hashes --no-dev --no-emit-project --output-file=requirements.txt
3-
aiosmtplib==2.0.2
3+
aiosmtplib==3.0.2
44
alembic==1.14.1
55
annotated-types==0.7.0
6-
anyio==4.6.2.post1
7-
async-timeout==5.0.0 ; python_full_version < '3.11'
8-
asyncclick==8.1.7.2
6+
anyio==4.8.0
7+
async-timeout==5.0.1 ; python_full_version < '3.11'
8+
asyncclick==8.1.8
99
asyncpg==0.30.0
1010
bcrypt==4.0.1
11-
blinker==1.8.2
12-
certifi==2024.8.30
13-
click==8.1.7
11+
blinker==1.9.0
12+
certifi==2024.12.14
13+
click==8.1.8
1414
colorama==0.4.6 ; sys_platform == 'win32'
1515
dnspython==2.7.0
1616
email-validator==2.2.0
1717
exceptiongroup==1.2.2 ; python_full_version < '3.11'
1818
fastapi==0.115.7
19-
fastapi-cli==0.0.5
20-
fastapi-mail==1.4.1
19+
fastapi-cli==0.0.7
20+
fastapi-mail==1.4.2
2121
greenlet==3.1.1
2222
h11==0.14.0
23-
httpcore==0.16.3
23+
httpcore==1.0.7
2424
httptools==0.6.4
25-
httpx==0.23.3
25+
httpx==0.27.2
2626
idna==3.10
2727
jinja2==3.1.5
28-
mako==1.3.6
28+
mako==1.3.8
2929
markdown-it-py==3.0.0
3030
markupsafe==3.0.2
3131
mdurl==0.1.2
3232
passlib==1.7.4
3333
psycopg2==2.9.10
3434
pydantic==2.10.6
3535
pydantic-core==2.27.2
36-
pydantic-settings==2.6.1
37-
pygments==2.18.0
36+
pydantic-settings==2.7.1
37+
pygments==2.19.1
3838
pyjwt==2.10.1
3939
python-decouple==3.8
4040
python-dotenv==1.0.1
4141
python-multipart==0.0.20
4242
pyyaml==6.0.2
43-
rfc3986==1.5.0
4443
rich==13.9.4
44+
rich-toolkit==0.13.2
4545
rtoml==0.12.0
4646
shellingham==1.5.4
4747
sniffio==1.3.1
4848
sqlalchemy==2.0.37
49-
starlette==0.41.3
49+
starlette==0.45.3
5050
typer==0.12.5
5151
typing-extensions==4.12.2
52-
uvicorn==0.32.0
52+
uvicorn==0.34.0
5353
uvloop==0.21.0 ; platform_python_implementation != 'PyPy' and sys_platform != 'cygwin' and sys_platform != 'win32'
54-
watchfiles==0.24.0
55-
websockets==13.1
54+
watchfiles==1.0.4
55+
websockets==14.2

tests/unit/test_email_manager.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,10 @@ class TestEmailManager:
3737
def test_init(self, email_manager) -> None:
3838
"""Test the EmailManager constructor."""
3939
assert get_settings().mail_username == email_manager.conf.MAIL_USERNAME
40-
assert get_settings().mail_password == email_manager.conf.MAIL_PASSWORD
40+
assert (
41+
get_settings().mail_password
42+
== email_manager.conf.MAIL_PASSWORD.get_secret_value()
43+
)
4144
assert get_settings().mail_from == email_manager.conf.MAIL_FROM
4245
assert email_manager.conf.SUPPRESS_SEND == 1
4346

0 commit comments

Comments
 (0)