Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove mgmt from typing exclusion filter #38963

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
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
6 changes: 4 additions & 2 deletions eng/tox/run_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,9 @@
)
else:
# check if samples dir exists, if not, skip sample code check
if not os.path.exists(os.path.join(args.target_package, "samples")):
samples = os.path.exists(os.path.join(args.target_package, "samples"))
generated_samples = os.path.exists(os.path.join(args.target_package, "generated_samples"))
if not samples and not generated_samples:
logging.info(
f"Package {package_name} does not have a samples directory."
)
Expand All @@ -89,7 +91,7 @@
*commands,
"--check-untyped-defs",
"--follow-imports=silent",
os.path.join(args.target_package, "samples")
os.path.join(args.target_package, "samples" if samples else "generated_samples"),
]
try:
logging.info(
Expand Down
19 changes: 13 additions & 6 deletions eng/tox/run_pyright.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,15 +91,22 @@ def get_pyright_config_path(args):
top_level_module = pkg_details.namespace.split(".")[0]
paths = [
os.path.join(args.target_package, top_level_module),
os.path.join(args.target_package, "samples"),
]

if not args.next and in_ci():
if not is_check_enabled(args.target_package, "type_check_samples"):
if not args.next and in_ci() and not is_check_enabled(args.target_package, "type_check_samples"):
logging.info(
f"Package {package_name} opts-out of pyright check on samples."
)
else:
# check if samples dir exists, if not, skip sample code check
samples = os.path.exists(os.path.join(args.target_package, "samples"))
generated_samples = os.path.exists(os.path.join(args.target_package, "generated_samples"))
if not samples and not generated_samples:
logging.info(
f"Package {package_name} opts-out of pyright check on samples."
f"Package {package_name} does not have a samples directory."
)
paths = paths[:-1]
else:
paths.append(os.path.join(args.target_package, "samples" if samples else "generated_samples"))


pyright_config_path = get_pyright_config_path(args)

Expand Down
5 changes: 2 additions & 3 deletions scripts/repo_health_status_report/output_health_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,10 @@
from ci_tools.parsing import ParsedSetup
from ci_tools.environment_exclusions import (
is_check_enabled,
IGNORE_FILTER,
IGNORE_PACKAGES,
FILTER_EXCLUSIONS,
)

IGNORE_FILTER = ["nspkg", "mgmt", "cognitiveservices"]
FILTER_EXCLUSIONS = ["azure-mgmt-core"]
IGNORE_PACKAGES.append("azure-openai")

# Github
Expand Down
4 changes: 2 additions & 2 deletions tools/azure-sdk-tools/ci_tools/environment_exclusions.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
# For CI exclusion of type checks, look into adding a pyproject.toml, as indicated in the `The pyproject.toml` section
# of `.doc/eng_sys_checks.md`.

IGNORE_FILTER = ["nspkg", "mgmt", "cognitiveservices"]
FILTER_EXCLUSIONS = ["azure-mgmt-core"]
IGNORE_FILTER = ["nspkg", "cognitiveservices"]
FILTER_EXCLUSIONS = []
IGNORE_PACKAGES = [
"azure-applicationinsights",
"azure-servicemanagement-legacy",
Expand Down
Loading