Skip to content

Commit

Permalink
drop support for Python 3.7 (#997)
Browse files Browse the repository at this point in the history
  • Loading branch information
zsol authored Aug 26, 2023
1 parent 43e21c8 commit cbfd9c3
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
17 changes: 4 additions & 13 deletions libcst/_add_slots.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
20 changes: 6 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand All @@ -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)'
Expand Down

0 comments on commit cbfd9c3

Please sign in to comment.