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:
albanD
2025-07-22 23:58:55 +00:00
committed by PyTorch MergeBot
parent cab96b5879
commit d3f9107d68
2 changed files with 54 additions and 54 deletions

View File

@ -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

View File

@ -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 []