Skip to main content

Fragcha - Automate changelog from fragments

Installation

pip install fragcha

Usage

usage: python -m fragcha [-h] [--fragments FRAGMENTS] [--config CONFIG] {bump,changelog} ...

positional arguments:
  {bump,changelog}
    bump                Generate subsequent semver based on changelog fragments
    changelog           Generate changelog from fragments

options:
  -h, --help            show this help message and exit
  --fragments FRAGMENTS
                        Folder with changelog fragments (.yaml or .yml)
  --config CONFIG       Path to config file
usage: python -m fragcha bump [-h] --version VERSION [--output OUTPUT] [--ignore-major-zero]

options:
  -h, --help           show this help message and exit
  --version VERSION    Current version for which to generate the subsequent semver
  --output OUTPUT      File append changelog to (- for stdout)
  --ignore-major-zero  Don't treat major version 0 special (use to move from 0.X.Y to 1.0.0)
usage: python -m fragcha changelog [-h] [--version VERSION] [--output OUTPUT] [--append]

options:
  -h, --help         show this help message and exit
  --version VERSION  Version number to use in changelog header
  --output OUTPUT    File append changelog to (- for stdout)
  --append           Append to output file instead of prepending
usage: python -m fragcha renovate [-h] --data-file DATA_FILE [--section SECTION]

options:
  -h, --help            show this help message and exit
  --data-file DATA_FILE
                        Renovate data file
  --section SECTION     Section for changelog entries (default: dependencies)

This expects the DATA_FILE to use this template:

"dataFileTemplate": "{\"branchName\":\"{{{branchName}}}\",\"upgrades\":[{{#each upgrades}}{\"depName\": \"{{{depName}}}\", \"currentVersion\": \"{{{currentVersion}}}\", \"newVersion\": \"{{{newVersion}}}\"}{{#unless @last}},{{\/unless}}{{\/each}}]}"

See renovate documentation for more details.

Example changelog fragment

Without any extra configuration fragcha will check the .fragcha directory for yml and yaml files to generate a changelog from. This is an example with all sections that are available by default:

breaking_changes:
  - This is a major change, it will cause `fragcha bump` to increase the major version (except when on major version 0)
features:
  - This is a minor change, it will cause `fragcha bump` to increase the minor version
bugfixes:
  - This is a patch change, it will cause `fragcha bump` to increase the patch version
documentation:
  - This is a misc change, it will cause `fragcha bump` to increase the patch version

Example config

The build in defaults are equivalent to this fragcha.json5 being present:

{
  "sections": {
    "major": {
      "breaking_changes": "Breaking Changes"
    },
    "minor": {
      "features": "Features"
    },
    "patch": {
      "bugfixes": "Fixed bugs",
      "dependencies": "Dependency updates"
    },
    "misc": {
      "documentation": "Documentation"
    }
  },
  "renovate-template": "Updated {{ depName }} to {{ newVersion }}",
  "template": "# {{ version }}\n\
\n\
{%- for section in sections %}\n\
## {{ section.title }}\n\
{%- for change in section['changes'] %}\n\
- {{ change }}\n\
{%- endfor %}\n\
{%- endfor %}\n\
***\n\
"
}

Metadata

Release files for fragcha 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fragcha 0.2.0
File Size Uploaded
fragcha-0.2.0.tar.gz 18.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for fragcha 0.2.0
File Interpreter ABI Platform
fragcha-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 37.0 kB

Release files / fragcha-0.2.0.tar.gz

Download URL fragcha-0.2.0.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c7372bbc8b28a75cb7b684ceaace2cc6a1d3f805bbb1169058766bdbdd8235b6
BLAKE2b-256 checksum
How to use checksums
666acf876bc60067c41fa4785e7c85abf67e5d21b932989771dde60822dc153e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / fragcha-0.2.0-py3-none-any.whl

Download URL fragcha-0.2.0-py3-none-any.whl
Size 18.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
44c2d7ae20bfdec77500640128a62e5c38728a0e079326e1da72bdef58bb5a2b
BLAKE2b-256 checksum
How to use checksums
ee1b3eaae0d523e448add6fc7353ac059d1e8fc3b288fbd90c2ef7fd6b089c85
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

0.2.1

2 release files

This release

0.2.0 This release

2 release files

0.1.5

2 release files

0.1.4

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page