Packaging Module Docs

autosemver.packaging.create_authors(project_dir='.')

Creates the authors file, if not in a package.

Returns:None
Raises:RuntimeError – If the authors could not be retrieved
autosemver.packaging.create_changelog(project_dir='.', bugtracker_url='', rpm_format=False)

Creates the changelog file, if not in a package.

Parameters:
  • project_dir (str) – Path to the git repo of the project.
  • bugtracker_url (str) – Url to the bug tracker for the issues.
  • rpm_format (bool) – if set to True, will make the changelog rpm-compatible.
Rises RuntimeError:
 

If the changelog could not be retrieved

autosemver.packaging.create_releasenotes(project_dir='.', bugtracker_url='')

Creates the release notes file, if not in a package.

Parameters:
  • project_dir (str) – Path to the git repo of the project.
  • bugtracker_url (str) – Url to the bug tracker for the issues.
Returns:

None

Raises:

RuntimeError – If the release notes could not be retrieved

autosemver.packaging.get_authors(project_dir='.')

Retrieves the authors list, from the AUTHORS file (if in a package) or generates it from the git history.

Returns:List of authors
Return type:list(str)
Raises:RuntimeError – If the authors could not be retrieved
autosemver.packaging.get_changelog(project_dir='.', bugtracker_url='', rpm_format=False)

Retrieves the changelog, from the CHANGELOG file (if in a package) or generates it from the git history. Optionally in rpm-compatible format.

Parameters:
  • project_dir (str) – Path to the git repo of the project.
  • bugtracker_url (str) – Url to the bug tracker for the issues.
  • rpm_format – if set to True, will make the changelog rpm-compatible
Returns:

changelog

Return type:

str

Rises RuntimeError:
 

If the changelog could not be retrieved

autosemver.packaging.get_current_version(project_name=None, project_dir='.', repo_dir=None)

Retrieves the version of the package, checking in this order of priority:

  • From an environment variable named ${project_name}_VERSION (all in caps) if project_name was specified.
  • From the PKG-INFO file if inside a packaged distro.
  • From the git history.
Parameters:project_name (str) – Name of the project to get the version for, if none passed, will not use any environment variable override.
Returns:Version for the package.
Return type:str
Raises:RuntimeError – If the version could not be retrieved.
autosemver.packaging.get_releasenotes(project_dir='.', bugtracker_url='')

Retrieves the release notes, from the RELEASE_NOTES file (if in a package) or generates it from the git history.

Parameters:
  • project_dir (str) – Path to the git repo of the project.
  • bugtracker_url (str) – Url to the bug tracker for the issues.
Returns:

release notes

Return type:

str

Raises:

RuntimeError – If the release notes could not be retrieved