Skip to content
Back to top
View this page

# semantic_release.cli.commands.version module

semantic_release.cli.commands.version.apply_version_to_source_files(repo_dir: Path, version_declarations: Sequence[IVersionReplacer], version: Version, noop: bool = False) → list[str]

semantic_release.cli.commands.version.build_distributions(build_command: str | None, build_command_env: Mapping[str, str] | None = None, noop: bool = False) → None

  Run the build command to build the distributions.

  Parameters:

    - build_command – The build command to run.

    - build_command_env – The environment variables to use when running the build command.

    - noop – Whether or not to run the build command.

  Raises:

    BuildDistributionsError: if the build command fails

semantic_release.cli.commands.version.get_windows_env() → Mapping[str, str | None]

semantic_release.cli.commands.version.is_forced_prerelease(as_prerelease: bool, forced_level_bump: LevelBump | None, prerelease: bool) → bool

  Determine if this release is forced to have prerelease on/off. If `force_prerelease` is set then yes. Otherwise if we are forcing a specific level bump without force_prerelease, it’s False. Otherwise (`force_level is None`) use the value of `prerelease`

semantic_release.cli.commands.version.is_windows() → bool

semantic_release.cli.commands.version.last_released(repo_dir: Path, tag_format: str, add_partial_tags: bool = False) → tuple[Tag, Version] | None

semantic_release.cli.commands.version.shell(cmd: str, *, env: Mapping[str, str] | None = None, check: bool = True) → subprocess.CompletedProcess

semantic_release.cli.commands.version.version_from_forced_level(repo_dir: Path, forced_level_bump: LevelBump, translator: VersionTranslator) → Version