File tree 5 files changed +41
-1
lines changed
5 files changed +41
-1
lines changed Original file line number Diff line number Diff line change
1
+ from functools import partial
2
+ from pathlib import Path
3
+
4
+ from setuptools_scm import get_version
5
+
6
+
1
7
extensions = ['sphinx.ext.autodoc' , 'jaraco.packaging.sphinx' , 'rst.linker' ]
2
8
3
9
master_doc = "index"
99
105
100
106
# Add support for inline tabs
101
107
extensions += ['sphinx_inline_tabs' ]
108
+
109
+ # Add support for the unreleased "next-version" change notes
110
+ extensions += ['sphinxcontrib.towncrier' ]
111
+
112
+
113
+ # -- Options for towncrier_draft extension --------------------------------------------
114
+
115
+ PROJECT_ROOT_DIR = Path (__file__ ).parents [1 ].resolve ()
116
+ get_scm_version = partial (get_version , root = PROJECT_ROOT_DIR )
117
+
118
+ # The short X.Y version
119
+ version = '.' .join (
120
+ get_scm_version (
121
+ local_scheme = 'no-local-version' ,
122
+ ).split ('.' )[:3 ],
123
+ )
124
+
125
+ # The full version, including alpha/beta/rc tags
126
+ release = get_scm_version ()
127
+
128
+ towncrier_draft_autoversion_mode = "draft" # or: 'sphinx-release', 'sphinx-version'
129
+ towncrier_draft_include_empty = True
130
+ towncrier_draft_working_directory = PROJECT_ROOT_DIR
131
+ # Not yet supported: towncrier_draft_config_path = 'pyproject.toml' # relative to cwd
Original file line number Diff line number Diff line change 5
5
History
6
6
*******
7
7
8
+ .. towncrier-draft-entries :: |release|, unreleased as on |today|
9
+
8
10
.. include :: ../CHANGES (links).rst
9
11
10
12
Credits
Original file line number Diff line number Diff line change @@ -21,3 +21,9 @@ filterwarnings=
21
21
# https://github.com/pypa/setuptools/issues/2081
22
22
ignore:lib2to3 package is deprecated:PendingDeprecationWarning
23
23
ignore:lib2to3 package is deprecated:DeprecationWarning
24
+
25
+ # Having setuptools_scm in docs/conf.py causes this because pytest, besides
26
+ # running tests also runs linters. But since GitHub Actions CI/CD workflows
27
+ # do not perform full checkouts by default, the Git clone in that env is
28
+ # shallow:
29
+ ignore:" /home/runner/work/setuptools/setuptools" is shallow and may cause errors:UserWarning:setuptools_scm.git
Original file line number Diff line number Diff line change 74
74
75
75
# local
76
76
pygments-github-lexers ==0.0.5
77
+ setuptools-scm
77
78
sphinx-inline-tabs
79
+ sphinxcontrib-towncrier
78
80
79
81
ssl =
80
82
wincertstore ==0.2; sys_platform=='win32'
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ tox_pip_extensions_ext_venv_update = true
6
6
toxworkdir ={env:TOX_WORK_DIR:.tox}
7
7
8
8
[testenv]
9
- deps =
9
+ deps = setuptools-scm
10
10
commands =
11
11
pytest {posargs}
12
12
usedevelop = True
You can’t perform that action at this time.
0 commit comments