rlsbl.targets.pypi

PyPI release target for rlsbl.

Classes

PypiTarget

Release target for Python projects (pyproject.toml).

read_version

def read_version(self, dir_path)

Read the version from pyproject.toml in the given directory.

write_version

def write_version(self, dir_path, version)

Write a new version to pyproject.toml using regex replacement.

tomllib is read-only (no stdlib TOML writer), so we use a regex to replace the version string within the [project] section only, preserving all other formatting.

template_vars

def template_vars(self, dir_path)

Extract template variables from the target project's pyproject.toml.