Skip to main content

This project provides tools to manage changelog files.

Project description

changelog-tools

This project provides tools to manage changelog files, according to the Keep a Changelog format.

Get started

Requirements

  • python3 >= 3.8
apt install python3 python3-pip python3-venv

Create a virtual env:

python3 -m venv venv
source venv/bin/activate

Then, install the requirements:

pip3 install -r requirements.dev.txt

Tools

Usage

cd src
python3 -m changelog_tools <command> [options]
python3 -m changelog_tools --help  # Display usage information and a list of the provided commands.

Available commands

get

Check and display the latest version of a changelog file, which is by default the CHANGELOG.md file in the current directory.

python3 -m changelog_tools get

<CHANGELOG_PATH> (optional)

Specifies a changelog path. If given path is a directory, the tool defaults a CHANGELOG.md file in that directory.

python3 -m changelog_tools get data/CHANGELOG.md

summarize

To get a list of changes between two versions, run the script:

python3 -m changelog_tools summarize --old <old_version> --new <new_version> <changelog_path>

--old (optional) Specifies a version from which to start looking for changes. This version corresponds to the lowest/oldest of the file. If not provided, the tool defaults to the initial version. If provided version does not exist in the file, it'll raise an error.

--new (optional) Specifies a version to end looking for changes. This version corresponds to the highest/latest version of the file. If not provided, the tool defaults to the latest version. If provided version does not exist in the file, it'll raise an error.

--include_unreleased (optional) Set by default to False. It is used to include unreleased items to the output, if needed.

<CHANGELOG_PATH> (optional)

Specifies a changelog path. If given path is a directory, the tool defaults a CHANGELOG.md file in that directory.

Example of what you'll get

Summary with different sections sorted by alphabetical order.

# Changelog summary

Here are all the changes between 0.0.1 and 0.0.3:

### Added

- v1.1 Brazilian Portuguese translation.
- v1.1 German Translation.
- v1.1 Spanish translation.

### Changed

- Use frontmatter title & description in each language version template.
- Replace broken OpenGraph image with an appropriately-sized Keep a Changelog image that will render properly (although in English for all languages).

Tests

Unit tests

To run the unit tests, you need to use this command line:

python3 -m unittest <file.py> # Run a specific test file
python3 -m unittest discover <directory> # Run all tests files from a specific directory

Integration tests

To run integration tests, you need to use this command line:

./tests/integration_tests/test_app.sh

Formatting

We use black (for the version, please refer to requirements.dev.txt file) to format code, so before committing anything, don't forget to use:

black -l 120 <directory>

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

changelog_tools-0.3.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

changelog_tools-0.3.0-py3-none-any.whl (8.7 kB view details)

Uploaded Python 3

File details

Details for the file changelog_tools-0.3.0.tar.gz.

File metadata

  • Download URL: changelog_tools-0.3.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for changelog_tools-0.3.0.tar.gz
Algorithm Hash digest
SHA256 b377dabf3056a2139183d9b3d1ed2119323150c993d001f3748089150cb342b2
MD5 6fa5e6cd032301cc6ea33f5126a98548
BLAKE2b-256 21e12ec6a6d140f3560567a7a6e35917873b5f1a7b5ec8d21731b29f055a9b85

See more details on using hashes here.

File details

Details for the file changelog_tools-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for changelog_tools-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 fd4e6225954b10ae1e9e46be4af1021ae033f76d8efa372dfeb2e1dfb5321e8f
MD5 7cb6430258121c7078104351125fd273
BLAKE2b-256 cef927c1fe9b3d3058b0d5d5ce311ce7fb936f887ade55684362f1d1682167a2

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page