Skip to content

Commit 5797b84

Browse files
saanikaguptamicrosoftSaanika Gupta
andauthored
Delete NOTICE file (#43864)
* Delete NOTICE file * Add <PyPy3.10 exclusion for azureml-dataprep-rslex in dev requirements * Update/disable tests for PyPy as required * Update CHANGELOG --------- Co-authored-by: Saanika Gupta <saanikagupta@microsoft.com>
1 parent 6542b4f commit 5797b84

File tree

11 files changed

+156
-11466
lines changed

11 files changed

+156
-11466
lines changed

sdk/ml/azure-ai-ml/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@
66

77
### Bugs Fixed
88

9+
### Other Changes
10+
11+
- Ensuring that azureml-dataprep-rslex is only installed for PyPy below 3.10 and CPython below 3.13.
912

1013
## 1.30.0 (2025-10-29)
1114

sdk/ml/azure-ai-ml/NOTICE.txt

Lines changed: 0 additions & 11444 deletions
This file was deleted.

sdk/ml/azure-ai-ml/dev_requirements.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,5 @@ azure-mgmt-resourcegraph<9.0.0,>=2.0.0
2121
azure-mgmt-resource<23.0.0,>=3.0.0
2222
pytest-reportlog
2323
python-dotenv
24-
azureml-dataprep-rslex>=2.22.0; python_version < "3.13"
24+
azureml-dataprep-rslex>=2.22.0; platform_python_implementation == "CPython" and python_version < "3.13"
25+
azureml-dataprep-rslex>=2.22.0; platform_python_implementation == "PyPy" and python_version < "3.10"

sdk/ml/azure-ai-ml/tests/dataset/unittests/test_data_operations.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import os, sys
1+
import os
2+
import platform
3+
import sys
24
from pathlib import Path
35
from typing import Iterable
46
from unittest.mock import ANY, Mock, patch
@@ -26,6 +28,9 @@
2628
from azure.ai.ml.operations import DataOperations, DatastoreOperations
2729
from azure.core.paging import ItemPaged
2830

31+
IS_CPYTHON = platform.python_implementation() == "CPython"
32+
IS_PYPY = platform.python_implementation() == "PyPy"
33+
2934

3035
@pytest.fixture
3136
def mock_datastore_operation(
@@ -577,8 +582,8 @@ def test_create_with_datastore(
577582
)
578583

579584
@pytest.mark.skipif(
580-
sys.version_info >= (3, 13),
581-
reason="Skipping because Python version is 3.13 or above. azureml.dataprep.rslex do not support py313",
585+
(IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)),
586+
reason="Skipping because CPython version is >=3.13 or PyPy version is >=3.10. azureml.dataprep.rslex do not support it",
582587
)
583588
def test_mount_persistent(
584589
self,
@@ -601,8 +606,8 @@ def test_mount_persistent(
601606
mock_data_operations._compute_operation.update_data_mounts.assert_called_once()
602607

603608
@pytest.mark.skipif(
604-
sys.version_info >= (3, 13),
605-
reason="Skipping because Python version is 3.13 or above. azureml.dataprep.rslex do not support py313",
609+
(IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)),
610+
reason="Skipping because CPython version is >=3.13 or PyPy version is >=3.10. azureml.dataprep.rslex do not support it",
606611
)
607612
def test_mount_non_persistent(
608613
self,

sdk/ml/azure-ai-ml/tests/datastore/unittests/test_datastore_operations.py

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
import os, sys
1+
import os
2+
import platform
3+
import sys
24
from unittest.mock import Mock, patch
35

46
import pytest
@@ -8,6 +10,9 @@
810
from azure.ai.ml.entities._datastore.datastore import Datastore
911
from azure.ai.ml.operations import DatastoreOperations
1012

13+
IS_CPYTHON = platform.python_implementation() == "CPython"
14+
IS_PYPY = platform.python_implementation() == "PyPy"
15+
1116

1217
@pytest.fixture
1318
def mock_datastore_operation(
@@ -69,8 +74,8 @@ def test_create(self, mock_from_rest, mock_datastore_operation: DatastoreOperati
6974
mock_datastore_operation._operation.create_or_update.assert_called_once()
7075

7176
@pytest.mark.skipif(
72-
sys.version_info >= (3, 13),
73-
reason="Skipping because Python version is 3.13 or above. azureml.dataprep.rslex do not support py313",
77+
(IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)),
78+
reason="Skipping because CPython version is >=3.13 or PyPy version is >=3.10. azureml.dataprep.rslex do not support it",
7479
)
7580
def test_mount_persistent(
7681
self,
@@ -94,8 +99,8 @@ def test_mount_persistent(
9499
mock_datastore_operation._compute_operation.update_data_mounts.assert_called_once()
95100

96101
@pytest.mark.skipif(
97-
sys.version_info >= (3, 13),
98-
reason="Skipping because Python version is 3.13 or above. azureml.dataprep.rslex do not support py313",
102+
(IS_CPYTHON and sys.version_info >= (3, 13)) or (IS_PYPY and sys.version_info >= (3, 10)),
103+
reason="Skipping because CPython version is >=3.13 or PyPy version is >=3.10. azureml.dataprep.rslex do not support it",
99104
)
100105
def test_mount_non_persistent(
101106
self,
Lines changed: 36 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
import sys
1+
import platform
22
import subprocess
3+
import sys
4+
35
import pytest
46

57
PACKAGE_NAME = "azureml-dataprep-rslex"
8+
IS_CPYTHON = platform.python_implementation() == "CPython"
9+
IS_PYPY = platform.python_implementation() == "PyPy"
610

711

812
def is_package_installed(package_name):
@@ -16,14 +20,36 @@ def is_package_installed(package_name):
1620
@pytest.mark.unittest
1721
@pytest.mark.core_sdk_test
1822
class TestPackageInstallation:
19-
"""Test class to validate package installation across Python versions."""
23+
"""Test class to validate package installation across Python versions and environments."""
2024

21-
@pytest.mark.skipif(sys.version_info < (3, 13), reason="Skipping because Python version is below 3.13")
22-
def test_package_not_installed_in_python_3_13(self):
23-
"""Ensure azureml-dataprep-rslex is NOT installed in Python 3.13+."""
24-
assert not is_package_installed(PACKAGE_NAME), f"{PACKAGE_NAME} should not be installed in Python 3.13+"
25+
@pytest.mark.skipif(
26+
not (IS_CPYTHON and sys.version_info >= (3, 13)),
27+
reason="Skipping because environment is not >= cpython 3.13",
28+
)
29+
def test_package_not_installed_in_cpython_3_13(self):
30+
assert not is_package_installed(
31+
PACKAGE_NAME
32+
), f"{PACKAGE_NAME} should not be installed in CPython 3.13 or above environment."
2533

26-
@pytest.mark.skipif(sys.version_info >= (3, 13), reason="Skipping because Python version is 3.13 or above")
27-
def test_package_installed_below_python_3_13(self):
28-
"""Ensure azureml-dataprep-rslex IS installed in Python < 3.13."""
29-
assert is_package_installed(PACKAGE_NAME), f"{PACKAGE_NAME} should be installed in Python < 3.13"
34+
@pytest.mark.skipif(
35+
not (IS_CPYTHON and sys.version_info < (3, 13)),
36+
reason="Skipping because environment is not below cpython 3.13",
37+
)
38+
def test_package_installed_below_cpython_3_13(self):
39+
assert is_package_installed(PACKAGE_NAME), f"{PACKAGE_NAME} should be installed in CPython < 3.13."
40+
41+
@pytest.mark.skipif(
42+
not (IS_PYPY and sys.version_info >= (3, 10)),
43+
reason="Skipping because environment is not >= pypy 3.10",
44+
)
45+
def test_package_not_installed_in_pypy_3_10(self):
46+
assert not is_package_installed(
47+
PACKAGE_NAME
48+
), f"{PACKAGE_NAME} should not be installed in PyPy 3.10 or above environment."
49+
50+
@pytest.mark.skipif(
51+
not (IS_PYPY and sys.version_info < (3, 10)),
52+
reason="Skipping because environment is not below pypy 3.10",
53+
)
54+
def test_package_installed_below_pypy_3_10(self):
55+
assert is_package_installed(PACKAGE_NAME), f"{PACKAGE_NAME} should be installed in PyPy < 3.10 environment."

sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_persistent_locals.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import importlib
2+
import platform
23
import re
34
import sys
45
from importlib import reload
@@ -64,7 +65,8 @@ def mock_function_multi_return_expected(__self, mock_arg):
6465
@pytest.mark.unittest
6566
@pytest.mark.pipeline_test
6667
@pytest.mark.skipif(
67-
condition=sys.version_info >= (3, 13), reason="historical implementation doesn't support Python 3.13+"
68+
condition=sys.version_info >= (3, 13) or platform.python_implementation() == "PyPy",
69+
reason="historical implementation doesn't support Python 3.13+, and relies on CPython bytecode optimization; PyPy does not support required opcodes",
6870
)
6971
class TestPersistentLocalsProfiler:
7072
@classmethod

sdk/ml/azure-ai-ml/tests/internal_utils/unittests/test_telemetry_value.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Copyright (c) Microsoft Corporation. All rights reserved.
33
# ---------------------------------------------------------
44
import os
5+
import platform
56
from unittest.mock import patch
67

78
import pytest
@@ -100,6 +101,10 @@ def test_pipeline_telemetry_value(self):
100101
assert v["node_type"] == '{"automl": 1}'
101102
assert v["node_source"] == '{"BUILDER": 1}'
102103

104+
@pytest.mark.skipif(
105+
platform.python_implementation() == "PyPy",
106+
reason="Test relies on CPython-specific bytecode optimization and is not intended for PyPy",
107+
)
103108
def test_dsl_pipeline_telemetry_value(self):
104109
path = "./tests/test_configs/components/helloworld_component.yml"
105110

@@ -117,6 +122,10 @@ def pipeline_no_arg():
117122
assert v["node_source"] == '{"YAML.COMPONENT": 1}'
118123

119124
@patch.dict(os.environ, {AZUREML_PRIVATE_FEATURES_ENV_VAR: "True"})
125+
@pytest.mark.skipif(
126+
platform.python_implementation() == "PyPy",
127+
reason="Relies on CPython bytecode optimization; PyPy does not support required opcodes",
128+
)
120129
def test_dsl_subpipeline_telemetry_value(self):
121130
path = "./tests/test_configs/components/helloworld_component.yml"
122131
component_func1 = load_component(path)

sdk/ml/azure-ai-ml/tests/job_common/unittests/test_job_operations.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import json
22
import os
3+
import platform
34
from unittest.mock import Mock, patch
45

56
import jwt
@@ -155,6 +156,10 @@ def test_get(self, mock_method, mock_job_operation: JobOperations) -> None:
155156
# use mock_component_hash to avoid passing a Mock object as client key
156157
@pytest.mark.usefixtures("mock_component_hash")
157158
@patch.object(JobOperations, "_get_job")
159+
@pytest.mark.skipif(
160+
platform.python_implementation() == "PyPy",
161+
reason="Relies on CPython bytecode optimization; PyPy does not support required opcodes",
162+
)
158163
def test_get_job(self, mock_method, mock_job_operation: JobOperations) -> None:
159164
from azure.ai.ml import Input, dsl, load_component
160165

sdk/ml/azure-ai-ml/tests/pipeline_job/unittests/test_pipeline_job_entity.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import platform
23
from pathlib import Path
34

45
import pydash
@@ -2020,6 +2021,10 @@ def test_pipeline_node_with_identity(self):
20202021
},
20212022
}
20222023

2024+
@pytest.mark.skipif(
2025+
platform.python_implementation() == "PyPy",
2026+
reason="Relies on CPython bytecode optimization; PyPy does not support required opcodes",
2027+
)
20232028
def test_pipeline_parameter_with_empty_value(self, client: MLClient) -> None:
20242029
input_types_func = load_component(source="./tests/test_configs/components/input_types_component.yml")
20252030

@@ -2057,6 +2062,10 @@ def empty_value_pipeline(
20572062
assert "number" in rest_obj.properties.inputs
20582063
assert "str_param" in rest_obj.properties.inputs
20592064

2065+
@pytest.mark.skipif(
2066+
platform.python_implementation() == "PyPy",
2067+
reason="Relies on CPython bytecode optimization; PyPy does not support required opcodes",
2068+
)
20602069
def test_pipeline_input_as_runsettings_value(self, client: MLClient) -> None:
20612070
input_types_func = load_component(source="./tests/test_configs/components/input_types_component.yml")
20622071

@@ -2103,6 +2112,10 @@ def test_pipeline_job_automl_with_job_tier_in_pipeline(self) -> None:
21032112
rest_obj = pipeline_job._to_rest_object()
21042113
assert rest_obj.properties.jobs["text_ner_node"]["queue_settings"] == {"job_tier": "spot"}
21052114

2115+
@pytest.mark.skipif(
2116+
platform.python_implementation() == "PyPy",
2117+
reason="Relies on CPython bytecode optimization; PyPy does not support required opcodes",
2118+
)
21062119
def test_pipeline_with_duplicate_output(self) -> None:
21072120
component_path = "./tests/test_configs/components/helloworld_component.yml"
21082121
comp_func = load_component(source=component_path)
@@ -2195,6 +2208,10 @@ def test_pipeline_job_with_data_binding_expression_on_spark_resource(self, mock_
21952208
"runtime_version": "3.4.0",
21962209
}
21972210

2211+
@pytest.mark.skipif(
2212+
platform.python_implementation() == "PyPy",
2213+
reason="Relies on CPython bytecode optimization; PyPy does not support required opcodes",
2214+
)
21982215
def test_local_input_in_pipeline_job(self, client: MLClient, tmp_path: Path):
21992216
file_path = tmp_path / "mock_input_file"
22002217
file_path.touch(exist_ok=True)

0 commit comments

Comments
 (0)