Skip to content

Commit 6beaf5b

Browse files
committed
Build maintenance
1 parent 8e1e716 commit 6beaf5b

File tree

9 files changed

+226
-149
lines changed

9 files changed

+226
-149
lines changed

.config/constraints.txt

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ cssselect2==0.7.0
1919
defusedxml==0.7.1
2020
dnspython==2.7.0
2121
exceptiongroup==1.2.2
22+
execnet==2.1.1
2223
ghp-import==2.1.0
2324
griffe==1.5.7
2425
hjson==3.1.0
@@ -44,7 +45,7 @@ mkdocs-material-extensions==1.3.1
4445
mkdocs-minify-plugin==0.8.0
4546
mkdocs-monorepo-plugin==1.1.0
4647
mkdocstrings==0.28.1
47-
mkdocstrings-python==1.15.0
48+
mkdocstrings-python==1.16.0
4849
packaging==24.2
4950
paginate==0.5.7
5051
pathspec==0.12.1
@@ -55,6 +56,8 @@ pycparser==2.22
5556
pygments==2.19.1
5657
pymdown-extensions==10.14.3
5758
pytest==8.3.4
59+
pytest-plus==0.8.1
60+
pytest-xdist==3.6.1
5861
python-dateutil==2.9.0.post0
5962
python-slugify==8.0.4
6063
pyyaml==6.0.2

.config/dictionary.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ mkdocstrings
3535
mypy
3636
notest
3737
outdir
38+
posargs
3839
pycontribs
3940
pylint
4041
pymdown
@@ -44,9 +45,11 @@ pyproject
4445
pyupgrade
4546
ruamel
4647
setuptools
48+
showlocals
4749
smartsymbols
4850
sourcegraph
4951
squidfunk
5052
superfences
5153
tasklist
5254
tomli
55+
tomlsort

.config/requirements-test.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,4 @@
11
coverage
22
pytest
3+
pytest-plus
4+
pytest-xdist

.pre-commit-config.yaml

Lines changed: 31 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,7 @@ ci:
33
# format compatible with commitlint
44
autoupdate_commit_msg: "chore: pre-commit autoupdate"
55
autoupdate_schedule: monthly
6-
autofix_commit_msg: |
7-
chore: auto fixes from pre-commit.com hooks
8-
9-
for more information, see https://pre-commit.ci
6+
autofix_commit_msg: "chore: auto fixes from pre-commit.com hooks"
107
skip:
118
# https://github.com/pre-commit-ci/issues/issues/55
129
- pip-compile
@@ -15,16 +12,15 @@ repos:
1512
- repo: meta
1613
hooks:
1714
- id: check-useless-excludes
18-
- repo: https://github.com/pre-commit/mirrors-prettier
15+
- repo: https://github.com/rbubley/mirrors-prettier
1916
# keep it before yamllint
20-
rev: v4.0.0-alpha.8
17+
rev: v3.4.2
2118
hooks:
2219
- id: prettier
2320
always_run: true
2421
additional_dependencies:
25-
- prettier
26-
- prettier-plugin-toml
27-
- prettier-plugin-sort-json
22+
23+
2824
- repo: https://github.com/streetsidesoftware/cspell-cli
2925
rev: v8.17.2
3026
hooks:
@@ -39,6 +35,11 @@ repos:
3935
- repo: https://github.com/pre-commit/pre-commit-hooks.git
4036
rev: v5.0.0
4137
hooks:
38+
- id: check-added-large-files
39+
- id: check-merge-conflict
40+
- id: check-symlinks
41+
- id: debug-statements
42+
- id: detect-private-key
4243
- id: end-of-file-fixer
4344
- id: trailing-whitespace
4445
- id: mixed-line-ending
@@ -64,24 +65,33 @@ repos:
6465
files: \.(yaml|yml)$
6566
types: [file, yaml]
6667
entry: yamllint --strict
67-
- repo: https://github.com/PyCQA/isort
68-
rev: 6.0.0
69-
hooks:
70-
- id: isort
71-
args:
72-
# https://github.com/pre-commit/mirrors-isort/issues/9#issuecomment-624404082
73-
- --filter-files
74-
- repo: https://github.com/psf/black
75-
rev: 25.1.0
76-
hooks:
77-
- id: black
78-
language_version: python3
7968
- repo: https://github.com/asottile/pyupgrade
8069
# keep it after flake8
8170
rev: v3.19.1
8271
hooks:
8372
- id: pyupgrade
8473
args: ["--py39-plus"]
74+
- repo: https://github.com/pappasam/toml-sort
75+
rev: v0.24.2
76+
hooks:
77+
- id: toml-sort-fix
78+
alias: toml
79+
80+
- repo: https://github.com/tox-dev/tox-ini-fmt
81+
rev: 1.5.0
82+
hooks:
83+
- id: tox-ini-fmt
84+
85+
- repo: https://github.com/astral-sh/ruff-pre-commit
86+
rev: v0.9.4
87+
hooks:
88+
- id: ruff
89+
args:
90+
- --fix
91+
- --exit-non-zero-on-fix
92+
types_or: [python, pyi]
93+
# - id: ruff-format # must be after ruff
94+
# types_or: [python, pyi]
8595
- repo: https://github.com/pre-commit/mirrors-mypy
8696
rev: v1.14.1
8797
hooks:

.taplo.toml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
[formatting]
2+
# cspell: disable-next-line
3+
# compatibility between toml-sort-fix pre-commit hook and panekj.even-betterer-toml extension
4+
align_comments = false
5+
array_trailing_comma = false
6+
compact_arrays = true
7+
compact_entries = false
8+
compact_inline_tables = true
9+
inline_table_expand = false
10+
reorder_keys = true

codecov.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
comment: false
3+
coverage:
4+
status:
5+
patch: true
6+
project:
7+
default:
8+
threshold: 0.5%

cspell.config.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ dictionaries:
99
- bash
1010
- words
1111
- python
12+
enabled: true
1213
ignorePaths:
1314
- cspell.config.yaml
1415
# The requirements file

pyproject.toml

Lines changed: 67 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,12 @@
11
[build-system]
2+
build-backend = "setuptools.build_meta"
23
requires = [
3-
"setuptools >= 65.3.0", # required by pyproject+setuptools_scm integration
4-
"setuptools_scm[toml] >= 7.0.5", # required for "no-local-version" scheme
5-
4+
"setuptools >= 65.3.0", # required by pyproject+setuptools_scm integration and editable installs
5+
"setuptools_scm[toml] >= 7.0.5" # required for "no-local-version" scheme
66
]
7-
build-backend = "setuptools.build_meta"
87

98
[project]
10-
requires-python = ">=3.10"
11-
dynamic = ["version", "dependencies", "optional-dependencies"]
12-
name = "mkdocs-ansible"
13-
description = "Ansible MkDocs Theme based on mkdocs-material"
14-
readme = "docs/README.md"
15-
authors = [{ "name" = "Ansible by Red Hat", "email" = "[email protected]" }]
16-
maintainers = [{ "name" = "Ansible by Red Hat", "email" = "[email protected]" }]
17-
license = { text = "MIT" }
9+
authors = [{"email" = "[email protected]", "name" = "Ansible by Red Hat"}]
1810
classifiers = [
1911
"Development Status :: 5 - Production/Stable",
2012
"Environment :: Web Environment",
@@ -28,39 +20,61 @@ classifiers = [
2820
'Programming Language :: Python :: 3.13',
2921
"Topic :: Documentation",
3022
"Topic :: Software Development :: Documentation",
31-
"Topic :: Text Processing :: Markup :: HTML",
23+
"Topic :: Text Processing :: Markup :: HTML"
3224
]
25+
description = "Ansible MkDocs Theme based on mkdocs-material"
26+
dynamic = ["version", "dependencies", "optional-dependencies"]
3327
keywords = ["ansible", "mkdocs", "theme"]
28+
license = {text = "MIT"}
29+
maintainers = [{"email" = "[email protected]", "name" = "Ansible by Red Hat"}]
30+
name = "mkdocs-ansible"
31+
readme = "docs/README.md"
32+
requires-python = ">=3.10"
33+
34+
[project.entry-points."mkdocs.themes"]
35+
ansible = "mkdocs_ansible"
3436

3537
[project.urls]
36-
homepage = "https://github.com/ansible/mkdocs-ansible"
38+
changelog = "https://github.com/ansible/mkdocs-ansible/releases"
3739
documentation = "https://ansible.readthedocs.io/projects/mkdocs-ansible/"
40+
homepage = "https://github.com/ansible/mkdocs-ansible"
3841
repository = "https://github.com/ansible/mkdocs-ansible"
39-
changelog = "https://github.com/ansible/mkdocs-ansible/releases"
4042

43+
[tool.codespell]
44+
# indention is a typo in ruamel.yaml's API
45+
ignore-words-list = "indention"
46+
skip = ".tox,.mypy_cache,build,.git,.eggs,pip-wheel-metadata"
4147

42-
[project.entry-points."mkdocs.themes"]
43-
ansible = "mkdocs_ansible"
48+
# Keep this default because xml/report do not know to use load it from config file:
49+
# data_file = ".coverage"
50+
[tool.coverage.paths]
51+
source = ["src", ".tox/*/site-packages"]
4452

4553
[tool.coverage.report]
46-
exclude_lines = ["pragma: no cover", "if TYPE_CHECKING:"]
47-
omit = ["test/*", "src/mkdocs_ansible/_version.py"]
54+
exclude_also = ["pragma: no cover", "if TYPE_CHECKING:"]
4855
# Increase it just so it would pass on any single-python run
4956
fail_under = 82
50-
skip_covered = true
51-
skip_empty = true
5257
# During development we might remove code (files) with coverage data, and we dont want to fail:
5358
ignore_errors = true
59+
omit = ["test/*", "src/mkdocs_ansible/_version.py"]
5460
show_missing = true
61+
skip_covered = true
62+
skip_empty = true
5563

5664
[tool.coverage.run]
65+
concurrency = ["multiprocessing", "thread"]
66+
# Do not use branch until bug is fixes:
67+
# https://github.com/nedbat/coveragepy/issues/605
68+
# branch = true
69+
parallel = true
5770
source = ["src"]
5871

5972
[tool.mypy]
60-
strict = true
73+
exclude = "(.config|build|dist|test/local-content|site-packages|~/.pyenv|examples/playbooks/collections|plugins/modules)"
74+
# https://github.com/python/mypy/issues/12664
6175
python_version = "3.10"
76+
strict = true
6277
warn_unused_configs = true
63-
exclude = ['build']
6478

6579
[[tool.mypy.overrides]]
6680
module = ["mkdocs_ansible._version"]
@@ -73,19 +87,46 @@ warn_unused_ignores = false # https://github.com/python/mypy/issues/13201
7387
[tool.pylint.MASTER]
7488
ignore-paths = "^src/.*/(_version|_vendor).*$"
7589

76-
[tool.setuptools.dynamic]
77-
dependencies = { file = [".config/requirements.in"] }
78-
optional-dependencies.test = { file = [".config/requirements-test.in"] }
90+
[tool.ruff]
91+
cache-dir = "./.cache/.ruff"
92+
exclude = [".config"]
93+
fix = true
94+
# Same as Black.
95+
line-length = 88
96+
preview = true
97+
98+
[tool.ruff.lint.pydocstyle]
99+
convention = "google"
79100

80101
[tool.setuptools]
81102
include-package-data = true
82103

104+
[tool.setuptools.dynamic]
105+
dependencies = {file = [".config/requirements.in"]}
106+
optional-dependencies.test = {file = [".config/requirements-test.in"]}
107+
83108
[tool.setuptools.package-data]
84109
"*" = ["*.css", "*.html", "*.js"]
85110

86111
[tool.setuptools.packages.find]
87112
where = ["src"]
88113

89114
[tool.setuptools_scm]
115+
# To prevent accidental pick of mobile version tags such 'v6'
116+
git_describe_command = [
117+
"git",
118+
"describe",
119+
"--dirty",
120+
"--long",
121+
"--tags",
122+
"--match",
123+
"v*.*"
124+
]
90125
local_scheme = "no-local-version"
126+
tag_regex = "^(?P<prefix>v)?(?P<version>\\d+[^\\+]*)(?P<suffix>.*)?$"
91127
write_to = "src/mkdocs_ansible/_version.py"
128+
129+
[tool.tomlsort]
130+
in_place = true
131+
sort_inline_tables = true
132+
sort_table_keys = true

0 commit comments

Comments
 (0)