peltak.core.versioning

peltak.core.versioning.bump(component='patch', exact=None)[source]

Bump the given version component.

Parameters
  • component (str) –

    What part of the version should be bumped. Can be one of:

    • major

    • minor

    • patch

  • exact (str) – The exact version that should be set instead of bumping the current one.

Returns

A tuple of old and bumped version.

Return type

tuple(str, str)

peltak.core.versioning.current()[source]

Return the project’s current version.

The project is read from the first file on the ‘version.files’ list. We always use the first file on the list as the source of truth, but any changes will be written to all files specified on the list.

Returns

The current project version in MAJOR.MINOR.PATCH format. PATCH might be omitted if it’s 0, so 1.0.0 becomes 1.0 and 0.1.0 becomes 0.1.

Return type

str

peltak.core.versioning.write(version)[source]

Write the given version to the VERSION_FILE

Return type

None