Skip to content

Commit

Permalink
add towncrier to generate changelog
Browse files Browse the repository at this point in the history
remove outdated make.bat
  • Loading branch information
zhPavel committed Dec 21, 2023
1 parent 807ffc1 commit 29f1168
Show file tree
Hide file tree
Showing 13 changed files with 128 additions and 42 deletions.
13 changes: 13 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
==================
Changelog
==================

Versions follow `Semantic Versioning <https://semver.org/>`_ (``<major>.<minor>.<patch>``),
but with minor syntax differences to satisfy python package
`version specifiers <https://packaging.python.org/en/latest/specifications/version-specifiers/>`_.

Until a stable version is released (end of beta), new versions may contain backward-incompatible changes,
but we will strive to deprecate features first instead of immediately removal.
After that, breaking changes will only be introduced in major versions.

.. include:: changelog/changelog_body.rst
Empty file.
26 changes: 26 additions & 0 deletions docs/changelog/fragments/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
This directory contains "news fragments" which are short files that contain a small **ReST**-formatted
text that will be added to the next ``CHANGELOG``.

The ``CHANGELOG`` will be read by **users**, so this description should be aimed to pytest users
instead of describing internal changes which are only relevant to the developers.

Make sure to use full sentences in the **past or present tense** and use punctuation, examples::

Improved verbose diff output with sequences.

Terminal summary statistics now use multiple colors.

Each file should be named like ``<ISSUE>.<TYPE>.rst``, where
``<ISSUE>`` is an issue number, and ``<TYPE>`` is one of:

* ``breaking``: a change which may break existing suites, such as feature removal or behavior change.
* ``deprecation``: feature deprecation.
* ``feature``: new user facing features, like new command-line options and new behavior.
* ``bugfix``: fixes a bug.
* ``other``: any

So for example: ``123.feature.rst``, ``456.bugfix.rst``.

If your PR fixes an issue, use that number here. If there is no issue,
then after you submit the PR and get the PR number you can add a
changelog using that instead.
44 changes: 44 additions & 0 deletions docs/changelog/template.rst.jinja2
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
{% if render_title %}
----------------------------------------------------


.. _v{{ versiondata.version }}:

`{{ versiondata.version }} <https://github.com/reagento/adaptix/tree/v{{ versiondata.version }}>`_ -- {{ versiondata.date }}
{{ top_underline * ((versiondata.version * 2 + versiondata.date)|length + 52) }}
{% endif %}
{% for section, _ in sections.items() %}
{% set underline = underlines[0] %}{% if section %}{{section}}
{{ underline * section|length }}{% set underline = underlines[1] %}

{% endif %}

{% if sections[section] %}
{% for category, val in definitions.items() if category in sections[section] %}
.. _v{{ versiondata.version }}-{{ definitions[category]['name'] }}:

{{ definitions[category]['name'] }}
{{ underline * definitions[category]['name']|length }}

{% if definitions[category]['showcontent'] %}
{% for text, values in sections[section][category].items() %}
- {{ text }}{% if values %} ({{ values|join(', ') }}){% endif %}

{% endfor %}
{% else %}
- {{ sections[section][category]['']|join(', ') }}

{% endif %}
{% if sections[section][category]|length == 0 %}
No significant changes.

{% else %}
{% endif %}

{% endfor %}
{% else %}
No significant changes.


{% endif %}
{% endfor %}
5 changes: 4 additions & 1 deletion docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
'sphinx_paramlinks',
'myst_parser',
'sphinxext.opengraph',
'sphinx_better_subsection',

# local extensions
'custom_ext.bench_tools',
Expand All @@ -60,7 +61,9 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
exclude_patterns = [
'changelog/fragments/*'
]


# -- Options for HTML output -------------------------------------------------
Expand Down
3 changes: 2 additions & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,15 @@ Adaptix
specific_types_behavior
benchmarks
API Reference <api_reference/modules>
changelog
contributing


.. toctree::
:maxdepth: 2
:caption: Project Links:

GitHub <https://github.com/reagento/adaptix/tree/3.x/develop>
GitHub <https://github.com/reagento/adaptix>
PyPI <https://pypi.org/project/adaptix>


Expand Down
35 changes: 0 additions & 35 deletions make.bat

This file was deleted.

16 changes: 16 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,3 +76,19 @@ skips = ['*/test_*.py', '*/*_test.py', 'docs/examples/*', '*/bench_*.py']
[tool.vulture]
min_confidence = 60
ignore_decorators = ['@_aspect_storage.add', '@overload', '@abstractmethod']


[tool.towncrier]
package = 'adaptix'
filename = 'docs/changelog/changelog_body.rst'
template = 'docs/changelog/template.rst.jinja2'
issue_format = '`#{issue} <https://github.com/reagento/adaptix/issues/{issue}>`_'
directory = 'docs/changelog/fragments'

type = [
{ name = "Breaking Changes", directory = "breaking", showcontent = true },
{ name = "Deprecations", directory = "deprecation", showcontent = true },
{ name = "Features", directory = "feature", showcontent = true },
{ name = "Bug Fixes", directory = "bugfix", showcontent = true },
{ name = "Other", directory = "other", showcontent = true },
]
16 changes: 13 additions & 3 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,9 @@ chardet==5.2.0
charset-normalizer==3.3.2
# via requests
click==8.1.7
# via pip-tools
# via
# pip-tools
# towncrier
cognitive-complexity==1.3.0
# via flake8-cognitive-complexity
colorama==0.4.6
Expand Down Expand Up @@ -72,6 +74,7 @@ docutils==0.20.1
# docutils-stubs
# myst-parser
# sphinx
# sphinx-better-subsection
# sphinx-paramlinks
docutils-stubs==0.0.22
# via -r requirements/raw/doc.txt
Expand Down Expand Up @@ -106,7 +109,7 @@ flake8-noqa==1.3.2
# via -r requirements/raw/lint.txt
flake8-polyfill==1.0.2
# via -r requirements/raw/lint.txt
fonttools==4.46.0
fonttools==4.47.0
# via matplotlib
furo==2023.9.10
# via -r requirements/raw/doc.txt
Expand All @@ -126,6 +129,8 @@ idna==3.6
# via requests
imagesize==1.4.1
# via sphinx
incremental==22.10.0
# via towncrier
iniconfig==2.0.0
# via pytest
invoke==2.2.0
Expand All @@ -136,9 +141,10 @@ jinja2==3.1.2
# via
# myst-parser
# sphinx
# towncrier
kiwisolver==1.4.5
# via matplotlib
lxml==4.9.3
lxml==4.9.4
# via astpath
mando==0.7.1
# via radon
Expand Down Expand Up @@ -290,6 +296,8 @@ sphinx==7.2.6
# sphinxext-opengraph
sphinx-basic-ng==1.0.0b2
# via furo
sphinx-better-subsection==0.2
# via -r requirements/raw/doc.txt
sphinx-copybutton==0.5.2
# via -r requirements/raw/doc.txt
sphinx-design==0.5.0
Expand Down Expand Up @@ -322,6 +330,8 @@ toml==0.10.2
# via vulture
tomlkit==0.12.3
# via pylint
towncrier==23.11.0
# via -r requirements/raw/dev.txt
tox==4.11.4
# via -r requirements/raw/runner.txt
typing-extensions==4.9.0
Expand Down
3 changes: 3 additions & 0 deletions requirements/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ docutils==0.20.1
# docutils-stubs
# myst-parser
# sphinx
# sphinx-better-subsection
# sphinx-paramlinks
docutils-stubs==0.0.22
# via -r requirements/raw/doc.txt
Expand Down Expand Up @@ -124,6 +125,8 @@ sphinx==7.2.6
# sphinxext-opengraph
sphinx-basic-ng==1.0.0b2
# via furo
sphinx-better-subsection==0.2
# via -r requirements/raw/doc.txt
sphinx-copybutton==0.5.2
# via -r requirements/raw/doc.txt
sphinx-design==0.5.0
Expand Down
7 changes: 5 additions & 2 deletions requirements/lint.txt
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ docutils==0.20.1
# docutils-stubs
# myst-parser
# sphinx
# sphinx-better-subsection
# sphinx-paramlinks
docutils-stubs==0.0.22
# via -r requirements/raw/doc.txt
Expand Down Expand Up @@ -92,7 +93,7 @@ flake8-noqa==1.3.2
# via -r requirements/raw/lint.txt
flake8-polyfill==1.0.2
# via -r requirements/raw/lint.txt
fonttools==4.46.0
fonttools==4.47.0
# via matplotlib
furo==2023.9.10
# via -r requirements/raw/doc.txt
Expand Down Expand Up @@ -122,7 +123,7 @@ jinja2==3.1.2
# sphinx
kiwisolver==1.4.5
# via matplotlib
lxml==4.9.3
lxml==4.9.4
# via astpath
mando==0.7.1
# via radon
Expand Down Expand Up @@ -262,6 +263,8 @@ sphinx==7.2.6
# sphinxext-opengraph
sphinx-basic-ng==1.0.0b2
# via furo
sphinx-better-subsection==0.2
# via -r requirements/raw/doc.txt
sphinx-copybutton==0.5.2
# via -r requirements/raw/doc.txt
sphinx-design==0.5.0
Expand Down
1 change: 1 addition & 0 deletions requirements/raw/dev.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
coverage==7.3.3
pip-tools==7.3.0
setuptools==69.0.0
towncrier==23.11.0

-r runner.txt
-r lint.txt
Expand Down
1 change: 1 addition & 0 deletions requirements/raw/doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ sphinx-design==0.5.0
sphinx-paramlinks==0.6.0
myst-parser==2.0.0
sphinxext-opengraph==0.9.1
sphinx-better-subsection==0.2

sphinxcontrib-apidoc==0.4.0
furo==2023.9.10
Expand Down

0 comments on commit 29f1168

Please sign in to comment.