Skip to content

Commit ccc75d2

Browse files
committed
Move to hatchling from setuptools
Signed-off-by: Bernát Gábor <[email protected]>
1 parent 81482d0 commit ccc75d2

File tree

8 files changed

+69
-108
lines changed

8 files changed

+69
-108
lines changed

.gitignore

-6
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,8 @@
1-
*.egg-info
2-
build
31
dist
42
*.egg
5-
.eggs
63
*.py[codz]
74
*$py.class
85
.tox
96
.*_cache
10-
.idea
11-
.vscode
12-
/pip-wheel-metadata
137
/src/sphinx_autodoc_typehints/version.py
148
venv*

.pre-commit-config.yaml

-5
Original file line numberDiff line numberDiff line change
@@ -43,11 +43,6 @@ repos:
4343
hooks:
4444
- id: tox-ini-fmt
4545
args: ["-p", "fix"]
46-
- repo: https://github.com/asottile/setup-cfg-fmt
47-
rev: v2.0.0
48-
hooks:
49-
- id: setup-cfg-fmt
50-
args: [--min-py3-version, "3.7", "--max-py-version", "3.11"]
5146
- repo: https://github.com/PyCQA/flake8
5247
rev: 5.0.4
5348
hooks:

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.20
4+
5+
- Use hatchling instead of setuptools
6+
37
## 1.19.2
48

59
- Fix incorrect domain used for collections.abc.Callable.

pyproject.toml

+61-5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,65 @@
11
[build-system]
2-
requires = ["setuptools>=65.3", "setuptools_scm>=7.0.5"]
3-
build-backend = 'setuptools.build_meta'
2+
build-backend = "hatchling.build"
3+
requires = ["hatchling>=1.9", "hatch-vcs>=0.2"]
4+
5+
[project]
6+
name = "sphinx_autodoc_typehints"
7+
description = "Type hints (PEP 484) support for the Sphinx autodoc extension"
8+
readme.file = "README.md"
9+
readme.content-type = "text/markdown"
10+
keywords = ["virtual", "environments", "isolated", "testing"]
11+
license = "MIT"
12+
urls.Homepage = "http://pyproject_api.readthedocs.org"
13+
urls.Source = "https://github.com/tox-dev/sphinx-autodoc-typehints"
14+
urls.Tracker = "https://github.com/tox-dev/sphinx-autodoc-typehints/issues"
15+
urls.Changelog = "https://github.com/tox-dev/sphinx-autodoc-typehints/blob/main/CHANGELOG.md"
16+
authors = [{ name = "Bernát Gábor", email = "[email protected]" }]
17+
maintainers = [{ name = "Bernát Gábor", email = "[email protected]" }]
18+
requires-python = ">=3.7"
19+
dependencies = ["Sphinx>=5.1.1"]
20+
optional-dependencies.docs = ["furo>=2022.6.21", "sphinx>=5.1.1", "sphinx-autodoc-typehints>=1.19.2"]
21+
optional-dependencies.testing = [
22+
"covdefaults>=2.2",
23+
"coverage>=6.4.4",
24+
"diff-cover>=6.5.1",
25+
"nptyping>=2.3.1",
26+
"pytest>=7.1.3",
27+
"pytest-cov>=3",
28+
"sphobjinv>=2.2.2",
29+
"typing-extensions>=4.3",
30+
]
31+
optional-dependencies.type_comment = ['typed-ast>=1.5.4; python_version < "3.8"']
32+
dynamic = ["version"]
33+
classifiers = [
34+
"Development Status :: 5 - Production/Stable",
35+
"Framework :: Sphinx :: Extension",
36+
"Intended Audience :: Developers",
37+
"License :: OSI Approved :: MIT License",
38+
"Programming Language :: Python",
39+
"Programming Language :: Python :: 3",
40+
"Programming Language :: Python :: 3 :: Only",
41+
"Topic :: Documentation :: Sphinx",
42+
]
43+
44+
[tool.hatch]
45+
build.hooks.vcs.version-file = "src/sphinx_autodoc_typehints/version.py"
46+
version.source = "vcs"
47+
48+
[tool.coverage]
49+
html.show_contexts = true
50+
html.skip_covered = false
51+
paths.source = [
52+
"src",
53+
".tox*/*/lib/python*/site-packages",
54+
".tox*/pypy*/site-packages",
55+
".tox*\\*\\Lib\\site-packages",
56+
"*/src",
57+
"*\\src",
58+
]
59+
report.fail_under = 81
60+
report.omit = []
61+
run.parallel = true
62+
run.plugins = ["covdefaults"]
463

564
[tool.black]
665
line-length = 120
@@ -10,9 +69,6 @@ line_length = 120
1069
profile = "black"
1170
known_first_party = ["sphinx_autodoc_typehints", "tests"]
1271

13-
[tool.setuptools_scm]
14-
write_to = "src/sphinx_autodoc_typehints/version.py"
15-
1672
[tool.pytest.ini_options]
1773
testpaths = ["tests"]
1874

setup.cfg

-85
This file was deleted.

setup.py

-5
This file was deleted.

src/sphinx_autodoc_typehints/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
from sphinx.util.inspect import signature as sphinx_signature
1717
from sphinx.util.inspect import stringify_signature
1818

19-
from .version import version as __version__
19+
from .version import __version__
2020

2121
_LOGGER = logging.getLogger(__name__)
2222
_PYDATA_ANNOTATIONS = {"Any", "AnyStr", "Callable", "ClassVar", "Literal", "NoReturn", "Optional", "Tuple", "Union"}

tox.ini

+3-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ extras =
2626
commands =
2727
pytest {tty:--color=yes} {posargs: \
2828
--junitxml {toxworkdir}{/}junit.{envname}.xml --cov {envsitepackagesdir}{/}sphinx_autodoc_typehints --cov {toxinidir}{/}tests \
29-
--cov-config=setup.cfg --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \
29+
--cov-config=pyproject.toml --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \
3030
--cov-report html:{envtmpdir}{/}htmlcov --cov-report xml:{toxworkdir}{/}coverage.{envname}.xml \
3131
tests}
3232
diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}{/}coverage.{envname}.xml
@@ -99,6 +99,8 @@ commands =
9999
[flake8]
100100
max-complexity = 22
101101
max-line-length = 120
102+
ignore = E203, W503
103+
unused-arguments-ignore-abstract-functions = true
102104
noqa-require-code = true
103105

104106
[pep8]

0 commit comments

Comments
 (0)