Skip to content
Myr

drop end of life python versions (#2893)

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 f14b750, ba770cb · Browse files · 17 files+27 added−24 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+27 added−24 removed

  • tests:+2 added−2 removed
  • other:+25 added−22 removed

17 files+27 added−24 removed

modified:.github/workflows/tests.yaml+1 added-3 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.8"5requires-python = ">=3.10"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.8"5requires-python = ">=3.10"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.8"5requires-python = ">=3.10"6dependencies = [7 "click>=8.1",8]9
9 unmodified lines
modified:src/click/core.py+1 added-1 removed
88 unmodified lines
89 raise RuntimeError(message)909192def batch(iterable: cabc.Iterable[V], batch_size: int) -> list[tuple[V, ...]]:93 return list(zip(*repeat(iter(iterable), batch_size)))93 return list(zip(*repeat(iter(iterable), batch_size), strict=False))949596@contextmanager97def augment_usage_errors(
3037 unmodified lines
modified:src/click/types.py+4 added-2 removed
650 unmodified lines
651 def _clamp(self, bound: float, dir: t.Literal[1, -1], open: bool) -> float:652 if not open:653 return bound654655 # Could use Python 3.9's math.nextafter here, but clamping an655 # Could use math.nextafter here, but clamping an656 # open float range doesn't seem to be particularly useful. It's657 # left up to the user to write a callback to do it if needed.658 raise RuntimeError("Clamping is not supported for open bounds.")659
399 unmodified lines
1059 param=param,1060 ctx=ctx,1061 )10621063 return tuple(ty(x, param, ctx) for ty, x in zip(self.types, value))1063 return tuple(1064 ty(x, param, ctx) for ty, x in zip(self.types, value, strict=False)1065 )106610671068def convert_type(ty: t.Any | None, default: t.Any | None = None) -> ParamType:1069 """Find the most appropriate :class:`ParamType` for the given Python
96 unmodified lines
modified:tests/test_utils.py+2 added-2 removed
572 unmodified lines
573 expected = list(map(str, range(10)))574 p = tmpdir.mkdir("testdir").join("testfile")575 p.write("\n".join(expected))576 with p.open() as f:577 for e_line, a_line in zip(expected, click.utils.KeepOpenFile(f)):577 for e_line, a_line in zip(expected, click.utils.KeepOpenFile(f), strict=False):578 assert e_line == a_line.strip()579580581def test_iter_lazyfile(tmpdir):
1 unmodified line
583 p = tmpdir.mkdir("testdir").join("testfile")584 p.write("\n".join(expected))585 with p.open() as f:586 with click.utils.LazyFile(f.name) as lf:587 for e_line, a_line in zip(expected, lf):587 for e_line, a_line in zip(expected, lf, strict=False):588 assert e_line == a_line.strip()589590591class MockMain:
67 unmodified lines
modified:CHANGES.rst+1 added-1 removed
3 unmodified lines
4-------------56Released 2025-03-2678- Drop support for Python 3.7. :pr:`2588`8- Drop support for Python 3.7, 3.8, and 3.9. :pr:`2588` :pr:`2892`9- Use modern packaging metadata with ``pyproject.toml`` instead of ``setup.cfg``.10 :pr:`2438`11- Use ``flit_core`` instead of ``setuptools`` as build backend. :pr:`2543`12- Deprecate the ``__version__`` attribute. Use feature detection, or
1224 unmodified lines
modified:pyproject.toml+6 added-3 removed
11 unmodified lines
12 "Operating System :: OS Independent",13 "Programming Language :: Python",14 "Typing :: Typed",15]16requires-python = ">=3.8"16requires-python = ">=3.10"17dependencies = [18 "colorama; platform_system == 'Windows'",19]20
36 unmodified lines
57[tool.coverage.paths]58source = ["src", "*/site-packages"]5960[tool.mypy]61python_version = "3.8"61python_version = "3.10"62files = ["src/click", "tests/typing"]63show_error_codes = true64pretty = true65strict = true
4 unmodified lines
70]71ignore_missing_imports = true7273[tool.pyright]74pythonVersion = "3.8"74pythonVersion = "3.10"75include = ["src/click", "tests/typing"]76typeCheckingMode = "basic"7778[tool.ruff]
11 unmodified lines
90 "I", # isort91 "UP", # pyupgrade92 "W", # pycodestyle warning93]94ignore = [95 "UP038", # keep isinstance tuples96]9798[tool.ruff.lint.isort]99force-single-line = true100order-by-type = false
5 unmodified lines
modified:tox.ini+2 added-2 removed
1[tox]2envlist =3 py3{13,12,11,10,9,8}4 pypy3103 py3{13,12,11,10}4 pypy3115 style6 typing7 docs8skip_missing_interpreters = true
53 unmodified lines