Skip to content

Commit 0c769f9

Browse files
committed
[Identity] Update requirements
PyPy 3.11 needs a later version of cryptography as 2.5 is too old and relies on CPython ABI symbols (PySlice_AdjustIndices) that is no longer supported. Also disabling the broker package dependency for 3.14 until pymsalruntime can produce 3.14-compat whl files. Signed-off-by: Paul Van Eck <[email protected]>
1 parent 1cf5ad0 commit 0c769f9

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
../../core/azure-core
2-
azure-identity-broker>=1.1.0 ; platform.python_implementation != "PyPy"
2+
azure-identity-broker>=1.1.0 ; platform.python_implementation != "PyPy" and python_version < '3.14.0'
33
aiohttp>=3.0
44
typing_extensions>=3.7.2
55
-e ../../../eng/tools/azure-sdk-tools

sdk/identity/azure-identity/pyproject.toml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ classifiers = [
2424
]
2525
dependencies = [
2626
"azure-core>=1.31.0",
27-
"cryptography>=2.5",
27+
"cryptography>=2.5; platform_python_implementation != 'PyPy'",
28+
"cryptography>=41.0; platform_python_implementation == 'PyPy'",
2829
"msal>=1.30.0",
2930
"msal-extensions>=1.2.0",
3031
"typing-extensions>=4.0.0",
@@ -47,4 +48,4 @@ pytyped = ["py.typed"]
4748
[tool.azure-sdk-build]
4849
pyright = false
4950
verifytypes = true
50-
black = true
51+
black = true

sdk/identity/azure-identity/tests/test_vscode_credential.py

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -76,15 +76,12 @@ def test_invalid_auth_record(self):
7676
os.unlink(tmp_file.name)
7777

7878
def test_broker_credential_requirements_not_installed(self):
79-
"""Test that the credential w"""
79+
"""Test that the credential works without the broker installed."""
8080

8181
with patch.dict("sys.modules", {"azure.identity.broker": None}):
82-
with patch("azure.identity.broker.InteractiveBrowserBrokerCredential") as mock_credential:
83-
with pytest.raises(CredentialUnavailableError):
84-
# This should raise an error because the broker requirements are not installed.
85-
VisualStudioCodeCredential().get_token_info("https://management.azure.com/.default")
86-
87-
assert mock_credential.call_count == 0, "InteractiveBrowserBrokerCredential should not be instantiated"
82+
with pytest.raises(CredentialUnavailableError):
83+
# This should raise an error because the broker requirements are not installed.
84+
VisualStudioCodeCredential().get_token_info("https://management.azure.com/.default")
8885

8986

9087
class TestLoadVSCodeAuthRecord:

0 commit comments

Comments
 (0)