Skip to content

Commit

Permalink
Move to hatchling from setuptools
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Sep 14, 2022
1 parent 81482d0 commit ccc75d2
Show file tree
Hide file tree
Showing 8 changed files with 69 additions and 108 deletions.
6 changes: 0 additions & 6 deletions .gitignore
@@ -1,14 +1,8 @@
*.egg-info
build
dist
*.egg
.eggs
*.py[codz]
*$py.class
.tox
.*_cache
.idea
.vscode
/pip-wheel-metadata
/src/sphinx_autodoc_typehints/version.py
venv*
5 changes: 0 additions & 5 deletions .pre-commit-config.yaml
Expand Up @@ -43,11 +43,6 @@ repos:
hooks:
- id: tox-ini-fmt
args: ["-p", "fix"]
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.0.0
hooks:
- id: setup-cfg-fmt
args: [--min-py3-version, "3.7", "--max-py-version", "3.11"]
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
hooks:
Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog

## 1.20

- Use hatchling instead of setuptools

## 1.19.2

- Fix incorrect domain used for collections.abc.Callable.
Expand Down
66 changes: 61 additions & 5 deletions pyproject.toml
@@ -1,6 +1,65 @@
[build-system]
requires = ["setuptools>=65.3", "setuptools_scm>=7.0.5"]
build-backend = 'setuptools.build_meta'
build-backend = "hatchling.build"
requires = ["hatchling>=1.9", "hatch-vcs>=0.2"]

[project]
name = "sphinx_autodoc_typehints"
description = "Type hints (PEP 484) support for the Sphinx autodoc extension"
readme.file = "README.md"
readme.content-type = "text/markdown"
keywords = ["virtual", "environments", "isolated", "testing"]
license = "MIT"
urls.Homepage = "http://pyproject_api.readthedocs.org"
urls.Source = "https://github.com/tox-dev/sphinx-autodoc-typehints"
urls.Tracker = "https://github.com/tox-dev/sphinx-autodoc-typehints/issues"
urls.Changelog = "https://github.com/tox-dev/sphinx-autodoc-typehints/blob/main/CHANGELOG.md"
authors = [{ name = "Bernát Gábor", email = "gaborjbernat@gmail.com" }]
maintainers = [{ name = "Bernát Gábor", email = "gaborjbernat@gmail.com" }]
requires-python = ">=3.7"
dependencies = ["Sphinx>=5.1.1"]
optional-dependencies.docs = ["furo>=2022.6.21", "sphinx>=5.1.1", "sphinx-autodoc-typehints>=1.19.2"]
optional-dependencies.testing = [
"covdefaults>=2.2",
"coverage>=6.4.4",
"diff-cover>=6.5.1",
"nptyping>=2.3.1",
"pytest>=7.1.3",
"pytest-cov>=3",
"sphobjinv>=2.2.2",
"typing-extensions>=4.3",
]
optional-dependencies.type_comment = ['typed-ast>=1.5.4; python_version < "3.8"']
dynamic = ["version"]
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Sphinx :: Extension",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Topic :: Documentation :: Sphinx",
]

[tool.hatch]
build.hooks.vcs.version-file = "src/sphinx_autodoc_typehints/version.py"
version.source = "vcs"

[tool.coverage]
html.show_contexts = true
html.skip_covered = false
paths.source = [
"src",
".tox*/*/lib/python*/site-packages",
".tox*/pypy*/site-packages",
".tox*\\*\\Lib\\site-packages",
"*/src",
"*\\src",
]
report.fail_under = 81
report.omit = []
run.parallel = true
run.plugins = ["covdefaults"]

[tool.black]
line-length = 120
Expand All @@ -10,9 +69,6 @@ line_length = 120
profile = "black"
known_first_party = ["sphinx_autodoc_typehints", "tests"]

[tool.setuptools_scm]
write_to = "src/sphinx_autodoc_typehints/version.py"

[tool.pytest.ini_options]
testpaths = ["tests"]

Expand Down
85 changes: 0 additions & 85 deletions setup.cfg

This file was deleted.

5 changes: 0 additions & 5 deletions setup.py

This file was deleted.

2 changes: 1 addition & 1 deletion src/sphinx_autodoc_typehints/__init__.py
Expand Up @@ -16,7 +16,7 @@
from sphinx.util.inspect import signature as sphinx_signature
from sphinx.util.inspect import stringify_signature

from .version import version as __version__
from .version import __version__

_LOGGER = logging.getLogger(__name__)
_PYDATA_ANNOTATIONS = {"Any", "AnyStr", "Callable", "ClassVar", "Literal", "NoReturn", "Optional", "Tuple", "Union"}
Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Expand Up @@ -26,7 +26,7 @@ extras =
commands =
pytest {tty:--color=yes} {posargs: \
--junitxml {toxworkdir}{/}junit.{envname}.xml --cov {envsitepackagesdir}{/}sphinx_autodoc_typehints --cov {toxinidir}{/}tests \
--cov-config=setup.cfg --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \
--cov-config=pyproject.toml --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \
--cov-report html:{envtmpdir}{/}htmlcov --cov-report xml:{toxworkdir}{/}coverage.{envname}.xml \
tests}
diff-cover --compare-branch {env:DIFF_AGAINST:origin/main} {toxworkdir}{/}coverage.{envname}.xml
Expand Down Expand Up @@ -99,6 +99,8 @@ commands =
[flake8]
max-complexity = 22
max-line-length = 120
ignore = E203, W503
unused-arguments-ignore-abstract-functions = true
noqa-require-code = true

[pep8]
Expand Down

0 comments on commit ccc75d2

Please sign in to comment.