Skip to main content

releaseup

releaseup

CI Documentation Status pre-commit.ci status codecov discussion

Python Versions Package Version Downloads License black

An extractive NLP approach for generating release notes from comments and docstrings added between two git tags.

releaseup extracts all the comments and docstrings using git diff, preprocesses the outputs, and finally generates release notes using sklearn's TfidfVectorizer and spacy! The generated release notes are not at all abstractive, which is something releaseup aims to achieve in the future.

As of now, releaseup is a holiday project (built in mere 2 days), but I do intend to maintain it in the future. releaseup does work, but only if your comments are well written.

Read more about releaseup through its documentation.

Structure

  • All the extraction and preprocessing work is carried out using the extract module.
  • All the extractive NLP work is done inside the nlp_backend module.
  • releaseup also prvides a high level API present inn the high_level module.

See examples for more information.

Installation

Use pip magic

releaseup uses modern Python packaging and can be installed using pip -

python -m pip install releaseup

For developer install, see our Contributing Guidelines.

Examples

High level API

import releaseup

tag = ["v0.8.0", "v0.9.0"]  # can also be commits
path = "././mypackage/"  # to ignore changes made to other folders (./github/, docs/, etc) and files
comments_filename = "COMMENTS.txt"

# extract added comments and docstrings
comments = releaseup.extract_release_comments(tags, path, comments_filename)

release_filename = "RELEASE_NOTES.txt"

# generate release notes
notes = releaseup.generate_release_notes(
    comments,
    release_filename,
    model_name="en_core_web_trf",  # any spacy model
    threshold=0.3,  # percentage of comments to be selected
)

Low level API

from releaseup.extract import (
    extract_additions,
    get_comments_and_docstrings,
    get_diff,
    preprocess_additions,
)
from releaseup.nlp_backend import get_release_notes, get_tfid_scores

tag = ["v0.8.0", "v0.9.0"]  # can also be commits
path = "././mypackage/"  # to ignore changes made to other folders (./github/, docs/, etc) and files
comments_filename = "COMMENTS.txt"

# extract added comments and docstrings
get_diff(tags, path, comments_filename)
extracted_additions = extract_additions(comments_filename)
preprocessed_additions = preprocess_additions(extracted_additions)
comments = get_comments_and_docstrings(preprocessed_additions)

release_filename = "RELEASE_NOTES.txt"

word_score = get_tfid_scores(comments)
release_notes = get_release_notes(
    comments,
    word_score,
    release_filename,
    model_name="en_core_web_trf",  # any spacy model
    threshold=0.3,  # percentage of comments to be selected
)

Testing

TODO: ADD TESTS

Activating pre-commit

releaseup uses a set of pre-commit hooks and the pre-commit bot to format, type-check, and prettify the codebase. The hooks can be installed locally using -

pre-commit install

This would run the checks every time a commit is created locally. The checks will only run on the files modified by that commit, but the checks can be triggered for all the files using -

pre-commit run --all-files

If you would like to skip the failing checks and push the code for further discussion, use the --no-verify option with git commit.

Documenting releaseup

releaseup's documentation is mainly written in the form of docstrings and Markdown. The docstrings include the description, arguments, examples, return values, and attributes of a class or a function, and the .md files enable us to render this documentation on releaseup's documentation website.

releaseup primarily uses MkDocs and mkdocstrings for rendering documentation on its website. The configuration file (mkdocs.yml) for MkDocs can be found here. The documentation is deployed on https://readthedocs.io here.

Ideally, with the addition of every new feature to releaseup, documentation should be added using comments, docstrings, and .md files.

Building documentation locally

The documentation is located in the docs folder of the main repository. This documentation can be generated using the docs dependencies of releaseup in the following way -

mkdocs serve

The commands executed above will clean any existing documentation build, create a new build (in ./site/), and serve it on your localhost. To just build the documentation, use -

mkdocs build

Nox

The fastest way to start with development is to use nox. If you don't have nox, you can use pipx run nox to run it without installing, or pipx install nox. If you don't have pipx (pip for applications), then you can install with with pip install pipx (the only case were installing an application with regular pip is reasonable). If you use macOS, then pipx and nox are both in brew, use brew install pipx nox.

To use, run nox. This will lint and test using every installed version of Python on your system, skipping ones that are not installed. You can also run specific jobs:

$ nox -s lint  # Lint only
$ nox -s tests-3.9  # Python 3.9 tests only
$ nox -s docs -- serve  # Build and serve the docs
$ nox -s build  # Make an SDist and wheel

The default sessions (lint and tests) can be executed using -

nox

Continuous Integration

releaseup uses GitHub Actions as a CI provider to run tests, build docs, release on PyPI, test package, etc. All the configuration for GitHub Actions is written in YAML, present in .github/ directory. The CI runs every time a pull request is made or a push is made to the main branch.

Continuous Deployment

releaseup uses Read The Docs as a CD provider to deploy documentation. All the configuration for Read The Docs is written in YAML, present in the .readthedocs.yml file. The CD runs every time a push is made to the main branch.

Credits

Logo image credits: Taufik Ramadhan (taken from canva)

Metadata

Release files for releaseup 0.1.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 releaseup 0.1.1
File Size Uploaded Provenance
releaseup-0.1.1.tar.gz 18.4 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 27.2 kB

Release files / releaseup-0.1.1.tar.gz

Download URL releaseup-0.1.1.tar.gz
Size 18.4 kB
Tags Source
SHA-256 checksum
How to use checksums
f6c1237c0f91bce966ebf6d5cdf7ff80e25216a0bb3c90bdfd4ddea86e606b92
BLAKE2b-256 checksum
How to use checksums
4ecdc30c6009453bc93bee4507073139c1764331593bea0952e06b4b3cf70e8c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Release files / releaseup-0.1.1-py3-none-any.whl

Download URL releaseup-0.1.1-py3-none-any.whl
Size 8.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cc39f53c0ab332725d6b1a21f283de4ce616610ee843fe6b899bc6209fda9138
BLAKE2b-256 checksum
How to use checksums
c0878bb70c755661ac7caf6e7156cb03da2f4b54a388a7a51a0a8b5c8a57f0c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.5

Security for releaseup 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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