drop support for python 3.7
Before adoption: this commit came in with the history the project adopted, so no landing records it.
authored by David Lord · committed by David Lord · parent 77dc47f · 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
Provenance
- Commit
61ee580- Tree
81de3de- Author
David Lord <davidism@gmail.com>- Committer
David Lord <davidism@gmail.com>- Parent
77dc47f
17 files changed+20 added−34 removed
modified:.github/workflows/tests.yaml-1 removed
29 unmodified lines30313233343435363713 unmodified lines29 unmodified lines - {name: '3.12-dev', python: '3.12-dev', os: ubuntu-latest, tox: py312} - {name: '3.10', python: '3.10', os: ubuntu-latest, tox: py310} - {name: '3.9', python: '3.9', os: ubuntu-latest, tox: py39} - {name: '3.8', python: '3.8', os: ubuntu-latest, tox: py38} - {name: '3.7', python: '3.7', os: ubuntu-latest, tox: py37} - {name: 'PyPy', python: 'pypy-3.10', os: ubuntu-latest, tox: pypy310} - {name: Typing, python: '3.11', os: ubuntu-latest, tox: typing} steps: - uses: actions/checkout@c85c95e3d7251135ab7dc9ce3241c5835cc595a913 unmodified linesmodified:examples/aliases/pyproject.toml+1 added-1 removed
12345567899 unmodified lines[project]name = "click-example-aliases"version = "1.0.0"description = "Click aliases example"requires-python = ">=3.7"requires-python = ">=3.8"dependencies = [ "click>=8.1",]
9 unmodified linesmodified:examples/colors/pyproject.toml+1 added-1 removed
12345567899 unmodified lines[project]name = "click-example-colors"version = "1.0.0"description = "Click colors example"requires-python = ">=3.7"requires-python = ">=3.8"dependencies = [ "click>=8.1",]
9 unmodified linesmodified:examples/completion/pyproject.toml+1 added-1 removed
12345567899 unmodified lines[project]name = "click-example-completion"version = "1.0.0"description = "Click completion example"requires-python = ">=3.7"requires-python = ">=3.8"dependencies = [ "click>=8.1",]
9 unmodified linesmodified:examples/complex/pyproject.toml+1 added-1 removed
12345567899 unmodified lines[project]name = "click-example-complex"version = "1.0.0"description = "Click complex example"requires-python = ">=3.7"requires-python = ">=3.8"dependencies = [ "click>=8.1",]
9 unmodified linesmodified:examples/imagepipe/pyproject.toml+1 added-1 removed
123455678910 unmodified lines[project]name = "click-example-imagepipe"version = "1.0.0"description = "Click imagepipe example"requires-python = ">=3.7"requires-python = ">=3.8"dependencies = [ "click>=8.1", "pillow",]10 unmodified linesmodified:examples/inout/pyproject.toml+1 added-1 removed
12345567899 unmodified lines[project]name = "click-example-inout"version = "1.0.0"description = "Click inout example"requires-python = ">=3.7"requires-python = ">=3.8"dependencies = [ "click>=8.1",]
9 unmodified linesmodified:examples/naval/pyproject.toml+1 added-1 removed
12345567899 unmodified lines[project]name = "click-example-naval"version = "1.0.0"description = "Click naval example"requires-python = ">=3.7"requires-python = ">=3.8"dependencies = [ "click>=8.1",]
9 unmodified linesmodified:examples/repo/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-repo"3 version = "1.0.0"4 description = "Click repo example"5-requires-python = ">=3.7"5+requires-python = ">=3.8"6 dependencies = [7 "click>=8.1",8 ]9 9 unmodified linesmodified:examples/termui/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-termui"3 version = "1.0.0"4 description = "Click termui example"5-requires-python = ">=3.7"5+requires-python = ">=3.8"6 dependencies = [7 "click>=8.1",8 ]9 9 unmodified linesmodified:examples/validation/pyproject.toml+1 added-1 removed
1 [project]2 name = "click-example-validation"3 version = "1.0.0"4 description = "Click validation example"5-requires-python = ">=3.7"5+requires-python = ">=3.8"6 dependencies = [7 "click>=8.1",8 ]9 9 unmodified linesmodified:src/click/decorators.py+4 added-12 removed
1 import inspect2-import types2 import typing as t3 from functools import update_wrapper4 from gettext import gettext as _5 422 unmodified lines428 number and exits the program.429 430 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``.433 434 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 lines489 if prog_name is None:490 prog_name = ctx.find_root().info_name491 492 if version is None and package_name is not None:495- metadata: t.Optional[types.ModuleType]493+ import importlib.metadata494 495 try:498- from importlib import metadata # type: ignore499- except ImportError:500- # Python < 3.8501- import importlib_metadata as metadata # type: ignore502-503- 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 None52 unmodified linesmodified:src/click/types.py+1 added-5 removed
860 unmodified lines861 is_dash = self.file_okay and self.allow_dash and rv in (b"-", "-")862 863 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)866 869- rv = os.fsdecode(pathlib.Path(rv).resolve())870-867 try:868 st = os.stat(rv)869 except OSError:870 if not self.exists:215 unmodified linesmodified:.pre-commit-config.yaml+1 added-1 removed
4 unmodified lines5 - 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-imports18 unmodified linesmodified:CHANGES.rst+1 added
3 unmodified lines4 -------------5 6 Unreleased7 8+- 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 linesmodified:pyproject.toml+2 added-4 removed
9 unmodified lines10 "License :: OSI Approved :: BSD License",11 "Operating System :: OS Independent",12 "Programming Language :: Python",13 ]14-requires-python = ">=3.7"14+requires-python = ">=3.8"15 dependencies = [16 "colorama; platform_system == 'Windows'",17- "importlib-metadata; python_version < '3.8'",17 ]18 dynamic = ["version"]19 20 [project.urls]35 unmodified lines56 [tool.coverage.paths]57 source = ["src", "*/site-packages"]58 59 [tool.mypy]61-python_version = "3.7"60+python_version = "3.8"61 files = ["src/click"]62 show_error_codes = true63 pretty = true64 strict = true2 unmodified lines67 68 [[tool.mypy.overrides]]69 module = [70 "colorama.*",72- "importlib_metadata.*"71 ]72 ignore_missing_imports = truemodified:tox.ini+1 added-1 removed
1 [tox]2 envlist =3- py3{12,11,10,9,8,7}3+ py3{12,11,10,9,8}4 pypy3105 style6 typing7 docs23 unmodified lines