Skip to content
Back to top
View this page
Edit this page

# pontos.version.project package

class pontos.version.project.Project(versioning_scheme, *, project_types=None)

  A project for handling versioning

  Example

      from pontos.version.scheme import PEP440VersioningScheme
      from pontos.version.project import Project

      project = Project(PEP440VersioningScheme)

  Creates a new project instance

  Parameters:

    - versioning_scheme (VersioningScheme | Type[VersioningScheme]) – Scheme for version handling

    - project_types (Iterable[ProjectType] | None) – Project types to use for version information. Default is to consider all project types.

  Raises:

    ProjectError – If no fitting VersionCommand could be found

  update_version(new_version, *, force=False)

    Update the current version of this project

    Parameters:

      - new_version (Version) – Use this version in the update

      - force (bool) – Force updating the version even if the current version is the same as the new version

    Returns:

      The version update including the changed files

    Return type:

      VersionUpdate

  get_current_version()

    Get the current version of the project

    Returns:

      The current version

    Return type:

      Version

  verify_version(version)

    Verify the current version of this project

    Parameters:

      version (Literal['current'] | ~pontos.version._version.Version) – Version to check against the current applied version of this project. If version is “current” the command should verify if all version information is consistent, for example if the version information in several files is the same.