Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding replaceable release notes to the cookiecutter #41

Closed
Zeitsperre opened this issue May 13, 2024 · 0 comments · Fixed by #48
Closed

Adding replaceable release notes to the cookiecutter #41

Zeitsperre opened this issue May 13, 2024 · 0 comments · Fixed by #48
Labels
enhancement New feature or request wontfix This will not be worked on

Comments

@Zeitsperre
Copy link

Description

This is a desirable feature that relies on changes in bump-my-version. Adapted from code originally introduced in #38.

It would be great to have a way of replacing the entries in the release notes on each version bump. Unfortunately, this doesn't work with the current implementation of bump-my-version when using build-incrementing patterns (see: callowayproject/bump-my-version#189).

For reference, one way of using both cookiecutter and jinja templating to have the underline of the built project respect the length of the entry line would resemble the following:

[[tool.bumpversion.files]]
filename = "CHANGES.rst"
search = """\
`Unreleased <https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}>`_ (latest)
{{ '-' * ('`Unreleased <https://github.com/' + cookiecutter.github_username + '/' + cookiecutter.project_slug + '>`_ (latest)')|length }}
"""
replace = """\
`Unreleased <https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}>`_ (latest)
{{ '-' * ('`Unreleased <https://github.com/' + cookiecutter.github_username + '/' + cookiecutter.project_slug + '>`_ (latest)')|length }}

Contributors:

Changes
^^^^^^^
* No change.

Fixes
^^^^^
* No change.

.. _changes_{new_version}:

`v{new_version} <https://github.com/{{ cookiecutter.github_username }}/{{ cookiecutter.project_slug }}/tree/{new_version}>`_
{{ '-' * ('`v' + cookiecutter.version + ' <https://github.com/' + cookiecutter.github_username + '/' + cookiecutter.project_slug + '/tree/' + cookiecutter.version + '>`_ (latest)')|length }}
"""
@Zeitsperre Zeitsperre added enhancement New feature or request wontfix This will not be worked on labels May 13, 2024
Zeitsperre added a commit to hydrologie/xdatasets that referenced this issue Jul 4, 2024
### What kind of change does this PR introduce?

* Updates the cookiecutter to the latest commit.
* The `ruff` linter has been adjusted to render the `flake8-alphabetize`
dependency redundant (and removed).
* Several `noqa` and `fixme` statements have been added to pass
additional linting checks for now.

### Does this PR introduce a breaking change?

Yes. 
* The structure of the package is slightly modified from a flat layout
to a src layout.
(https://packaging.python.org/en/latest/discussions/src-layout-vs-flat-layout/)
* `CHANGES.rst` is now `CHANGELOG.rst`.
(https://keepachangelog.com/en/1.1.0/#frequently-asked-questions)
* Bumping a release version will trigger changes in the `CHANGELOG.rst`
file. (Ouranosinc/cookiecutter-pypackage#41)

### Other information:

~This does not yet integrate changes from
Ouranosinc/cookiecutter-pypackage#50 (but it
should before merging)~

We should perform a release after this and then see about proposing the
package to `conda-forge`!
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request wontfix This will not be worked on
Projects
None yet
1 participant