rlsbl v0.40.1 /rlsbl.config
On this page

Project configuration loading with layered precedence (CLI > project > user), plus publish, deploy, changelog validation, and asset size limit helpers.

#rlsbl.config

#rlsbl.config

Project configuration loading with layered precedence: CLI flags override project-level .rlsbl/config.json which overrides user-level defaults.

#load_env_file

python
def load_env_file(path)

Load KEY=VALUE pairs from a file into os.environ.

Supports ~ expansion. Ignores comments (#) and blank lines. Strips surrounding quotes from values.

#_project_config

python
def _project_config()

Resolve project config path at call time (respects cwd changes).

#read_json_config

python
def read_json_config(path)

Safely read a JSON file, returning {} on missing or malformed.

#should_tag

python
def should_tag(flags)

Returns True if tagging is enabled, checking flag > project > user > default.

#read_project_config

python
def read_project_config()

Read .rlsbl/config.json, return dict or empty dict if missing/malformed.

#read_deploy_config

python
def read_deploy_config()

Read and validate deploy targets from project config. Returns (targets, errors).

#get_publish_config

python
def get_publish_config(target_name)

Read per-target publish config from .rlsbl/config.json.

Returns a dict like {"local": True, "token_var": "PYPI_TOKEN"}. Returns empty dict if no config exists for this target.

#validate_publish_config

python
def validate_publish_config(config, target_name)

Validate per-target publish config, especially the assets schema.

Raises ValueError if:

  • assets is true but max_asset_size_mb is missing.
  • max_asset_size_mb is present but not a positive integer.

#get_changelog_validation_config

python
def get_changelog_validation_config()

Read changelog validation config from .rlsbl/config.json.

Returns the batch_limits section as a dict like {"max_commits_per_entry": 5, "max_entries_per_commit": 2, "exclusions": [{"reason": "...", "commits": [...], "entries": [{"version": "...", "line": N}]}]}.

Each exclusion object has a required "reason" string for audit purposes; "commits" and "entries" are optional lists silencing the corresponding batch_size_commits and batch_size_entries violations.

Returns an empty dict if no config or malformed.

#get_max_asset_size_mb

python
def get_max_asset_size_mb()

Read max_asset_size_mb from .rlsbl/config.json.

Controls the maximum allowed size (in megabytes) for individual files uploaded to GitHub Releases by the private post-release hook. Files exceeding this limit cause the hook to abort before uploading.

Returns an integer (default 2 if unset or missing).

#write_project_config

python
def write_project_config(key, value)

Write or update a key in .rlsbl/config.json (creates dir if needed).