diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb88ae9..952ccb3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,5 +20,5 @@ jobs: test: uses: ./.github/workflows/shared-tests.yml with: - python-version: '3.8' + python-version: '3.9' secrets: inherit diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bebe9f3..6d35b5b 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -9,4 +9,4 @@ jobs: test: uses: ./.github/workflows/shared-tests.yml with: - python-version: '3.8' + python-version: '3.9' diff --git a/requirements.txt b/requirements.txt index 687bfb9..bc927eb 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,12 +1,12 @@ python_dateutil >= 2.5.3 setuptools >= 21.0.0 -urllib3 >= 1.25.3, < 2.1.0 +urllib3 >= 1.25.3, < 3 pydantic >= 2 typing-extensions >= 4.7.1 DateTime~=5.5 -PyJWT~=2.9.0 +PyJWT>=2.12,<3 requests~=2.32.3 coverage cryptography -python-dotenv~=1.0.1 +python-dotenv>=1.0,<2 httpx \ No newline at end of file diff --git a/setup.py b/setup.py index a761dfc..7948448 100644 --- a/setup.py +++ b/setup.py @@ -5,9 +5,9 @@ import sys -if sys.version_info < (3, 8): - raise RuntimeError("skyflow requires Python 3.8+") -current_version = '2.1.0' +if sys.version_info < (3, 9): + raise RuntimeError("skyflow requires Python 3.9+") +current_version = '2.1.0.dev0+2ce0f02' with open('README.md', 'r', encoding='utf-8') as f: long_description = f.read() @@ -26,15 +26,15 @@ install_requires=[ 'python_dateutil >= 2.5.3', 'setuptools >= 75.3.3', - 'urllib3 >= 1.25.3, <= 2.6.3', + 'urllib3 >= 1.25.3, < 3', 'pydantic >= 2', 'typing-extensions >= 4.7.1', 'DateTime~=5.5', - 'PyJWT~=2.9.0', + 'PyJWT >= 2.12, < 3', 'requests~=2.32.3', 'coverage', 'cryptography', - 'python-dotenv~=1.0.1', + 'python-dotenv >= 1.0, < 2', 'httpx' ], extras_require={ @@ -43,5 +43,5 @@ 'ruff' ] }, - python_requires=">=3.8", + python_requires=">=3.9", ) diff --git a/skyflow/utils/_version.py b/skyflow/utils/_version.py index ed550f6..c56d424 100644 --- a/skyflow/utils/_version.py +++ b/skyflow/utils/_version.py @@ -1 +1 @@ -SDK_VERSION = '2.1.0' +SDK_VERSION = '2.1.0.dev0+2ce0f02' diff --git a/tests/service_account/test__utils.py b/tests/service_account/test__utils.py index 856d26b..053a1c9 100644 --- a/tests/service_account/test__utils.py +++ b/tests/service_account/test__utils.py @@ -130,11 +130,25 @@ def test_get_service_account_token_missing_token_uri_key(self): get_service_account_token(CREDENTIALS_WITHOUT_TOKEN_URI, {}, None) self.assertEqual(context.exception.message, SkyflowMessages.Error.MISSING_TOKEN_URI.value) - def test_get_service_account_token_with_valid_credentials(self): + @patch("skyflow.service_account._utils.AuthClient") + @patch("skyflow.service_account._utils.get_signed_jwt") + def test_get_service_account_token_with_valid_credentials(self, mock_get_signed_jwt, mock_auth_client): + mock_get_signed_jwt.return_value = "signed" + mock_auth_api = mock_auth_client.return_value.get_auth_api.return_value + mock_auth_api.authentication_service_get_auth_token.return_value = type( + "obj", (), {"access_token": "mock_token", "token_type": "bearer"} + ) access_token, _ = get_service_account_token(VALID_SERVICE_ACCOUNT_CREDS, {}, None) self.assertTrue(access_token) - def test_get_service_account_token_with_snake_case_creds(self): + @patch("skyflow.service_account._utils.AuthClient") + @patch("skyflow.service_account._utils.get_signed_jwt") + def test_get_service_account_token_with_snake_case_creds(self, mock_get_signed_jwt, mock_auth_client): + mock_get_signed_jwt.return_value = "signed" + mock_auth_api = mock_auth_client.return_value.get_auth_api.return_value + mock_auth_api.authentication_service_get_auth_token.return_value = type( + "obj", (), {"access_token": "mock_token", "token_type": "bearer"} + ) access_token, _ = get_service_account_token(SNAKE_CASE_CREDS, {}, None) self.assertTrue(access_token)