Skip to content

Commit f76c3ae

Browse files
remove mgmt from typing exclusion filter (Azure#38963)
* remove mgmt from mypy global exclusion * touch mgmt code to trigger pipeline * Revert "touch mgmt code to trigger pipeline" This reverts commit c95a4a8. * update mypy and pyright to run on generated_samples dir * redefine filter for health status script * test mgmt * Revert "test mgmt" This reverts commit e140847. * mccoy feedback
1 parent a617d6e commit f76c3ae

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

eng/tox/run_mypy.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,9 @@
8080
)
8181
else:
8282
# check if samples dir exists, if not, skip sample code check
83-
if not os.path.exists(os.path.join(args.target_package, "samples")):
83+
samples = os.path.exists(os.path.join(args.target_package, "samples"))
84+
generated_samples = os.path.exists(os.path.join(args.target_package, "generated_samples"))
85+
if not samples and not generated_samples:
8486
logging.info(
8587
f"Package {package_name} does not have a samples directory."
8688
)
@@ -89,7 +91,7 @@
8991
*commands,
9092
"--check-untyped-defs",
9193
"--follow-imports=silent",
92-
os.path.join(args.target_package, "samples")
94+
os.path.join(args.target_package, "samples" if samples else "generated_samples"),
9395
]
9496
try:
9597
logging.info(

eng/tox/run_pyright.py

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,15 +91,22 @@ def get_pyright_config_path(args):
9191
top_level_module = pkg_details.namespace.split(".")[0]
9292
paths = [
9393
os.path.join(args.target_package, top_level_module),
94-
os.path.join(args.target_package, "samples"),
9594
]
96-
97-
if not args.next and in_ci():
98-
if not is_check_enabled(args.target_package, "type_check_samples"):
95+
if not args.next and in_ci() and not is_check_enabled(args.target_package, "type_check_samples"):
96+
logging.info(
97+
f"Package {package_name} opts-out of pyright check on samples."
98+
)
99+
else:
100+
# check if samples dir exists, if not, skip sample code check
101+
samples = os.path.exists(os.path.join(args.target_package, "samples"))
102+
generated_samples = os.path.exists(os.path.join(args.target_package, "generated_samples"))
103+
if not samples and not generated_samples:
99104
logging.info(
100-
f"Package {package_name} opts-out of pyright check on samples."
105+
f"Package {package_name} does not have a samples directory."
101106
)
102-
paths = paths[:-1]
107+
else:
108+
paths.append(os.path.join(args.target_package, "samples" if samples else "generated_samples"))
109+
103110

104111
pyright_config_path = get_pyright_config_path(args)
105112

scripts/repo_health_status_report/output_health_report.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,8 @@
2727
IGNORE_PACKAGES,
2828
FILTER_EXCLUSIONS,
2929
)
30-
30+
IGNORE_FILTER.append("mgmt")
31+
FILTER_EXCLUSIONS.append("azure-mgmt-core")
3132
IGNORE_PACKAGES.append("azure-openai")
3233

3334
# Github

tools/azure-sdk-tools/ci_tools/environment_exclusions.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
# For CI exclusion of type checks, look into adding a pyproject.toml, as indicated in the `The pyproject.toml` section
1616
# of `.doc/eng_sys_checks.md`.
1717

18-
IGNORE_FILTER = ["nspkg", "mgmt", "cognitiveservices"]
19-
FILTER_EXCLUSIONS = ["azure-mgmt-core"]
18+
IGNORE_FILTER = ["nspkg", "cognitiveservices"]
19+
FILTER_EXCLUSIONS = []
2020
IGNORE_PACKAGES = [
2121
"azure-applicationinsights",
2222
"azure-servicemanagement-legacy",

0 commit comments

Comments
 (0)