Skip to main content

Overwrite __version__ in a package's __init__.py with the version from pyproject.toml

Project description

verbake

A simple script that copies the value of version from pyproject.toml and uses it to overwrite the value of __version__ in a package's main __init__.py.

This is for getting around the problem of needing to remember to manually version bump both pyproject.toml and __init__.py (for those packages that need the version in both places) every time you update your project.

This also helps avoid an error that occurs when testing your package in remote environments like GitHub Actions which is caused by dynamically setting __version__ using importlib.metadata and other methods.

Install

pip install verbake

Usage

from baker import bake
bake()

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

verbake-0.2.2.tar.gz (1.6 kB view hashes)

Uploaded Source

Built Distribution

verbake-0.2.2-py3-none-any.whl (2.2 kB view hashes)

Uploaded Python 3

Supported by

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