mirror of
https://github.com/Instagram/LibCST.git
synced 2025-12-23 10:35:53 +00:00
drop support for Python 3.7 (#997)
This commit is contained in:
parent
43e21c8d71
commit
cbfd9c30a3
3 changed files with 11 additions and 28 deletions
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -38,19 +38,10 @@ 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)
|
||||
|
||||
# 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:
|
||||
cls.__qualname__ = qualname
|
||||
|
||||
|
|
|
|||
|
|
@ -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,18 +52,15 @@ Github = "https://github.com/Instagram/LibCST"
|
|||
Changelog = "https://github.com/Instagram/LibCST/blob/main/CHANGELOG.md"
|
||||
|
||||
[tool.black]
|
||||
target-version = ["py37"]
|
||||
extend-exclude = '^/native/' # Prepend "^/" to specify root file/folder. See https://black.readthedocs.io/en/stable/usage_and_configuration/the_basics.html#configuration-format
|
||||
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]
|
||||
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)'
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue