Skip to content

Commit

Permalink
chore: mise à jour des versions de dépendances dans pyproject.toml (#…
Browse files Browse the repository at this point in the history
…884)

## Description

🎸 mise à jour des versions de dépendances dans `pyproject.toml`

## Type de changement

🚧 technique

### Points d'attention

🦺 mise à jour des tests suite à la montée de version de `httpx` et
`respx`
🦺 mise à jour des tests suite à la montée de version de `moto`
🦺 remplacement de `psycopg2-binary` par `psycopg`
  • Loading branch information
vincentporte authored Jan 23, 2025
1 parent 84d9168 commit 4ae46d0
Show file tree
Hide file tree
Showing 7 changed files with 64 additions and 90 deletions.
4 changes: 2 additions & 2 deletions lacommunaute/forum_file/tests/test_admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from django.conf import settings
from django.core.files.uploadedfile import SimpleUploadedFile
from django.urls import reverse
from moto import mock_s3
from moto import mock_aws
from PIL import Image

from lacommunaute.forum_file.models import PublicFile
Expand All @@ -34,7 +34,7 @@ def image_content_fixture():
return buffer.getvalue()


@mock_s3
@mock_aws
def test_file_is_saved_with_logged_user(client, db, superuser, image_content):
conn = boto3.client("s3", endpoint_url=settings.AWS_S3_ENDPOINT_URL, region_name="us-east-1")
conn.create_bucket(Bucket=settings.AWS_STORAGE_BUCKET_NAME_PUBLIC)
Expand Down
2 changes: 1 addition & 1 deletion lacommunaute/forum_file/tests/test_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

@pytest.fixture(name="s3_bucket")
def s3_bucket_fixture():
with moto.mock_s3():
with moto.mock_aws():
yield settings.AWS_STORAGE_BUCKET_NAME_PUBLIC


Expand Down
4 changes: 2 additions & 2 deletions lacommunaute/notification/tests/tests_emails.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
class SendEmailTestCase(TestCase):
@classmethod
def setUpTestData(cls):
respx.post(SIB_SMTP_URL).mock(return_value=httpx.Response(200, json={"message": "OK"}))
respx.post(SIB_SMTP_URL).mock(return_value=httpx.Response(200, text='{"message": "OK"}'))
cls.to = [{"email": faker.email()}]
cls.params = faker.text()
cls.template_id = faker.random_int()
Expand Down Expand Up @@ -52,7 +52,7 @@ def test_send_email_with_bcc(self):
class BulkSendUserToListTestCase(TestCase):
@classmethod
def setUpTestData(cls):
respx.post(SIB_CONTACTS_URL).mock(return_value=httpx.Response(200, json={"message": "OK"}))
respx.post(SIB_CONTACTS_URL).mock(return_value=httpx.Response(200, text='{"message": "OK"}'))

@respx.mock
def test_bulk_send_user_to_list(self):
Expand Down
4 changes: 2 additions & 2 deletions lacommunaute/notification/tests/tests_tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
@pytest.fixture(name="mock_respx_post_to_sib_smtp_url")
def mock_respx_post_to_sib_smtp_url_fixture():
with respx.mock:
respx.post(SIB_SMTP_URL).mock(return_value=httpx.Response(200, json={"message": "OK"}))
respx.post(SIB_SMTP_URL).mock(return_value=httpx.Response(200, text='{"message": "OK"}'))
yield


Expand Down Expand Up @@ -109,7 +109,7 @@ def test_num_queries(self, db, django_assert_num_queries, mock_respx_post_to_sib
class AddUserToListWhenRegister(TestCase):
def setUp(self):
super().setUp()
respx.post(SIB_CONTACTS_URL).mock(return_value=httpx.Response(200, json={"message": "OK"}))
respx.post(SIB_CONTACTS_URL).mock(return_value=httpx.Response(200, text='{"message": "OK"}'))

@respx.mock
def test_add_user_to_list_when_register(self):
Expand Down
4 changes: 2 additions & 2 deletions lacommunaute/users/tests/__snapshots__/tests_views.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -614,8 +614,8 @@
'''
# ---
# name: TestSendMagicLink.test_send_magic[PROD-True-0][send_magic_link_payload]
'{"sender": {"name": "La Communaut\\u00e9", "email": "[email protected]"}, "to": [{"email": "[email protected]"}], "params": {"display_name": "Samuel J.", "login_link": "LOGIN_LINK"}, "templateId": 31}'
'{"sender":{"name":"La Communauté","email":"[email protected]"},"to":[{"email":"[email protected]"}],"params":{"display_name":"Samuel J.","login_link":"LOGIN_LINK"},"templateId":31}'
# ---
# name: TestSendMagicLink.test_send_magic[TEST-True-0][send_magic_link_payload]
'{"sender": {"name": "La Communaut\\u00e9", "email": "[email protected]"}, "to": [{"email": "[email protected]"}], "params": {"display_name": "Samuel J.", "login_link": "LOGIN_LINK"}, "templateId": 31}'
'{"sender":{"name":"La Communauté","email":"[email protected]"},"to":[{"email":"[email protected]"}],"params":{"display_name":"Samuel J.","login_link":"LOGIN_LINK"},"templateId":31}'
# ---
65 changes: 31 additions & 34 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,49 +8,46 @@ requires-python = ">=3.13"
readme = "README.md"
dependencies = [
"Django>=5.1",
"python-dotenv>=0.21.0",
"psycopg2-binary>=2.9.3",
"python-dotenv>=1.0",
"psycopg>=3.2",
"django-machina>=1.2.0",
"boto3>=1.24.91",
"django-storages>=1.13.1",
"httpx>=0.23.0",
"django-compressor~=4.1",
"boto3>=1.36",
"django-storages>=1.14",
"httpx>=0.28",
"django-compressor>=4.5",
"django-libsass>=0.9",
"sentry-sdk~=2.8",
"sentry-sdk>=2.20",
"django-social-share>=2.3.0",
"django-htmx>=1.12.2",
"django-taggit>=5.0.1",
"django-csp~=3.7",
"django-permissions-policy>=4.15.0",
"django-htmx>=1.21",
"django-taggit>=6.1",
"django-csp>=3.8",
"django-permissions-policy>=4.24",
"langdetect>=1.0.9",
"freezegun>=1.5.1",
"pyjwt>=2.9.03",
"pyjwt>=2.10",
]

[dependency-groups]
dev = [
"black>=24.3.0",
"pylint>=2.15.2",
"pylint-django>=2.5.3",
"pre-commit>=2.20.0",
"coverage>=6.4.4",
"django-extensions>=3.2.1",
"django-debug-toolbar>=3.7.0",
"Werkzeug>=3.0.3",
"pytest-django>=4.5.2",
"debugpy>=1.6.3",
"factory-boy>=3.2.1",
"respx>=0.20.0",
"pygithub~=1.57",
"pytest-xdist>=3.2.1",
"pillow>=10.0.0",
"moto>=4.2.2",
"virtualenv>=20.24.6",
"ruff>=0.4.5",
"djlint>=1.34.1",
"syrupy>=4.6.0",
"beautifulsoup4>=4.12.3",
"pylint>=3.3",
"pylint-django>=2.6",
"pre-commit>=4.0",
"coverage>=7.6",
"django-extensions>=3.2",
"django-debug-toolbar>=5.0",
"Werkzeug>=3.1.3",
"pytest-django>=4.9",
"debugpy>=1.8",
"factory-boy>=3.3",
"respx>=0.22",
"pytest-xdist>=3.6",
"pillow>=11.1.0",
"moto>=5.0",
"ruff>=0.9",
"djlint>=1.36",
"syrupy>=4.8",
"beautifulsoup4>=4.12",
"html5lib~=1.1",
"freezegun>=1.5.1",
]

[tool.ruff]
Expand Down
71 changes: 24 additions & 47 deletions uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 4ae46d0

Please sign in to comment.