Skip to content
Myr

drop support for python 3.7 (#2588)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by David Lord · committed by GitHub · parents 77dc47f, 61ee580 · Browse files · 17 files+20 added−34 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

17 files+20 added−34 removed

  • other:+20 added−34 removed

17 files+20 added−34 removed

modified:.github/workflows/tests.yaml-1 removed
modified:examples/aliases/pyproject.toml+1 added-1 removed
modified:examples/colors/pyproject.toml+1 added-1 removed
modified:examples/completion/pyproject.toml+1 added-1 removed
modified:examples/complex/pyproject.toml+1 added-1 removed
modified:examples/imagepipe/pyproject.toml+1 added-1 removed
modified:examples/inout/pyproject.toml+1 added-1 removed
modified:examples/naval/pyproject.toml+1 added-1 removed
modified:examples/repo/pyproject.toml+1 added-1 removed
1[project]2name = "click-example-repo"3version = "1.0.0"4description = "Click repo example"5requires-python = ">=3.7"5requires-python = ">=3.8"6dependencies = [7 "click>=8.1",8]9
9 unmodified lines
modified:examples/termui/pyproject.toml+1 added-1 removed
1[project]2name = "click-example-termui"3version = "1.0.0"4description = "Click termui example"5requires-python = ">=3.7"5requires-python = ">=3.8"6dependencies = [7 "click>=8.1",8]9
9 unmodified lines
modified:examples/validation/pyproject.toml+1 added-1 removed
1[project]2name = "click-example-validation"3version = "1.0.0"4description = "Click validation example"5requires-python = ">=3.7"5requires-python = ">=3.8"6dependencies = [7 "click>=8.1",8]9
9 unmodified lines
modified:src/click/decorators.py+4 added-12 removed
1import inspect2import types2import typing as t3from functools import update_wrapper4from gettext import gettext as _5
422 unmodified lines
428 number and exits the program.429430 If ``version`` is not provided, Click will try to detect it using431 :func:`importlib.metadata.version` to get the version for the433 ``package_name``. On Python < 3.8, the ``importlib_metadata``434 backport must be installed.432 ``package_name``.433434 If ``package_name`` is not provided, Click will try to detect it by435 inspecting the stack frames. This will be used to detect the436 version, so it must match the name of the installed package.
52 unmodified lines
489 if prog_name is None:490 prog_name = ctx.find_root().info_name491492 if version is None and package_name is not None:495 metadata: t.Optional[types.ModuleType]493 import importlib.metadata494495 try:498 from importlib import metadata # type: ignore499 except ImportError:500 # Python < 3.8501 import importlib_metadata as metadata # type: ignore502503 try:504 version = metadata.version(package_name) # type: ignore505 except metadata.PackageNotFoundError: # type: ignore496 version = importlib.metadata.version(package_name)497 except importlib.metadata.PackageNotFoundError:498 raise RuntimeError(499 f"{package_name!r} is not installed. Try passing"500 " 'package_name' instead."501 ) from None
52 unmodified lines
modified:src/click/types.py+1 added-5 removed
860 unmodified lines
861 is_dash = self.file_okay and self.allow_dash and rv in (b"-", "-")862863 if not is_dash:864 if self.resolve_path:865 # os.path.realpath doesn't resolve symlinks on Windows866 # until Python 3.8. Use pathlib for now.867 import pathlib865 rv = os.path.realpath(rv)866869 rv = os.fsdecode(pathlib.Path(rv).resolve())870867 try:868 st = os.stat(rv)869 except OSError:870 if not self.exists:
215 unmodified lines
modified:.pre-commit-config.yaml+1 added-1 removed
4 unmodified lines
5 - repo: https://github.com/asottile/pyupgrade6 rev: v3.10.17 hooks:8 - id: pyupgrade9 args: ["--py37-plus"]9 args: ["--py38-plus"]10 - repo: https://github.com/asottile/reorder-python-imports11 rev: v3.10.012 hooks:13 - id: reorder-python-imports
18 unmodified lines
modified:CHANGES.rst+1 added
3 unmodified lines
4-------------56Unreleased78- Drop support for Python 3.7. :pr:`2588`9- Use modern packaging metadata with ``pyproject.toml`` instead of ``setup.cfg``.10 :pr:`326`11- Use ``flit_core`` instead of ``setuptools`` as build backend.12
1105 unmodified lines
modified:pyproject.toml+2 added-4 removed
9 unmodified lines
10 "License :: OSI Approved :: BSD License",11 "Operating System :: OS Independent",12 "Programming Language :: Python",13]14requires-python = ">=3.7"14requires-python = ">=3.8"15dependencies = [16 "colorama; platform_system == 'Windows'",17 "importlib-metadata; python_version < '3.8'",17]18dynamic = ["version"]1920[project.urls]
35 unmodified lines
56[tool.coverage.paths]57source = ["src", "*/site-packages"]5859[tool.mypy]61python_version = "3.7"60python_version = "3.8"61files = ["src/click"]62show_error_codes = true63pretty = true64strict = true
2 unmodified lines
6768[[tool.mypy.overrides]]69module = [70 "colorama.*",72 "importlib_metadata.*"71]72ignore_missing_imports = true
modified:tox.ini+1 added-1 removed
1[tox]2envlist =3 py3{12,11,10,9,8,7}3 py3{12,11,10,9,8}4 pypy3105 style6 typing7 docs
23 unmodified lines