Skip to content

Commit b3536b0

Browse files
scbeddlaiapat
andauthored
Apply suggestions from code review
Co-authored-by: McCoy Patiño <39780829+mccoyp@users.noreply.github.com>
1 parent 184eb82 commit b3536b0

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

eng/tox/verify_sdist.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,10 +156,10 @@ def verify_sdist_pytyped(
156156
if verify_sdist_pytyped(pkg_dir, pkg_details.namespace, pkg_details.package_data, pkg_details.include_package_data):
157157
logging.info(f"Py.typed setup.py kwargs are set properly: {pkg_details.name}")
158158
else:
159-
logging.error(f"Verified py.typed {pkg_details.name}. Check messages above.")
159+
logging.error(f"Py.typed verification failed for package {pkg_details.name}. Check messages above.")
160160
error_occurred = True
161161

162-
if pkg_details.name in EXCLUDED_CLASSIFICATION_PACKAGES and "-nspkg" not in pkg_details.name:
162+
if pkg_details.name not in EXCLUDED_CLASSIFICATION_PACKAGES and "-nspkg" not in pkg_details.name:
163163
logging.info(f"Verifying package classifiers: {pkg_details.name}")
164164

165165
status, message = verify_package_classifiers(pkg_details.name, pkg_details.version, pkg_details.classifiers)

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,7 @@ def verify_package_classifiers(package_name: str, package_version: str, package_
900900
:param str package_name: The name of the package being verified. Used for detail in the error response.
901901
:param str package_version: The version of the package being verified.
902902
:param List[str] package_classifiers: The classifiers of the package being verified.
903-
903+
:returns: A tuple, (x, y), where x is whether the package version matches its classifiers, and y is an error message or None.
904904
"""
905905

906906
dev_status = parse(package_version)
@@ -923,7 +923,7 @@ def verify_package_classifiers(package_name: str, package_version: str, package_
923923
# or Development Status :: 7 - Inactive
924924
num = int(c.split("::")[1].split("-")[0].strip())
925925
except (IndexError, ValueError):
926-
return False, f"{package_name} has version {package_version} and is a GA release, but failed to pull a status number from status '{c}'. Expecting format identical to 'Development Status :: 5 - Production'."
926+
return False, f"{package_name} has version {package_version} and is a GA release, but failed to pull a status number from status '{c}'. Expecting format identical to 'Development Status :: 5 - Production/Stable'."
927927
if num < 5:
928-
return False, f"{package_name} has version {package_version} and is a GA release, but had development status '{c}'. Expecting a development classifier that is equal or greater than 'Development Status :: 5 - Production'."
928+
return False, f"{package_name} has version {package_version} and is a GA release, but had development status '{c}'. Expecting a development classifier that is equal or greater than 'Development Status :: 5 - Production/Stable'."
929929
return True, None

tools/azure-sdk-tools/tests/test_classifier_checks.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"package_name, package_version, package_classifiers, expected_result",
88
[
99
("a", "1.0.0", ["Development Status :: 4 - Beta"], False),
10-
("b", "1.0.0", ["Development Status :: 5 - Production"], True),
10+
("b", "1.0.0", ["Development Status :: 5 - Production/Stable"], True),
1111
("b", "1.0.0a1", ["Development Status :: 5 - Production"], False),
1212
("b", "1.0.0a1", ["Development Status :: 4 - Beta"], True),
1313
("c", "1.0.0b1", ["Development Status :: 4 - Beta"], True),

0 commit comments

Comments
 (0)