Skip to content

Commit

Permalink
Merge pull request #30 from solo-spice/28-configure-towncrier
Browse files Browse the repository at this point in the history
Configure towncrier
  • Loading branch information
ebuchlin authored Aug 21, 2023
2 parents 735949b + ae633fd commit 61751f7
Show file tree
Hide file tree
Showing 7 changed files with 90 additions and 7 deletions.
Empty file added CHANGELOG.rst
Empty file.
7 changes: 6 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
.PHONY: build install install-editable, test, test-htmlcov, pre-commit, show-version, doc-html, publish
.PHONY: build install install-editable, test, test-htmlcov, pre-commit, show-version, doc-html, changelog publish

build:
python3 -m build
Expand All @@ -16,8 +16,13 @@ show-version:
python -m setuptools_scm
doc-html:
make -C docs html
changelog:
towncrier
publish:
@echo "Please make sure that:"
@echo "* you are an authorized user for this operation"
@echo "* you have run towncrier and checked the new entries in the change log"
@echo "* the documentation is up-to-date with the changes"
@echo "* changes have been merged to the main branch, with correct git tag in Github and version information in sospice/_version.py"
@echo "* a build has been done for this version"
@echo "Please press <Enter> to confirm"
Expand Down
1 change: 1 addition & 0 deletions changelog/29.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Take into account effect of dark map subtraction on read and dark noises
34 changes: 34 additions & 0 deletions changelog/README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
=========
Changelog
=========

.. note::

This README was adapted from the pytest changelog readme under the terms of the MIT licence.

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 at SunPy users instead of describing internal changes which are only relevant to the developers.

Make sure to use full sentences with correct case and punctuation, for example::

Add support for PSF correction`.

Please try to use Sphinx intersphinx using backticks.

Each file should be named like ``<PULL REQUEST>.<TYPE>[.<COUNTER>].rst``, where ``<PULL REQUEST>`` is a pull request number, ``COUNTER`` is an optional number if a PR needs multiple entries with the same type and ``<TYPE>`` is one of:

* ``breaking``: A change which requires users to change code and is not backwards compatible. (Not to be used for removal of deprecated features.)
* ``feature``: New user facing features and any new behavior.
* ``bugfix``: Fixes a reported bug.
* ``doc``: Documentation addition or improvement, like rewording an entire session or adding missing docs.
* ``deprecation``: Feature deprecation
* ``removal``: Feature removal.
* ``trivial``: A change which has no user facing effect or is tiny change.

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

If you are unsure what pull request type to use, don't hesitate to ask in your PR.

Note that the ``towncrier`` tool will automatically reflow your text, so it will work best if you stick to a single paragraph, but multiple sentences and links are OK and encouraged.
You can install ``towncrier`` and then run ``towncrier create --content '' 123.feature.rst`` to create a fragment, and ``towncrier --draft`` if you want to get a preview of how your change will look in the final release notes.
11 changes: 5 additions & 6 deletions docs/source/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
.. _changelog-ref:
.. _changelog:

*********
Changelog
*********

This page will contain a change log.
This page contains a change log, generated for package releases.
The corresponding issues and pull requests can be found `on
Github <https://github.com/solo-spice/sospice/>`__

.. .. changelog::
.. :towncrier: ../
.. :towncrier-skip-if-empty:
.. :changelog_file: ../CHANGELOG.rst
.. include:: ../../CHANGELOG.rst
43 changes: 43 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,46 @@ omit = [
"tests/*",
"__init__.py",
]

[tool.towncrier]
package = "sospice"
filename = "CHANGELOG.rst"
package_dir = "."
directory = "changelog/"
issue_format = "`#{issue} <https://github.com/solo-spice/sospice/pull/{issue}>`__"
title_format = "{version} ({project_date})"

[[tool.towncrier.type]]
directory = "breaking"
name = "Breaking Changes"
showcontent = true

[[tool.towncrier.type]]
directory = "deprecation"
name = "Deprecations"
showcontent = true

[[tool.towncrier.type]]
directory = "removal"
name = "Removals"
showcontent = true

[[tool.towncrier.type]]
directory = "feature"
name = "New Features"
showcontent = true

[[tool.towncrier.type]]
directory = "bugfix"
name = "Bug Fixes"
showcontent = true

[[tool.towncrier.type]]
directory = "doc"
name = "Documentation"
showcontent = true

[[tool.towncrier.type]]
directory = "trivial"
name = "Internal Changes"
showcontent = true
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,5 @@ setuptools_scm[toml]>=7.0
Sphinx>=6.2,<7.0
sphinx-rtd-theme>=1.2.0
sunpy>=4.0
towncrier>=22.0.0
twine>=4.0

0 comments on commit 61751f7

Please sign in to comment.