Skip to content

Commit 8f08943

Browse files
Updated files with 'repo_helper'. (#14)
Co-authored-by: repo-helper[bot] <74742576+repo-helper[bot]@users.noreply.github.com>
1 parent 8726a28 commit 8f08943

File tree

7 files changed

+66
-84
lines changed

7 files changed

+66
-84
lines changed

.bumpversion.cfg

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,7 @@ replace = : str = "{new_version}"
1717
[bumpversion:file:doc-source/index.rst]
1818

1919
[bumpversion:file:pyproject.toml]
20+
21+
[bumpversion:file:setup.cfg]
22+
search = name = {current_version}
23+
replace = name = {new_version}

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ repos:
3131
args:
3232
- --allow-git
3333
- id: check-docstring-first
34-
exclude: ^(doc-source/conf|__pkginfo__|make_conda_recipe|setup|tests/.*)\.py$
34+
exclude: ^(doc-source/conf|__pkginfo__|setup|tests/.*)\.py$
3535
- id: bind-requirements
3636

3737
- repo: https://github.com/domdfcoding/flake8-dunder-all
@@ -71,7 +71,7 @@ repos:
7171
rev: v0.4.3
7272
hooks:
7373
- id: formate
74-
exclude: ^(doc-source/conf|__pkginfo__|make_conda_recipe|setup)\.(_)?py$
74+
exclude: ^(doc-source/conf|__pkginfo__|setup)\.(_)?py$
7575

7676
- repo: https://github.com/domdfcoding/dep_checker
7777
rev: v0.6.1

README.rst

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ tox-recreate-hook
2424
* - Activity
2525
- |commits-latest| |commits-since| |maintained| |pypi-downloads|
2626
* - QA
27-
- |codefactor| |actions_flake8| |actions_mypy| |pre_commit_ci|
27+
- |codefactor| |actions_flake8| |actions_mypy|
2828
* - Other
2929
- |license| |language| |requires|
3030

@@ -106,10 +106,6 @@ tox-recreate-hook
106106
:target: https://pypi.org/project/tox-recreate-hook/
107107
:alt: PyPI - Downloads
108108

109-
.. |pre_commit_ci| image:: https://results.pre-commit.ci/badge/github/python-coincidence/tox-recreate-hook/master.svg
110-
:target: https://results.pre-commit.ci/latest/github/python-coincidence/tox-recreate-hook/master
111-
:alt: pre-commit.ci status
112-
113109
.. end shields
114110
115111
Installation

__pkginfo__.py

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -11,22 +11,10 @@
1111
# This script based on https://github.com/rocky/python-uncompyle6/blob/master/__pkginfo__.py
1212
#
1313

14-
# stdlib
15-
import pathlib
16-
1714
__all__ = [
18-
"__copyright__",
1915
"__version__",
20-
"repo_root",
21-
"install_requires",
2216
"extras_require",
2317
]
2418

25-
__copyright__ = """
26-
2021 Dominic Davis-Foster <[email protected]>
27-
"""
28-
2919
__version__ = "0.1.0"
30-
repo_root = pathlib.Path(__file__).parent
31-
install_requires = (repo_root / "requirements.txt").read_text(encoding="utf-8").split('\n')
3220
extras_require = {}

doc-source/conf.py

Lines changed: 57 additions & 61 deletions
Original file line numberDiff line numberDiff line change
@@ -5,31 +5,19 @@
55
# stdlib
66
import os
77
import re
8-
import sys
98

10-
sys.path.append(os.path.abspath('.'))
11-
sys.path.append(os.path.abspath(".."))
9+
# 3rd party
10+
from sphinx_pyproject import SphinxConfig
1211

13-
# this package
14-
from __pkginfo__ import __version__
12+
config = SphinxConfig()
1513

1614
github_username = "python-coincidence"
1715
github_repository = "tox-recreate-hook"
18-
github_url = f"https://github.com/{github_username}/{github_repository}"
19-
20-
rst_prolog = f""".. |pkgname| replace:: tox-recreate-hook
21-
.. |pkgname2| replace:: ``tox-recreate-hook``
22-
.. |browse_github| replace:: `Browse the GitHub Repository <{github_url}>`__
23-
"""
24-
2516
author = "Dominic Davis-Foster"
26-
project = "tox-recreate-hook".replace('_', '-')
27-
slug = re.sub(r'\W+', '-', project.lower())
28-
release = version = __version__
29-
copyright = "2021 Dominic Davis-Foster" # pylint: disable=redefined-builtin
17+
project = "tox-recreate-hook"
18+
copyright = "2021 Dominic Davis-Foster"
3019
language = "en"
3120
package_root = "tox_recreate_hook"
32-
3321
extensions = [
3422
"sphinx_toolbox",
3523
"sphinx_toolbox.more_autodoc",
@@ -50,71 +38,38 @@
5038
"sphinx_debuginfo",
5139
"seed_intersphinx_mapping",
5240
]
53-
5441
sphinxemoji_style = "twemoji"
55-
todo_include_todos = bool(os.environ.get("SHOW_TODOS", 0))
5642
gitstamp_fmt = "%d %b %Y"
57-
5843
templates_path = ["_templates"]
5944
html_static_path = ["_static"]
6045
source_suffix = ".rst"
6146
master_doc = "index"
6247
suppress_warnings = ["image.nonlocal_uri"]
6348
pygments_style = "default"
64-
65-
intersphinx_mapping = {
66-
"python": ("https://docs.python.org/3/", None),
67-
"sphinx": ("https://www.sphinx-doc.org/en/stable/", None),
68-
"tox": ("https://tox.readthedocs.io/en/latest/", None),
69-
}
70-
7149
html_theme = "furo"
72-
html_theme_options = {
73-
"light_css_variables": {
74-
"toc-title-font-size": "12pt",
75-
"toc-font-size": "12pt",
76-
"admonition-font-size": "12pt",
77-
},
78-
"dark_css_variables": {
79-
"toc-title-font-size": "12pt",
80-
"toc-font-size": "12pt",
81-
"admonition-font-size": "12pt",
82-
},
83-
}
8450
html_theme_path = ["../.."]
85-
html_show_sourcelink = True # True will show link to source
86-
87-
html_context = {}
88-
htmlhelp_basename = slug
89-
90-
latex_documents = [("index", f'{slug}.tex', project, author, "manual")]
91-
man_pages = [("index", slug, project, [author], 1)]
92-
texinfo_documents = [("index", slug, project, author, slug, project, "Miscellaneous")]
93-
94-
toctree_plus_types = {
51+
html_show_sourcelink = True
52+
toctree_plus_types = [
9553
"class",
96-
"function",
97-
"method",
54+
"confval",
9855
"data",
56+
"directive",
9957
"enum",
58+
"exception",
10059
"flag",
101-
"confval",
102-
"directive",
103-
"role",
104-
"confval",
60+
"function",
61+
"method",
62+
"namedtuple",
10563
"protocol",
64+
"role",
10665
"typeddict",
107-
"namedtuple",
108-
"exception",
109-
}
110-
66+
]
11167
add_module_names = False
11268
hide_none_rtype = True
11369
all_typevars = True
11470
overloads_location = "bottom"
11571
documentation_summary = "(experimental) Allows hooks to be defined which are called when recreating a tox testenv."
116-
117-
autodoc_exclude_members = [ # Exclude "standard" methods.
72+
autodoc_exclude_members = [
11873
"__dict__",
11974
"__class__",
12075
"__dir__",
@@ -132,6 +87,47 @@
13287
"__abstractmethods__",
13388
"__hash__",
13489
]
90+
91+
github_url = f"https://github.com/{github_username}/{github_repository}"
92+
93+
rst_prolog = f""".. |pkgname| replace:: tox-recreate-hook
94+
.. |pkgname2| replace:: ``tox-recreate-hook``
95+
.. |browse_github| replace:: `Browse the GitHub Repository <{github_url}>`__
96+
"""
97+
98+
slug = re.sub(r'\W+', '-', project.lower())
99+
release = version = config.version
100+
101+
todo_include_todos = bool(os.environ.get("SHOW_TODOS", 0))
102+
103+
intersphinx_mapping = {
104+
"python": ("https://docs.python.org/3/", None),
105+
"sphinx": ("https://www.sphinx-doc.org/en/stable/", None),
106+
"tox": ("https://tox.readthedocs.io/en/latest/", None),
107+
}
108+
109+
html_theme_options = {
110+
"light_css_variables": {
111+
"toc-title-font-size": "12pt",
112+
"toc-font-size": "12pt",
113+
"admonition-font-size": "12pt",
114+
},
115+
"dark_css_variables": {
116+
"toc-title-font-size": "12pt",
117+
"toc-font-size": "12pt",
118+
"admonition-font-size": "12pt",
119+
},
120+
}
121+
122+
html_context = {}
123+
htmlhelp_basename = slug
124+
125+
latex_documents = [("index", f'{slug}.tex', project, author, "manual")]
126+
man_pages = [("index", slug, project, [author], 1)]
127+
texinfo_documents = [("index", slug, project, author, slug, project, "Miscellaneous")]
128+
129+
toctree_plus_types = set(toctree_plus_types)
130+
135131
autodoc_default_options = {
136132
"members": None, # Include all members (methods).
137133
"special-members": None,

doc-source/index.rst

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ tox-recreate-hook
2525
* - Activity
2626
- |commits-latest| |commits-since| |maintained| |pypi-downloads|
2727
* - QA
28-
- |codefactor| |actions_flake8| |actions_mypy| |pre_commit_ci|
28+
- |codefactor| |actions_flake8| |actions_mypy|
2929
* - Other
3030
- |license| |language| |requires|
3131

@@ -110,9 +110,6 @@ tox-recreate-hook
110110
:downloads: month
111111
:alt: PyPI - Downloads
112112

113-
.. |pre_commit_ci| pre-commit-ci-shield::
114-
:alt: pre-commit.ci status
115-
116113
.. end shields
117114
118115
Installation

doc-source/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ sphinx-copybutton>=0.2.12
88
sphinx-debuginfo>=0.1.0
99
sphinx-notfound-page>=0.5
1010
sphinx-prompt>=1.1.0
11+
sphinx-pyproject>=0.1.0
1112
sphinx-tabs>=1.1.13
1213
sphinx-toolbox>=2.2.0
1314
sphinxcontrib-httpdomain>=1.7.0

0 commit comments

Comments
 (0)