Skip to content

Commit

Permalink
Migrated to use towncrier for change logs
Browse files Browse the repository at this point in the history
Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
  • Loading branch information
andy-maier committed Dec 19, 2024
1 parent a337537 commit fa37888
Show file tree
Hide file tree
Showing 26 changed files with 303 additions and 137 deletions.
63 changes: 16 additions & 47 deletions DEVELOP.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,21 +76,19 @@ local clone of the `pywbem/pywbemtools` Git repo.
git pull
git checkout -b release_${MNU}

3. Edit the change log:
3. Update the change log:

vi docs/changes.rst
First make a dry-run to print the change log as it would be:

and make the following changes in the section of the version that is being
released:
towncrier build --draft

* Finalize the version.
* Change the release date to today's date.
* Make sure that all changes are described.
* Make sure the items shown in the change log are relevant for and
understandable by users.
* In the "Known issues" list item, remove the link to the issue tracker and
add text for any known issues you want users to know about.
* Remove all empty list items.
If you are satisfied with the change log, update the change log:

towncrier build --yes

This will update the change log file ``docs/changes.rst`` with the
information from the change fragment files in the ``changes`` directory, and
will delete these change fragment files.

4. Run the Safety tool:

Expand Down Expand Up @@ -228,60 +226,31 @@ local clone of the `pywbem/pywbemtools` Git repo.
git pull
git checkout -b start_${MNU}

3. Edit the change log:

vi docs/changes.rst

and insert the following section before the top-most section:

pywbemtools M.N.U.dev
---------------------

This version contains all fixes up to version M.N-1.x.

Released: not yet

**Incompatible changes:**

**Deprecations:**

**Bug fixes:**

**Enhancements:**

**Cleanup:**

**Known issues:**

* See `list of open issues`_.

.. _`list of open issues`: https://github.com/pywbem/pywbemtools/issues

4. Commit your changes and push them to the remote repo:
3. Commit your changes and push them to the remote repo:

git commit -asm "Start ${MNU}"
git push --set-upstream origin start_${MNU}

5. On GitHub, create a Pull Request for branch ``start_M.N.U``.
4. On GitHub, create a Pull Request for branch ``start_M.N.U``.

Important: When creating Pull Requests, GitHub by default targets the
``master`` branch. When starting a version based on a stable branch, you
need to change the target branch of the Pull Request to ``stable_M.N``.

6. On GitHub, create a milestone for the new version ``M.N.U``.
5. On GitHub, create a milestone for the new version ``M.N.U``.

You can create a milestone in GitHub via Issues -> Milestones -> New
Milestone.

7. On GitHub, go through all open issues and pull requests that still have
6. On GitHub, go through all open issues and pull requests that still have
milestones for previous releases set, and either set them to the new
milestone, or to have no milestone.

8. On GitHub, once the checks for the Pull Request for branch ``start_M.N.U``
7. On GitHub, once the checks for the Pull Request for branch ``start_M.N.U``
have succeeded, merge the Pull Request (no review is needed). This
automatically deletes the branch on GitHub.

9. Add release start tag and clean up the local repo:
8. Add release start tag and clean up the local repo:

Note: An initial tag is necessary because the automatic version calculation
done by setuptools-scm uses the most recent tag in the commit history and
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ dist_dependent_files_all := \
dist_dependent_files := $(filter-out $(version_file), $(dist_dependent_files_all))

# Packages whose dependencies are checked using pip-missing-reqs
check_reqs_packages := pytest coverage coveralls flake8 pylint twine safety sphinx
check_reqs_packages := pytest coverage coveralls flake8 pylint twine safety sphinx towncrier

# Scripts are required to install the OS-level components of pywbem.
ifeq ($(PLATFORM),Windows_native)
Expand Down
2 changes: 2 additions & 0 deletions changes/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Keep this directory in git even if empty
!.gitignore
1 change: 1 addition & 0 deletions changes/1390.incompatible.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Removed support for Python 2.7, 3.6, and 3.7.
2 changes: 2 additions & 0 deletions changes/1395.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Development: Changed release process to use a GitHub Actions workflow and
documented that in DEVELOP.md.
2 changes: 2 additions & 0 deletions changes/1405.cleanup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Removed code and tests that depends on the differences between Python 3.8+ and
on differences between pywbem 1.0.0 and earlier versions of Python.
6 changes: 6 additions & 0 deletions changes/1423.cleanup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Refactored pywbemcli tests to avoid hiding the default connection file and
the names for the connection file and mock cache by moving as part of tests.
EnvVar PYWBEMCLI_ALT_HOME_DIR defines alternate directory for connection file
and mockcache and is set for all pywbemcli tests. The definition of file
names for default connection file and mock cache managed by pywbemcli moved
from pywbemtools/pywbemcli/_utils.py to pywbemcli/_connection_file_names.py.
1 change: 1 addition & 0 deletions changes/1429.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Added support for and testing on Python 3.13.
2 changes: 2 additions & 0 deletions changes/1432.fix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Development: Increased minimum versions of PyYAML to 6.0.2 and psutil to 6.0.0,
to fix install errors with Python 3.13 on Windows.
1 change: 1 addition & 0 deletions changes/1436.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Development: Migrated to use towncrier for change logs.
3 changes: 3 additions & 0 deletions changes/1441.cleanup.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Used click-repl version 3 forked. Currently this is using a forked version
since the proposed changes to fix issues have not been incorporated into a
released version of click-repl.
77 changes: 77 additions & 0 deletions changes/changes.rst.j2
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
{#
# Jinja2 template for towncrier to generate the change log from change fragments.
#
# Input variables (as of towncrier 22.8.0):
# - render_title (bool): Indicates whether a title should be rendered by the
# template. If False, the title is being added by towncrier to the result of
# the template.
# - sections: The change fragments, as a dict with key: section
# name, value: dict with key: category (=type) name, value: dict with key:
# change fragment text, value: list of issues.
# - definitions: The definitions of change categories (=types), as a dict
# with key: type name, value: dict with items 'name', 'showcontent'.
# - underlines (str): The underline characters to use for the different heading
# levels (following the top heading level)
# - versiondata (dict): Project name and version data, as a dict with items
# 'name', 'version', 'date'.
# - top_underline (str): The underline character to be used for the title
# of the change log when the template generates the title.
# - get_indent (func): Function to get the indentation for subsequent lines
# given the first line of a multi-line change fragment text.
#}
{% if render_title %}
{% if versiondata.name %}
{{ versiondata.name }} {{ versiondata.version }} ({{ versiondata.date }})
{{ top_underline * ((versiondata.name + versiondata.version + versiondata.date)|length + 4)}}
{% else %}
{{ versiondata.version }} ({{ versiondata.date }})
{{ top_underline * ((versiondata.version + versiondata.date)|length + 3)}}
{% endif %}
{% endif %}

Released: {{ versiondata.date }}

{% 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] and category != 'notshown' %}
**{{ definitions[category]['name'] }}:**

{% if definitions[category]['showcontent'] %}
{% for text, values in sections[section][category].items() %}
{% set issue_values = [] %}
{% for v in values if 'noissue' not in v %}
{% set _ = issue_values.append(v) %}
{% endfor %}
{% set issue_values_str = ' (' + issue_values|join(', ') + ')' if issue_values else '' %}
* {{ text }}{{ issue_values_str }}

{% endfor %}
{% else %}
{% set issue_values = [] %}
{% for v in sections[section][category][''] if 'noissue' not in v %}
{% set _ = issue_values.append(v) %}
{% endfor %}
{% if issue_values %}
* {{ issue_values|join(', ') }}

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

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

{% endif %}
{% endfor %}
{{ '' }}
{{ '' }}
10 changes: 10 additions & 0 deletions changes/noissue.1.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Development: Migrated from setup.py to pyproject.toml since that is the
recommended direction for Python packages. The make targets have not changed.
The content of the wheel and source distribution archives has not changed.

Some files have been renamed:
- minimum-constraints.txt to minimum-constraints-develop.txt
- .safety-policy-all.yml to .safety-policy-develop.yml

Removed pywbem/_version_scm.py from git tracking, because it is now
dynamically created when building the distribution.
1 change: 1 addition & 0 deletions changes/noissue.1.fix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Development: Fixed new issues reported by Pylint 3.2 and 3.3.
4 changes: 4 additions & 0 deletions changes/noissue.1.incompatible.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
The migration from setup.py to pyproject.toml removed the possibility to run
setup.py as a command, for example to install or test pywbemtools. Note that
running setup.py as a command has been deprecated by the Python setuptools
team.
5 changes: 5 additions & 0 deletions changes/noissue.2.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Development: The pywbem version during development now uses an automatically
calculated dev number and the git commit hash, e.g. '1.4.0a1.dev9+gad875911'.
The pywbem version numbers for packages released to Pypi are unchanged: 'M.N.U'.
Updated the release description in DEVELOP.md to no longer edit the version
file.
3 changes: 3 additions & 0 deletions changes/noissue.2.fix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Test: Fixed the issue that coveralls was not found in the test workflow on MacOS
with Python 3.9-3.11, by running it without login shell. Added Python 3.11 on
MacOS to the normal tests.
2 changes: 2 additions & 0 deletions changes/noissue.3.fix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Development: Fixed pydantic install issue on Python 3.13 by excluding
safety-schemas version 0.0.7.
2 changes: 2 additions & 0 deletions changes/noissue.4.fix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Test: Python 3.13 was pinned to 3.13.0 to work around a pylint issue on
Python 3.13.1.
1 change: 1 addition & 0 deletions changes/noissue.safety.fix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fixed safety issues up to 2024-11-30.
3 changes: 3 additions & 0 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
# Build distribution archive
build>=1.1.1

# Change log
towncrier>=22.8.0

# Unit test (imports into testcases):
# pytest 4.3.1 solves an issue on Python 3 with minimum package levels
pytest>=4.3.1
Expand Down
93 changes: 6 additions & 87 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,93 +4,12 @@
Change log
==========


pywbemtools 1.4.0.dev1
----------------------

This version contains all fixes up to version 1.3.x.

Released: not yet

**Incompatible changes:**

* Removed support for Python 2.7, 3.6, and 3.7. (issue #1390)

* The migration from setup.py to pyproject.toml removed the possibility to run
setup.py as a command, for example to install or test pywbemtools. Note that
running setup.py as a command has been deprecated by the Python setuptools
team.

**Deprecations:**

**Bug fixes:**

* Addressed safety issues up to 2024-11-30.

* Fixed new issues reported by Pylint 3.2 and 3.3.

* Test: Fixed the issue that coveralls was not found in the test workflow on MacOS
with Python 3.9-3.11, by running it without login shell. Added Python 3.11 on
MacOS to the normal tests.

* Increased minimum versions of PyYAML to 6.0.2 and psutil to 6.0.0, to fix
install errors with Python 3.13 on Windows. (related to issue #3225)

* Dev: Fixed pydantic install issue on Pyhton 3.13 by excluding safety-schemas
version 0.0.7

* Test: Python 3.13 was pinned to 3.13.0 to work around a pylint issue on
Python 3.13.1.

**Enhancements:**

* Added support for and testing on Python 3.13. (issue #1429)

* Development: Changed release process to use a GitHub Actions workflow
add as documented in DEVELOP.md. (issue #1395)

* Development: Migrated from setup.py to pyproject.toml since that is the
recommended direction for Python packages. The make targets have not changed.
The content of the wheel and source distribution archives has not changed.

Some files have been renamed:
- minimum-constraints.txt to minimum-constraints-develop.txt
- .safety-policy-all.yml to .safety-policy-develop.yml

Removed pywbem/_version_scm.py from git tracking, because it is now
dynamically created when building the distribution.

* Development: The pywbem version during development now uses an automatically
calculated dev number and the git commit hash, e.g. ``1.4.0a1.dev9+gad875911``.
The pywbem version numbers for packages released to Pypi are unchanged: M.N.U.
Updated the release description in DEVELOP.md to no longer edit the version
file.

**Cleanup:**

* Remove code and tests that depends on the differences between python 3.8+ and
on differences between pywbem 1.0.0 and earlier versions of python.
(issue #1405)

* Refactor pywbemcli tests to avoid hiding the default connection file and
the names for the connection file and mock cache by moving as part of tests.
EnvVar PYWBEMCLI_ALT_HOME_DIR defines alternate directory for connection file
and mockcache and is set for all pywbemcli tests. The definition of file
names for default connection file and mock cache managed by pywbemcli moved
from pywbemtools/pywbemcli/_utils.py to pywbemcli/_connection_file_names.py.
(issue # 1423)

* Use click-repl version 3 forked. Currently this is using a forked version since the
proposed changes to fix issues (see issue #1441) have not been incorporated
into a released version of click-repl.

**Known issues:**

* See `list of open issues`_.

.. _`list of open issues`: https://github.com/pywbem/pywbemtools/issues


.. ============================================================================
..
.. Do not add change records here directly, but create fragment files instead!
..
.. ============================================================================
.. towncrier start
pywbemtools 1.3.0
-----------------

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,8 +98,8 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns = ["testsuite", ".tox", ".git", "attic", "dist", "irecv",
"tools", "packaging", "build_doc", "pywbemtools.egg-info",
".eggs"]
"tools", "changes", "packaging", "build_doc",
"pywbemtools.egg-info", ".eggs"]

# The reST default role (used for this markup: `text`) to use for all
# documents. None means it is rendered in italic, without a link.
Expand Down
Loading

0 comments on commit fa37888

Please sign in to comment.