mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 12:54:11 +08:00
Remove top limit for cpython version and fix lint appropriately. (#158853)
As per title. Sorry for the churn in the main commit. Pull Request resolved: https://github.com/pytorch/pytorch/pull/158853 Approved by: https://github.com/seemethere, https://github.com/Skylion007, https://github.com/jingsh, https://github.com/malfet, https://github.com/ZainRizvi
This commit is contained in:
@ -20,7 +20,7 @@ build-backend = "setuptools.build_meta"
|
||||
name = "torch"
|
||||
description = "Tensors and Dynamic neural networks in Python with strong GPU acceleration"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.9,<3.14"
|
||||
requires-python = ">=3.9"
|
||||
# TODO: change to `license = "BSD-3-Clause"` and enable PEP 639 after pinning setuptools>=77
|
||||
# FIXME: As of 2025.06.20, it is hard to ensure the minimum version of setuptools in our CI environment.
|
||||
# TOML-table-based license deprecated in setuptools>=77, and the deprecation warning will be changed
|
||||
|
@ -128,16 +128,16 @@ def check_file(filename: str) -> list[LintMessage]:
|
||||
),
|
||||
)
|
||||
]
|
||||
if f"{python_major}.{large_minor}" in supported_python_versions:
|
||||
return [
|
||||
format_error_message(
|
||||
filename,
|
||||
message=(
|
||||
"'project.requires-python' must specify a maximum version, "
|
||||
f"but found {requires_python!r}."
|
||||
),
|
||||
)
|
||||
]
|
||||
# if f"{python_major}.{large_minor}" in supported_python_versions:
|
||||
# return [
|
||||
# format_error_message(
|
||||
# filename,
|
||||
# message=(
|
||||
# "'project.requires-python' must specify a maximum version, "
|
||||
# f"but found {requires_python!r}."
|
||||
# ),
|
||||
# )
|
||||
# ]
|
||||
|
||||
classifiers = project.get("classifiers")
|
||||
if not (
|
||||
@ -158,49 +158,49 @@ def check_file(filename: str) -> list[LintMessage]:
|
||||
)
|
||||
]
|
||||
|
||||
python_version_classifiers = [
|
||||
c
|
||||
for c in classifiers
|
||||
if (
|
||||
c.startswith("Programming Language :: Python :: ")
|
||||
and not c.endswith((f":: {python_major}", f":: {python_major} :: Only"))
|
||||
)
|
||||
]
|
||||
if python_version_classifiers:
|
||||
python_version_classifier_set = set(python_version_classifiers)
|
||||
supported_python_version_classifier_set = {
|
||||
f"Programming Language :: Python :: {v}"
|
||||
for v in supported_python_versions
|
||||
}
|
||||
if python_version_classifier_set != supported_python_version_classifier_set:
|
||||
missing_classifiers = sorted(
|
||||
supported_python_version_classifier_set
|
||||
- python_version_classifier_set
|
||||
)
|
||||
extra_classifiers = sorted(
|
||||
python_version_classifier_set
|
||||
- supported_python_version_classifier_set
|
||||
)
|
||||
if missing_classifiers:
|
||||
return [
|
||||
format_error_message(
|
||||
filename,
|
||||
message=(
|
||||
"'project.classifiers' is missing the following classifier(s):\n"
|
||||
+ "\n".join(f" {c!r}" for c in missing_classifiers)
|
||||
),
|
||||
)
|
||||
]
|
||||
if extra_classifiers:
|
||||
return [
|
||||
format_error_message(
|
||||
filename,
|
||||
message=(
|
||||
"'project.classifiers' contains extra classifier(s):\n"
|
||||
+ "\n".join(f" {c!r}" for c in extra_classifiers)
|
||||
),
|
||||
)
|
||||
]
|
||||
# python_version_classifiers = [
|
||||
# c
|
||||
# for c in classifiers
|
||||
# if (
|
||||
# c.startswith("Programming Language :: Python :: ")
|
||||
# and not c.endswith((f":: {python_major}", f":: {python_major} :: Only"))
|
||||
# )
|
||||
# ]
|
||||
# if python_version_classifiers:
|
||||
# python_version_classifier_set = set(python_version_classifiers)
|
||||
# supported_python_version_classifier_set = {
|
||||
# f"Programming Language :: Python :: {v}"
|
||||
# for v in supported_python_versions
|
||||
# }
|
||||
# if python_version_classifier_set != supported_python_version_classifier_set:
|
||||
# missing_classifiers = sorted(
|
||||
# supported_python_version_classifier_set
|
||||
# - python_version_classifier_set
|
||||
# )
|
||||
# extra_classifiers = sorted(
|
||||
# python_version_classifier_set
|
||||
# - supported_python_version_classifier_set
|
||||
# )
|
||||
# if missing_classifiers:
|
||||
# return [
|
||||
# format_error_message(
|
||||
# filename,
|
||||
# message=(
|
||||
# "'project.classifiers' is missing the following classifier(s):\n"
|
||||
# + "\n".join(f" {c!r}" for c in missing_classifiers)
|
||||
# ),
|
||||
# )
|
||||
# ]
|
||||
# if extra_classifiers:
|
||||
# return [
|
||||
# format_error_message(
|
||||
# filename,
|
||||
# message=(
|
||||
# "'project.classifiers' contains extra classifier(s):\n"
|
||||
# + "\n".join(f" {c!r}" for c in extra_classifiers)
|
||||
# ),
|
||||
# )
|
||||
# ]
|
||||
|
||||
return []
|
||||
|
||||
|
Reference in New Issue
Block a user