Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
test:
uses: ./.github/workflows/shared-tests.yml
with:
python-version: '3.8'
python-version: '3.9'
secrets: inherit
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ jobs:
test:
uses: ./.github/workflows/shared-tests.yml
with:
python-version: '3.8'
python-version: '3.9'
6 changes: 3 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -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
12 changes: 6 additions & 6 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
import sys


if sys.version_info < (3, 8):
raise RuntimeError("skyflow requires Python 3.8+")
if sys.version_info < (3, 9):
raise RuntimeError("skyflow requires Python 3.9+")
current_version = '2.1.0'

with open('README.md', 'r', encoding='utf-8') as f:
Expand All @@ -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={
Expand All @@ -43,5 +43,5 @@
'ruff'
]
},
python_requires=">=3.8",
python_requires=">=3.9",
)
18 changes: 16 additions & 2 deletions tests/service_account/test__utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down
Loading