rlsbl v0.40.1 /rlsbl.targets.pypi
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

python
def name(self)

#detect

python
def detect(self, dir_path)

#read_name

python
def read_name(self, dir_path)

Read the project name from pyproject.toml.

#read_metadata

python
def read_metadata(self, dir_path)

Read license and description from pyproject.toml.

#read_version

python
def read_version(self, dir_path)

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

#write_version

python
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

python
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

python
def version_file(self)

#tag_format

python
def tag_format(self, version)

#template_dir

python
def template_dir(self)

#template_vars

python
def template_vars(self, dir_path)

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

#template_mappings

python
def template_mappings(self)

#build

python
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

python
def _build_with_rewrite(self, dir_path, pyproject_path, rewrite_map)

Copy project to a temp dir with rewritten deps, then build.

#build_assets

python
def build_assets(self, dir_path, version, dist_dir)

Build sdist and wheel for GH Release upload.

#publish

python
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

python
def check_project_exists(self, dir_path)

#get_project_init_hint

python
def get_project_init_hint(self)

#dev_install_command

python
def dev_install_command(self, project_dir)