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
matrix:
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:
- uses: actions/checkout@v3
with:

View file

@ -38,16 +38,7 @@ def add_slots(cls: Type[_T]) -> Type[_T]:
# Create the class.
qualname = getattr(cls, "__qualname__", None)
try:
# GenericMeta in py3.6 requires us to track __orig_bases__. This is fixed in py3.7
# by the removal of GenericMeta. We should just be able to use cls.__bases__ in the
# future.
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)

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."
readme = "README.rst"
dynamic = ["version"]
license = {file="LICENSE"}
license = { file = "LICENSE" }
classifiers = [
"License :: OSI Approved :: MIT License",
"Topic :: Software Development :: Libraries",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
requires-python = ">=3.7"
requires-python = ">=3.8"
dependencies = [
"dataclasses>=0.6.0; python_version < '3.7'",
"typing_extensions>=3.7.4.2",
"typing_inspect>=0.4.0",
"pyyaml>=5.2",
@ -54,7 +52,7 @@ Github = "https://github.com/Instagram/LibCST"
Changelog = "https://github.com/Instagram/LibCST/blob/main/CHANGELOG.md"
[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
[tool.hatch.envs.default]
@ -62,10 +60,7 @@ features = ["dev"]
[tool.hatch.envs.default.scripts]
docs = "sphinx-build -ab html docs/source docs/build"
fixtures = [
"python scripts/regenerate-fixtures.py",
"git diff --exit-code",
]
fixtures = ["python scripts/regenerate-fixtures.py", "git diff --exit-code"]
format = "ufmt format libcst scripts"
lint = [
"flake8 libcst",
@ -74,10 +69,7 @@ lint = [
"python scripts/check_copyright.py",
]
test = "python -m libcst.tests"
typecheck = [
"pyre --version",
"pyre check",
]
typecheck = ["pyre --version", "pyre check"]
[tool.slotscheck]
exclude-modules = '^libcst\.(testing|tests)'