From dc591c5802a19777b0df2425b20e756ab748f094 Mon Sep 17 00:00:00 2001 From: Matt Dzwonczyk <9063128+mattgd@users.noreply.github.com> Date: Mon, 6 Jan 2025 12:51:55 -0500 Subject: [PATCH] Update dependencies and version pinning (#394) --- requirements-dev.txt | 10 +++++----- requirements.txt | 8 ++++---- tests/test_audit_logs.py | 1 - tests/test_mfa.py | 2 +- tests/test_organizations.py | 2 +- tests/test_session.py | 1 - tests/test_sso.py | 2 +- tests/test_webhooks.py | 4 ++-- workos/user_management.py | 2 +- 9 files changed, 15 insertions(+), 17 deletions(-) diff --git a/requirements-dev.txt b/requirements-dev.txt index 478712f7..409b6da8 100644 --- a/requirements-dev.txt +++ b/requirements-dev.txt @@ -1,9 +1,9 @@ -flake8 -pytest==8.3.2 +flake8==7.1.1 +pytest==8.3.4 pytest-asyncio==0.23.8 pytest-cov==5.0.0 -six==1.16.0 +six==1.17.0 black==24.4.2 twine==5.1.1 -mypy==1.12.0 -httpx>=0.27.0 +mypy==1.14.1 +httpx~=0.28.1 diff --git a/requirements.txt b/requirements.txt index beaf1927..3f403687 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -httpx>=0.27.0 -pydantic==2.9.2 -PyJWT==2.9.0 -cryptography==43.0.3 +httpx~=0.28.1 +pydantic~=2.10.4 +PyJWT==2.9.0 # Pinned because of Python 3.8 incompatibility in future versions +cryptography~=44.0.0 diff --git a/tests/test_audit_logs.py b/tests/test_audit_logs.py index 6d6a88c8..390536f8 100644 --- a/tests/test_audit_logs.py +++ b/tests/test_audit_logs.py @@ -130,7 +130,6 @@ def test_throws_badrequest_excpetion( self, mock_audit_log_event, mock_http_client_with_response ): organization_id = "org_123456789" - event = {"any_event": "any_event"} mock_http_client_with_response( self.http_client, diff --git a/tests/test_mfa.py b/tests/test_mfa.py index cff36168..bddd5765 100644 --- a/tests/test_mfa.py +++ b/tests/test_mfa.py @@ -221,7 +221,7 @@ def test_delete_factor_success(self, capture_and_mock_http_client_request): "/auth/factors/auth_factor_01FZ4TS14D1PHFNZ9GF6YD8M1F" ) assert request_kwargs["method"] == "delete" - assert response == None + assert response is None def test_challenge_success( self, mock_challenge_factor_response, capture_and_mock_http_client_request diff --git a/tests/test_organizations.py b/tests/test_organizations.py index 60cb60a6..b7cf5322 100644 --- a/tests/test_organizations.py +++ b/tests/test_organizations.py @@ -64,7 +64,7 @@ def mock_organizations_single_page_response(self): @pytest.fixture def mock_organizations_multiple_data_pages(self): organizations_list = [ - MockOrganization(id=str(f"org_{i+1}")).dict() for i in range(40) + MockOrganization(id=str(f"org_{i + 1}")).dict() for i in range(40) ] return list_response_of(data=organizations_list) diff --git a/tests/test_session.py b/tests/test_session.py index fbb82717..c700b507 100644 --- a/tests/test_session.py +++ b/tests/test_session.py @@ -1,7 +1,6 @@ import pytest from unittest.mock import Mock, patch import jwt -from jwt import PyJWKClient from datetime import datetime, timezone from tests.conftest import with_jwks_mock diff --git a/tests/test_sso.py b/tests/test_sso.py index 52a79279..6572089e 100644 --- a/tests/test_sso.py +++ b/tests/test_sso.py @@ -304,7 +304,7 @@ def test_get_profile(self, mock_profile, capture_and_mock_http_client_request): assert profile.dict() == mock_profile assert request_kwargs["url"].endswith("/sso/profile") assert request_kwargs["method"] == "get" - assert request_kwargs["headers"]["authorization"] == f"Bearer 123" + assert request_kwargs["headers"]["authorization"] == "Bearer 123" def test_get_connection( self, mock_connection, capture_and_mock_http_client_request diff --git a/tests/test_webhooks.py b/tests/test_webhooks.py index d4ebccb0..5dc6f6d2 100644 --- a/tests/test_webhooks.py +++ b/tests/test_webhooks.py @@ -72,14 +72,14 @@ def test_sig_hash_does_not_match_expected_sig_length(self, mock_sig_hash): mock_sig_hash, "df25b6efdd39d82e7b30e75ea19655b306860ad5cde3eeaeb6f1dfea029ea25", ) - assert result == False + assert result is False def test_sig_hash_does_not_match_expected_sig_value(self, mock_sig_hash): result = self.webhooks._constant_time_compare( mock_sig_hash, "df25b6efdd39d82e7b30e75ea19655b306860ad5cde3eeaeb6f1dfea029ea252", ) - assert result == False + assert result is False def test_passed_expected_event_validation( self, mock_event_body, mock_header, mock_secret diff --git a/workos/user_management.py b/workos/user_management.py index c0e94acf..1c16125d 100644 --- a/workos/user_management.py +++ b/workos/user_management.py @@ -1,4 +1,4 @@ -from typing import Optional, Protocol, Sequence, Set, Type, cast +from typing import Optional, Protocol, Sequence, Type, cast from workos._client_configuration import ClientConfiguration from workos.session import Session from workos.types.list_resource import (