On this page
PyPI release target managing version tracking in pyproject.toml, OIDC-based CI scaffolding, asset builds, dep rewriting, and dev-install.
#rlsbl.targets.pypi
#rlsbl.targets.pypi
PyPI release target that manages version tracking in pyproject.toml and scaffolds CI workflows for OIDC-based publishing to the PyPI index.
#PypiTarget
Release target for Python projects (pyproject.toml).
#name
def name(self)#detect
def detect(self, dir_path)#read_name
def read_name(self, dir_path)Read the project name from pyproject.toml.
#read_metadata
def read_metadata(self, dir_path)Read license and description from 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 and __version__ in package source.
Returns a list of relative file paths (relative to dir_path) that were modified.
#_update_dunder_version
def _update_dunder_version(self, dir_path, doc, version)Update __version__ in the package's __init__.py if present.
Returns the relative path (relative to dir_path) of the file that was modified, or None if no file was updated.
#version_file
def version_file(self)#tag_format
def tag_format(self, version)#template_dir
def template_dir(self)#template_vars
def template_vars(self, dir_path)Extract template variables from the target project's pyproject.toml.
#template_mappings
def template_mappings(self)#build
def build(self, dir_path, version)Build the package, rewriting path deps if in a monorepo context.
When the project has path dependencies (e.g., sibling packages in a monorepo), copies the project to a temp directory with rewritten pyproject.toml so the working tree is never modified. Otherwise runs uv build in place.
#_build_with_rewrite
def _build_with_rewrite(self, dir_path, pyproject_path, rewrite_map)Copy project to a temp dir with rewritten deps, then build.
#build_assets
def build_assets(self, dir_path, version, dist_dir)Build sdist and wheel for GH Release upload.
#publish
def publish(self, dir_path, version)Publish to PyPI based on per-target config and token availability.
Without config, accepts either PYPI_TOKEN or TWINE_PASSWORD. With config that sets token_var, only the named variable is consulted.
#check_project_exists
def check_project_exists(self, dir_path)#get_project_init_hint
def get_project_init_hint(self)#dev_install_command
def dev_install_command(self, project_dir)