drop support for Python 3.7 (#997)

This commit is contained in:
Zsolt Dollenstein 2023-08-26 12:42:12 +01:00 committed by GitHub
parent 43e21c8d71
commit cbfd9c30a3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 28 deletions

View file

@ -14,7 +14,7 @@ jobs:
fail-fast: false fail-fast: false
matrix: matrix:
os: [macos-latest, ubuntu-latest, windows-latest] os: [macos-latest, ubuntu-latest, windows-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] python-version: ["3.8", "3.9", "3.10", "3.11"]
steps: steps:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
with: with:

View file

@ -38,19 +38,10 @@ def add_slots(cls: Type[_T]) -> Type[_T]:
# Create the class. # Create the class.
qualname = getattr(cls, "__qualname__", None) qualname = getattr(cls, "__qualname__", None)
try:
# GenericMeta in py3.6 requires us to track __orig_bases__. This is fixed in py3.7 # pyre-fixme[9]: cls has type `Type[Variable[_T]]`; used as `_T`.
# by the removal of GenericMeta. We should just be able to use cls.__bases__ in the # pyre-fixme[19]: Expected 0 positional arguments.
# future. cls = type(cls)(cls.__name__, cls.__bases__, cls_dict)
bases = getattr(cls, "__orig_bases__", cls.__bases__)
# pyre-fixme[9]: cls has type `Type[Variable[_T]]`; used as `_T`.
# pyre-fixme[19]: Expected 0 positional arguments.
cls = type(cls)(cls.__name__, bases, cls_dict)
except TypeError:
# We're in py3.7 and should use cls.__bases__
# pyre-fixme[9]: cls has type `Type[Variable[_T]]`; used as `_T`.
# pyre-fixme[19]: Expected 0 positional arguments.
cls = type(cls)(cls.__name__, cls.__bases__, cls_dict)
if qualname is not None: if qualname is not None:
cls.__qualname__ = qualname cls.__qualname__ = qualname

View file

@ -6,19 +6,17 @@ name = "libcst"
description = "A concrete syntax tree with AST-like properties for Python 3.5, 3.6, 3.7, 3.8, 3.9, and 3.10 programs." description = "A concrete syntax tree with AST-like properties for Python 3.5, 3.6, 3.7, 3.8, 3.9, and 3.10 programs."
readme = "README.rst" readme = "README.rst"
dynamic = ["version"] dynamic = ["version"]
license = {file="LICENSE"} license = { file = "LICENSE" }
classifiers = [ classifiers = [
"License :: OSI Approved :: MIT License", "License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.11",
] ]
requires-python = ">=3.7" requires-python = ">=3.8"
dependencies = [ dependencies = [
"dataclasses>=0.6.0; python_version < '3.7'",
"typing_extensions>=3.7.4.2", "typing_extensions>=3.7.4.2",
"typing_inspect>=0.4.0", "typing_inspect>=0.4.0",
"pyyaml>=5.2", "pyyaml>=5.2",
@ -54,18 +52,15 @@ Github = "https://github.com/Instagram/LibCST"
Changelog = "https://github.com/Instagram/LibCST/blob/main/CHANGELOG.md" Changelog = "https://github.com/Instagram/LibCST/blob/main/CHANGELOG.md"
[tool.black] [tool.black]
target-version = ["py37"] target-version = ["py38"]
extend-exclude = '^/native/' # Prepend "^/" to specify root file/folder. See https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-format extend-exclude = '^/native/' # Prepend "^/" to specify root file/folder. See https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-format
[tool.hatch.envs.default] [tool.hatch.envs.default]
features = ["dev"] features = ["dev"]
[tool.hatch.envs.default.scripts] [tool.hatch.envs.default.scripts]
docs = "sphinx-build -ab html docs/source docs/build" docs = "sphinx-build -ab html docs/source docs/build"
fixtures = [ fixtures = ["python scripts/regenerate-fixtures.py", "git diff --exit-code"]
"python scripts/regenerate-fixtures.py",
"git diff --exit-code",
]
format = "ufmt format libcst scripts" format = "ufmt format libcst scripts"
lint = [ lint = [
"flake8 libcst", "flake8 libcst",
@ -74,10 +69,7 @@ lint = [
"python scripts/check_copyright.py", "python scripts/check_copyright.py",
] ]
test = "python -m libcst.tests" test = "python -m libcst.tests"
typecheck = [ typecheck = ["pyre --version", "pyre check"]
"pyre --version",
"pyre check",
]
[tool.slotscheck] [tool.slotscheck]
exclude-modules = '^libcst\.(testing|tests)' exclude-modules = '^libcst\.(testing|tests)'