Skip to content

Commit 946006d

Browse files
committed
Remove Python 3.7 support and update CI
1 parent 0c10f67 commit 946006d

File tree

10 files changed

+79
-111
lines changed

10 files changed

+79
-111
lines changed

.github/workflows/build-docs.yml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,18 +18,19 @@ jobs:
1818
uses: actions/checkout@v4
1919

2020
- name: Set up Python
21-
uses: actions/setup-python@v4
21+
uses: astral-sh/setup-uv@v4
2222
with:
2323
python-version: 3.x
2424

2525
- name: Install requirements for docs
2626
run: |
27-
pip install -U uv
28-
uv pip install --system --editable ".[docs]"
27+
uv pip install --editable ".[docs]"
2928
3029
- name: Generate terminal images with rich-codex
3130
uses: ewels/rich-codex@v1
3231
with:
32+
use_uv: "true"
33+
skip_python_setup: "true"
3334
commit_changes: "true"
3435
clean_img_paths: docs/images/*.svg
3536
skip_git_checks: "true"

.github/workflows/deploy-pypi.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@ on:
55

66
jobs:
77
build-n-publish:
8+
if: github.repository == 'ewels/rich-click'
89
runs-on: ubuntu-latest
9-
1010
steps:
11-
- uses: actions/checkout@v3
11+
- uses: actions/checkout@v4
1212
name: Check out source-code repository
1313

1414
- name: Set up Python
15-
uses: actions/setup-python@v3
15+
uses: actions/setup-python@v5
1616
with:
17-
python-version: "3.11"
17+
python-version: "3.13"
1818

1919
- name: Install python dependencies
2020
run: python -m pip install --upgrade pip setuptools wheel build
@@ -23,7 +23,6 @@ jobs:
2323
run: python -m build
2424

2525
- name: Publish to PyPI
26-
if: github.repository == 'ewels/rich-click'
2726
uses: pypa/gh-action-pypi-publish@release/v1
2827
with:
2928
password: ${{ secrets.PYPI_API_TOKEN }}

.github/workflows/pre-commit.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,10 @@ jobs:
88
runs-on: ubuntu-latest
99
steps:
1010
- uses: actions/checkout@v4
11-
- uses: actions/setup-python@v4
11+
- uses: actions/setup-python@v5
1212
with:
13-
python-version: 3.x
13+
python-version: 3
1414
- name: Install dependencies
1515
run: |
16-
pip install -U uv
17-
uv pip install --system --editable ".[dev]"
18-
- uses: pre-commit/[email protected]
16+
pip install --editable ".[dev]"
17+
- uses: pre-commit-ci/[email protected]

.github/workflows/pytest.yml

Lines changed: 5 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,10 @@ jobs:
55
runs-on: ubuntu-22.04
66
strategy:
77
matrix:
8-
python: [3.7, 3.12, 3.13]
8+
python: [3.8, 3.12, 3.13]
99
click: [7.0.*, 7.1.*, 8.0.*, 8.1.*] # 8.2.*
1010
rich: [12.*, 13.*]
1111
exclude:
12-
# - python: 3.7
13-
# click: 8.2.*
1412
- python: 3.13
1513
click: 7.0.*
1614
- python: 3.13
@@ -20,27 +18,15 @@ jobs:
2018
uses: actions/checkout@v4
2119

2220
- name: Set up Python
23-
uses: actions/setup-python@v4
21+
uses: astral-sh/setup-uv@v5
2422
with:
2523
python-version: ${{ matrix.python }}
2624

2725
- name: Install dependencies
28-
if: matrix.python != '3.7'
2926
run: |
30-
pip install -U uv
31-
uv pip install --system --editable ".[dev]"
32-
uv pip install --system --upgrade "click==$CLICK_VERSION" --prerelease=allow
33-
uv pip install --system --upgrade "rich==$RICH_VERSION" --prerelease=allow
34-
env:
35-
CLICK_VERSION: ${{ matrix.click }}
36-
RICH_VERSION: ${{ matrix.rich }}
37-
38-
- name: Install dependencies (Python 3.7)
39-
if: matrix.python == '3.7'
40-
run: |
41-
pip install --editable ".[dev]"
42-
pip install --upgrade "click==$CLICK_VERSION"
43-
pip install --upgrade "rich==$RICH_VERSION"
27+
uv pip install --editable ".[dev]"
28+
uv pip install --upgrade "click==$CLICK_VERSION" --prerelease=allow
29+
uv pip install --upgrade "rich==$RICH_VERSION" --prerelease=allow
4430
env:
4531
CLICK_VERSION: ${{ matrix.click }}
4632
RICH_VERSION: ${{ matrix.rich }}

.github/workflows/rich-codex.yml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ on:
77

88
jobs:
99
rich_codex:
10-
if: github.repository_owner == 'ewels'
10+
if: github.repository_owner == 'ewels' || github.event_name == 'workflow_dispatch'
1111
runs-on: ubuntu-latest
1212
steps:
1313
- name: Check out the repo
1414
uses: actions/checkout@v4
1515

1616
- name: Set up Python
17-
uses: actions/setup-python@v4
17+
uses: astral-sh/setup-uv@v5
1818
with:
1919
python-version: 3.x
2020

@@ -24,6 +24,8 @@ jobs:
2424
- name: Generate terminal images with rich-codex
2525
uses: ewels/rich-codex@v1
2626
with:
27+
use_uv: "true"
28+
skip_python_setup: "true"
2729
commit_changes: "true"
2830
clean_img_paths: docs/images/*.svg
2931
terminal_width: 80

.github/workflows/test-examples.yml

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,21 @@ jobs:
55
runs-on: ubuntu-22.04
66
strategy:
77
matrix:
8-
python: [3.7, 3.11, 3.12]
8+
python: [3.8, 3.12, 3.13]
99
click: [7.0.*, 8.0.*, 8.1.*] # Skip click 7.1 since regression coverage is strictly higher in 7.0.
1010
steps:
1111
- name: Check out the repo
12-
uses: actions/checkout@v3
12+
uses: actions/checkout@v4
1313

1414
- name: Set up Python
15-
uses: actions/setup-python@v4
15+
uses: astral-sh/setup-uv@v5
1616
with:
1717
python-version: ${{ matrix.python }}
1818

1919
- name: Install dependencies
20-
if: matrix.python != '3.7'
2120
run: |
22-
pip install -U uv
23-
uv pip install --system --editable "."
24-
uv pip install --system --upgrade "click==$CLICK_VERSION"
25-
env:
26-
CLICK_VERSION: ${{ matrix.click }}
27-
28-
- name: Install dependencies (Python 3.7)
29-
if: matrix.python == '3.7'
30-
run: |
31-
pip install --editable "."
32-
pip install --upgrade "click==$CLICK_VERSION"
21+
uv pip install --editable "."
22+
uv pip install --upgrade "click==$CLICK_VERSION"
3323
env:
3424
CLICK_VERSION: ${{ matrix.click }}
3525

.pre-commit-config.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,25 @@ repos:
1313
# - id: prettier
1414

1515
- repo: https://github.com/rhysd/actionlint
16-
rev: v1.6.27
16+
rev: 03d0035246f3e81f36aed592ffb4bebf33a03106 # frozen: v1.7.7
1717
hooks:
1818
- id: actionlint
1919

2020
- repo: https://github.com/tox-dev/pyproject-fmt
21-
rev: 1.7.0
21+
rev: 57b6ff7bf72affdd12c7f3fd6de761ba18a33b3a # frozen: v2.5.1
2222
hooks:
2323
- id: pyproject-fmt
2424

2525
- repo: https://github.com/astral-sh/ruff-pre-commit
2626
# Ruff version.
27-
rev: v0.1.7
27+
rev: d119aaff6891558b6eaf52518386871d1d267131 # frozen: v0.11.6
2828
hooks:
2929
- id: ruff
30-
name: Ruff - Linter
30+
name: Ruff
3131
args: [--fix]
3232

3333
- repo: https://github.com/psf/black-pre-commit-mirror
34-
rev: 24.1.1
34+
rev: a4920527036bb9a3f3e6055d595849d67d0da066 # frozen: 25.1.0
3535
hooks:
3636
- id: black
3737
language_version: python3.12
@@ -49,7 +49,7 @@ repos:
4949
require_serial: true
5050

5151
- repo: https://github.com/codespell-project/codespell
52-
rev: v2.2.4
52+
rev: 63c8f8312b7559622c0d82815639671ae42132ac # frozen: v2.4.1
5353
hooks:
5454
- id: codespell
5555
files: ^docs/.*\.md$

pyproject.toml

Lines changed: 44 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,42 @@
1+
[build-system]
2+
build-backend = "setuptools.build_meta"
3+
requires = [
4+
"setuptools>=45",
5+
]
6+
17
[project]
28
name = "rich-click"
39
description = "Format click help output nicely with rich"
410
readme = "README.md"
511
license = { file = "LICENSE" }
6-
maintainers = [{ name = "Phil Ewels", email = "[email protected]" }, { name = "Daniel Reeves", email = "[email protected]"}]
7-
authors = [{ name = "Phil Ewels", email = "[email protected]" }]
8-
requires-python = ">=3.7"
12+
maintainers = [
13+
{ name = "Phil Ewels", email = "[email protected]" },
14+
{ name = "Daniel Reeves", email = "[email protected]" },
15+
]
16+
authors = [ { name = "Phil Ewels", email = "[email protected]" } ]
17+
requires-python = ">=3.8"
918
classifiers = [
1019
"Development Status :: 3 - Alpha",
1120
"Intended Audience :: Developers",
12-
"License :: OSI Approved :: MIT License",
1321
"Operating System :: OS Independent",
1422
"Programming Language :: Python",
1523
"Programming Language :: Python :: 3 :: Only",
16-
"Programming Language :: Python :: 3.7",
1724
"Programming Language :: Python :: 3.8",
1825
"Programming Language :: Python :: 3.9",
1926
"Programming Language :: Python :: 3.10",
2027
"Programming Language :: Python :: 3.11",
2128
"Programming Language :: Python :: 3.12",
29+
"Programming Language :: Python :: 3.13",
2230
]
2331
dynamic = [
2432
"version",
2533
]
2634
dependencies = [
2735
"click>=7",
28-
'importlib-metadata; python_version < "3.8"',
2936
"rich>=10.7",
30-
"typing_extensions>=4",
37+
"typing-extensions>=4",
3138
]
32-
[project.optional-dependencies]
33-
dev = [
39+
optional-dependencies.dev = [
3440
"mypy",
3541
"packaging",
3642
"pre-commit",
@@ -40,8 +46,8 @@ dev = [
4046
"ruff",
4147
"types-setuptools",
4248
]
43-
docs = [
44-
"markdown_include",
49+
optional-dependencies.docs = [
50+
"markdown-include",
4551
"mkdocs",
4652
"mkdocs-glightbox",
4753
"mkdocs-material[imaging]~=9.5.18",
@@ -50,40 +56,41 @@ docs = [
5056
"mkdocstrings[python]",
5157
"rich-codex",
5258
]
53-
[project.urls]
54-
Documentation = "https://github.com/ewels/rich-click"
55-
Homepage = "https://github.com/ewels/rich-click"
56-
Issues = "https://github.com/ewels/rich-click/issues"
57-
Repository = "https://github.com/ewels/rich-click"
58-
[project.scripts]
59-
rich-click = "rich_click.cli:main"
60-
61-
[build-system]
62-
build-backend = "setuptools.build_meta"
63-
requires = [
64-
"setuptools>=45",
65-
]
59+
urls.Documentation = "https://github.com/ewels/rich-click"
60+
urls.Homepage = "https://github.com/ewels/rich-click"
61+
urls.Issues = "https://github.com/ewels/rich-click/issues"
62+
urls.Repository = "https://github.com/ewels/rich-click"
63+
scripts.rich-click = "rich_click.cli:main"
6664

6765
[tool.setuptools.dynamic]
6866
version = { attr = "rich_click.__version__" }
6967

7068
[tool.black]
7169
line-length = 120
72-
target-version = ['py37']
70+
target-version = [ 'py37' ]
7371

7472
[tool.ruff]
73+
line-length = 120
7574
exclude = [
7675
".git",
77-
"__pycache__",
7876
".venv",
79-
"venv",
77+
"__pycache__",
8078
"build",
79+
"docs/",
80+
"examples/**",
8181
"sdist",
8282
"tests/fixtures/**",
83-
"examples/**",
84-
"docs/"
83+
"venv",
84+
]
85+
86+
lint.select = [
87+
"D", # pydocstyle
88+
"E", # pycodestyle
89+
"F", # flake8
90+
"I001", # isort
91+
"W", # pycodestyle
8592
]
86-
ignore = [
93+
lint.ignore = [
8794
"D100", # Missing docstring in public module
8895
"D102", # Missing docstring in public method
8996
"D105", # Missing docstring in magic method
@@ -92,41 +99,31 @@ ignore = [
9299
"D212", # Multi-line docstring summary should start at the first line
93100
"E731", # Do not assign a lambda expression, use a def
94101
]
95-
line-length = 120
96-
select = [
97-
"D", # pydocstyle
98-
"E", # pycodestyle
99-
"F", # flake8
100-
"W", # pycodestyle
101-
"I001", # isort
102-
]
103-
104-
[tool.ruff.isort]
102+
lint.isort.known-first-party = [ "rich_click" ]
105103
# Todo:
106104
# Add vertical hanging indent when supported.
107105
# https://github.com/astral-sh/ruff/issues/2600
108-
lines-after-imports = 2
109-
known-first-party = ["rich_click"]
106+
lint.isort.lines-after-imports = 2
110107

111108
[tool.pyproject-fmt]
112109
indent = 4
113110

114111
[tool.pytest.ini_options]
115112
addopts = "-s -rP -vv --showlocals"
116-
pythonpath = ["tests", "src"]
117-
testpaths = ["tests"]
113+
pythonpath = [ "tests", "src" ]
114+
testpaths = [ "tests" ]
118115

119116
[tool.mypy]
120117
python_version = "3.8"
121118
scripts_are_modules = true
122119
strict = true
123120
exclude = [
124-
'.*?live_style_editor\.py$'
121+
'.*?live_style_editor\.py$',
125122
]
126123

127124
[tool.pyright]
128-
include = ["src"]
129-
pythonVersion = "3.7"
125+
include = [ "src" ]
126+
pythonVersion = "3.8"
130127
typeCheckingMode = "basic"
131128
executionEnvironments = [
132129
{ root = "src" },

src/rich_click/cli.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,6 @@ def entry_points(*, group: str) -> "metadata.EntryPoints": # type: ignore[name-
3434

3535
epg = metadata.entry_points()
3636

37-
if sys.version_info < (3, 8) and hasattr(epg, "select"):
38-
return epg.select(group=group)
39-
4037
return epg.get(group, [])
4138

4239

0 commit comments

Comments
 (0)