diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 4d9ba0be1..d062113ed 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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: diff --git a/libcst/_add_slots.py b/libcst/_add_slots.py index bbe2c6343..7012ce1ad 100644 --- a/libcst/_add_slots.py +++ b/libcst/_add_slots.py @@ -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 diff --git a/pyproject.toml b/pyproject.toml index 59ce26022..abec5ac81 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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)'