Skip to content

Commit 073353a

Browse files
committed
Migrate setuptools, mypy configuration to pyproject.toml
We also migrate from pbr to setuptools + setuptool_scm and drop some now unnecessary dependencies. Signed-off-by: Stephen Finucane <[email protected]>
1 parent 83a5a17 commit 073353a

File tree

7 files changed

+82
-71
lines changed

7 files changed

+82
-71
lines changed

docs/changelog.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
Changes
22
=======
33

4-
.. include:: ../ChangeLog
5-
:start-line: 2
4+
.. release-notes::

docs/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
# Add any Sphinx extension module names here, as strings. They can be
1818
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
1919
# ones.
20-
extensions = ['sphinx_click']
20+
extensions = ['sphinx_click', 'reno.sphinxext']
2121

2222
# The suffix(es) of source filenames.
2323
# You can specify multiple suffix as a list of string:

pyproject.toml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,80 @@
1+
[build-system]
2+
requires = ["setuptools>=80", "setuptools-scm>=8"]
3+
build-backend = "setuptools.build_meta"
4+
5+
[project]
6+
name = "sphinx-click"
7+
description = "Sphinx extension that automatically documents click applications"
8+
authors = [
9+
{name = "Stephen Finucane", email = "[email protected]"}
10+
]
11+
readme = {file = "README.rst", content-type = "text/x-rst"}
12+
license = {text = "MIT License"}
13+
requires-python = ">=3.8"
14+
keywords = ["sphinx", "click"]
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"Environment :: Console",
18+
"Framework :: Sphinx :: Extension",
19+
"Intended Audience :: Developers",
20+
"Intended Audience :: Information Technology",
21+
"License :: OSI Approved :: MIT License",
22+
"Operating System :: OS Independent",
23+
"Programming Language :: Python",
24+
"Programming Language :: Python :: 3",
25+
"Programming Language :: Python :: 3 :: Only",
26+
"Topic :: Documentation",
27+
"Topic :: Documentation :: Sphinx",
28+
"Topic :: Utilities",
29+
]
30+
dependencies = [
31+
"sphinx>=4.0",
32+
"click>=8.0",
33+
"docutils",
34+
]
35+
dynamic = ["version"]
36+
37+
[project.optional-dependencies]
38+
docs = [
39+
"reno",
40+
]
41+
test = [
42+
"pytest",
43+
"pytest-cov",
44+
]
45+
46+
[project.urls]
47+
"Bug Tracker" = "https://github.com/click-contrib/sphinx-click/issues"
48+
"Documentation" = "https://sphinx-click.readthedocs.io/en/latest"
49+
"Source Code" = "https://github.com/click-contrib/sphinx-click"
50+
51+
[tool.setuptools]
52+
packages = [
53+
"sphinx_click"
54+
]
55+
56+
[tool.setuptools_scm]
57+
158
[tool.ruff]
259
line-length = 88
360

461
[tool.ruff.format]
562
quote-style = "preserve"
63+
64+
[tool.mypy]
65+
disallow_untyped_defs = true
66+
disallow_incomplete_defs = true
67+
no_implicit_optional = true
68+
show_column_numbers = true
69+
show_error_context = true
70+
ignore_missing_imports = true
71+
check_untyped_defs = true
72+
warn_unused_ignores = true
73+
warn_return_any = true
74+
strict_optional = true
75+
exclude = '''
76+
(?x)(
77+
docs
78+
| tests
79+
)
80+
'''

requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

setup.cfg

Lines changed: 0 additions & 54 deletions
This file was deleted.

setup.py

Lines changed: 0 additions & 8 deletions
This file was deleted.

tox.ini

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,13 @@ setenv =
77
PYTHONDEVMODE = 1
88
PYTHONWARNINGS = all
99
PYTEST_ADDOPTS = {env:PYTEST_ADDOPTS:} --color yes
10+
extras =
11+
test
1012
deps =
1113
pytest
1214
pytest-cov
13-
coverage
14-
defusedxml
1515
click8: click>=8.0,<9.0
1616
click8-async: asyncclick>=8.0,<9.0
17-
defusedxml
1817
commands =
1918
python -m pytest --cov {toxinidir}/sphinx_click {posargs}
2019
pip_pre =
@@ -33,6 +32,9 @@ commands =
3332
pre-commit run --all-files --show-diff-on-failure
3433

3534
[testenv:docs]
35+
deps =
36+
extras =
37+
docs
3638
commands =
3739
sphinx-build -Wn -b html -d docs/_build/doctrees docs docs/_build/html
3840

0 commit comments

Comments
 (0)