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,renovate} ...

positional arguments:
  {bump,changelog,renovate}
    bump                Generate subsequent semver based on changelog fragments
    changelog           Generate changelog from fragments
    renovate            Generate changelog fragments for renovate pull requests

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 (will resolve environment variables if it starts with $)
  --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.1

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.1
File Size Uploaded
fragcha-0.2.1.tar.gz 18.6 kB Details

Built distribution (wheel)

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

Total release size: 37.3 kB

Release files / fragcha-0.2.1.tar.gz

Download URL fragcha-0.2.1.tar.gz
Size 18.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b234a28996270e7dce6ec15f1b0ae856272120584524baa58d1ed73f26ff0642
BLAKE2b-256 checksum
How to use checksums
305cc43db176d37634a17184ee19a995204e88391e8e10777be97d15b6e03757
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.1-py3-none-any.whl

Download URL fragcha-0.2.1-py3-none-any.whl
Size 18.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
15090fe6bfe4d927bcfbe7c9c4cee5986a65be1e2d4b91f807f44e7ca427dd1d
BLAKE2b-256 checksum
How to use checksums
f1421f12579ed4cb40741420593e1c4dcc2bed1d3d743f69db015e0648b807a5
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

This release

0.2.1 This release

2 release files

0.2.0

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