Skip to content

Commit 7a63923

Browse files
committed
Use hatchling and not compatible with sphinx 6.1
Signed-off-by: Bernát Gábor <[email protected]>
1 parent 295b408 commit 7a63923

File tree

8 files changed

+121
-140
lines changed

8 files changed

+121
-140
lines changed

.markdownlint.yaml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
MD013:
2+
code_blocks: false
3+
headers: false
4+
line_length: 120
5+
tables: false
6+
7+
MD046:
8+
style: fenced

.pre-commit-config.yaml

Lines changed: 34 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.3.0
3+
rev: v4.4.0
44
hooks:
55
- id: check-ast
66
- id: check-builtin-literals
@@ -11,25 +11,30 @@ repos:
1111
- id: debug-statements
1212
- id: end-of-file-fixer
1313
- id: trailing-whitespace
14+
- repo: https://github.com/asottile/add-trailing-comma
15+
rev: v2.4.0
16+
hooks:
17+
- id: add-trailing-comma
18+
args: [--py36-plus]
1419
- repo: https://github.com/asottile/pyupgrade
15-
rev: v3.2.2
20+
rev: v3.3.1
1621
hooks:
1722
- id: pyupgrade
18-
args: [ "--py37-plus" ]
23+
args: ["--py37-plus"]
1924
- repo: https://github.com/PyCQA/isort
20-
rev: 5.10.1
25+
rev: 5.11.4
2126
hooks:
2227
- id: isort
2328
- repo: https://github.com/psf/black
24-
rev: 22.10.0
29+
rev: 22.12.0
2530
hooks:
2631
- id: black
27-
args: [ --safe ]
32+
args: [--safe]
2833
- repo: https://github.com/asottile/blacken-docs
2934
rev: v1.12.1
3035
hooks:
3136
- id: blacken-docs
32-
additional_dependencies: [ black==22.10 ]
37+
additional_dependencies: [black==22.12]
3338
- repo: https://github.com/pre-commit/pygrep-hooks
3439
rev: v1.9.0
3540
hooks:
@@ -38,20 +43,33 @@ repos:
3843
rev: "0.5.2"
3944
hooks:
4045
- id: tox-ini-fmt
41-
args: [ "-p", "fix" ]
42-
- repo: https://github.com/asottile/setup-cfg-fmt
43-
rev: v2.2.0
44-
hooks:
45-
- id: setup-cfg-fmt
46+
args: ["-p", "fix"]
4647
- repo: https://github.com/PyCQA/flake8
47-
rev: 5.0.4
48+
rev: 6.0.0
4849
hooks:
4950
- id: flake8
5051
additional_dependencies:
51-
- flake8-bugbear==22.10.27
52+
- flake8-bugbear==22.12.6
5253
- flake8-comprehensions==3.10.1
5354
- flake8-pytest-style==1.6
5455
- flake8-spellcheck==0.28
5556
- flake8-unused-arguments==0.0.12
56-
- flake8-noqa==1.2.9
57-
- pep8-naming==0.13.2
57+
- flake8-noqa==1.3
58+
- pep8-naming==0.13.3
59+
- flake8-pyproject==1.2.2
60+
- repo: https://github.com/pre-commit/mirrors-prettier
61+
rev: "v2.7.1"
62+
hooks:
63+
- id: prettier
64+
additional_dependencies:
65+
66+
- "@prettier/[email protected]"
67+
args: ["--print-width=120", "--prose-wrap=always"]
68+
- repo: https://github.com/igorshubovych/markdownlint-cli
69+
rev: v0.32.2
70+
hooks:
71+
- id: markdownlint
72+
- repo: meta
73+
hooks:
74+
- id: check-hooks-apply
75+
- id: check-useless-excludes

CHANGELOG.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,19 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## 1.11.0
6+
7+
- Hatchling as backend and exclude sphinx 6.1 support.
8+
59
## 1.10.0
610

711
- Add the option to override the generated `default` part of the CLI parameter description.
812

913
## 1.9.0
1014

1115
- Add the option to override the description using the `description` attribute of the directive
12-
- Add the option to retrieve the arguments by hooking argparse, in cases where `func` consumes the arguments
13-
and does not return them
16+
- Add the option to retrieve the arguments by hooking argparse, in cases where `func` consumes the arguments and does
17+
not return them
1418

1519
## 1.8.2
1620

@@ -27,7 +31,8 @@ All notable changes to this project will be documented in this file.
2731

2832
## 1.7.0
2933

30-
- Support for adding custom subsection group title prefix (`group_title_prefix` and `group_sub_title_prefix` directive arguments)
34+
- Support for adding custom subsection group title prefix (`group_title_prefix` and `group_sub_title_prefix` directive
35+
arguments)
3136

3237
## 1.6.0 (2021-04-15)
3338

pyproject.toml

Lines changed: 64 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,75 @@
11
[build-system]
2-
requires = ["setuptools>=65.5", "setuptools-scm>=7.0.5"]
3-
build-backend = "setuptools.build_meta"
2+
build-backend = "hatchling.build"
3+
requires = ["hatchling>=1.12", "hatch-vcs>=0.3"]
4+
5+
[project]
6+
name = "sphinx_argparse_cli"
7+
description = "render CLI arguments (sub-commands friendly) defined by argparse module"
8+
readme = "README.md"
9+
license = "MIT"
10+
maintainers = [{ name = "Bernat Gabor", email = "[email protected]" }]
11+
urls.Documentation = "https://github.com/tox-dev/sphinx-argparse-cli#sphinx-argparse-cli"
12+
urls.Homepage = "https://github.com/tox-dev/sphinx-argparse-cli"
13+
urls.Source = "https://github.com/tox-dev/sphinx-argparse-cli"
14+
urls.Tracker = "https://github.com/tox-dev/sphinx-argparse-cli/issues"
15+
classifiers = [
16+
"Development Status :: 5 - Production/Stable",
17+
"Environment :: Console",
18+
"Framework :: Sphinx",
19+
"Framework :: Sphinx :: Extension",
20+
"Intended Audience :: Developers",
21+
"License :: OSI Approved :: MIT License",
22+
"Operating System :: OS Independent",
23+
"Programming Language :: Python :: 3",
24+
"Programming Language :: Python :: 3 :: Only",
25+
"Programming Language :: Python :: Implementation :: CPython",
26+
"Topic :: Documentation",
27+
"Topic :: Documentation :: Sphinx",
28+
]
29+
keywords = ["sphinx", "argparse"]
30+
requires-python = ">=3.7"
31+
dependencies = ["sphinx>=5.3,!=6.1"]
32+
optional-dependencies.test = ["covdefaults>=2.2.2", "pytest>=7.2", "pytest-cov>=4"]
33+
dynamic = ["version"]
34+
35+
[tool.hatch]
36+
build.hooks.vcs.version-file = "src/sphinx_argparse_cli/version.py"
37+
build.targets.sdist.include = ["/src", "/tests"]
38+
version.source = "vcs"
439

540
[tool.black]
641
line-length = 120
742

43+
[tool.coverage]
44+
html.show_contexts = true
45+
html.skip_covered = false
46+
paths.source = ["src", "**/site-packages"]
47+
report.fail_under = 76
48+
run.dynamic_context = "test_function"
49+
run.parallel = true
50+
run.plugins = ["covdefaults"]
51+
run.relative_files = true
52+
853
[tool.isort]
54+
known_first_party = ["sphinx_argparse_cli", "tests"]
955
profile = "black"
10-
known_first_party = ["sphinx_argparse_cli"]
56+
line_length = 120
1157

12-
[tool.setuptools_scm]
13-
write_to = "src/sphinx_argparse_cli/version.py"
14-
write_to_template = """
15-
\"\"\" Version information \"\"\"
16-
from __future__ import annotations
58+
[tool.mypy]
59+
python_version = "3.11"
60+
show_error_codes = true
61+
strict = true
1762

18-
__version__: str = "{version}"
19-
"""
63+
[tool.pep8]
64+
max-line-length = "120"
2065

21-
[tool.pytest.ini_options]
22-
filterwarnings = [
23-
"ignore::DeprecationWarning:docutils",
66+
[tool.flake8]
67+
max-complexity = 22
68+
max-line-length = 120
69+
unused-arguments-ignore-abstract-functions = true
70+
noqa-require-code = true
71+
dictionaries = ["en_US", "python", "technical", "django"]
72+
ignore = [
73+
"E203", # whitespace before ':'
74+
"W503", # line break before binary operator
2475
]

setup.cfg

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

setup.py

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

src/sphinx_argparse_cli/_logic.py

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@
3232
title,
3333
whitespace_normalize_name,
3434
)
35-
from docutils.parsers.rst.directives import (
36-
flag,
37-
positive_int,
38-
unchanged,
39-
unchanged_required,
40-
)
35+
from docutils.parsers.rst.directives import flag, positive_int, unchanged, unchanged_required
4136
from docutils.parsers.rst.states import RSTState, RSTStateMachine
4237
from docutils.statemachine import StringList
4338
from sphinx.domains.std import StandardDomain

tox.ini

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ commands =
2323
pytest {tty:--color=yes} {posargs: \
2424
--junitxml {toxworkdir}{/}junit.{envname}.xml --cov {envsitepackagesdir}{/}sphinx_argparse_cli \
2525
--cov {toxinidir}{/}tests --cov-fail-under=100 \
26-
--cov-config=setup.cfg --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \
26+
--cov-config=pyproject.toml --no-cov-on-fail --cov-report term-missing:skip-covered --cov-context=test \
2727
--cov-report html:{envtmpdir}{/}htmlcov --cov-report xml:{toxworkdir}{/}coverage.{envname}.xml \
2828
tests}
2929
package = wheel
@@ -37,7 +37,7 @@ passenv =
3737
basepython = python3.10
3838
skip_install = true
3939
deps =
40-
pre-commit>=2.20
40+
pre-commit>=2.21
4141
commands =
4242
pre-commit run --all-files --show-diff-on-failure
4343
python -c 'print("hint: run {envdir}/bin/pre-commit install to add checks as pre-commit hook")'
@@ -47,19 +47,19 @@ description = run type check on code base
4747
setenv =
4848
{tty:MYPY_FORCE_COLOR = 1}
4949
deps =
50-
mypy==0.982
50+
mypy==0.991
5151
types-docutils>=0.19.1.1
5252
commands =
53-
mypy --strict --python-version 3.10 src
54-
mypy --strict --python-version 3.10 tests
53+
mypy src
54+
mypy tests
5555

5656
[testenv:pkg_check]
5757
description = check that the long description is valid
5858
basepython = python3.10
5959
skip_install = true
6060
deps =
6161
build[virtualenv]>=0.9
62-
twine>=4.0.1
62+
twine>=4.0.2
6363
changedir = {toxinidir}
6464
commands =
6565
python -m build --sdist --wheel -o {envtmpdir} .
@@ -75,15 +75,3 @@ extras =
7575
commands =
7676
python -m pip list --format=columns
7777
python -c 'import sys; print(sys.executable)'
78-
79-
[pytest]
80-
junit_family = xunit2
81-
82-
[flake8]
83-
max-complexity = 22
84-
max-line-length = 120
85-
noqa-require-code = true
86-
dictionaries = en_US,python,technical,django
87-
ignore =
88-
E203 # whitespace before :
89-
W503 # line break before binary operator

0 commit comments

Comments
 (0)