stouputils.continuous_delivery.pypi module

This module contains utilities for PyPI.

  • pypi_full_routine: Upload the most recent file(s) to PyPI after updating pip and required packages and building the package.

stouputils pypi examples
update_pip_and_required_packages() int[source]

Update pip and required packages.

Returns:

Return code of the os.system call.

Return type:

int

build_package() int[source]

Build the package.

Returns:

Return code of the os.system call.

Return type:

int

upload_package(repository: str, filepath: str) int[source]

Upload the package to PyPI.

Parameters:
  • repository (str) – Repository to upload to.

  • filepath (str) – Path to the file to upload.

Returns:

Return code of the os.system call.

Return type:

int

pypi_full_routine(repository: str, dist_directory: str, last_files: int = 1, endswith: str = '.tar.gz', update_all_function: ~typing.Callable[[], int] = <function update_pip_and_required_packages>, build_package_function: ~typing.Callable[[], int] = <function build_package>, upload_package_function: ~typing.Callable[[str, str], int] = <function upload_package>) None[source]

Upload the most recent file(s) to PyPI after updating pip and required packages and building the package.

Parameters:
  • repository (str) – Repository to upload to.

  • dist_directory (str) – Directory to upload from.

  • last_files (int) – Number of most recent files to upload. Defaults to 1.

  • endswith (str) – End of the file name to upload. Defaults to “.tar.gz”.

  • update_all_function (Callable[[], int]) – Function to update pip and required packages. Defaults to update_pip_and_required_packages.

  • build_package_function (Callable[[], int]) – Function to build the package. Defaults to build_package.

  • upload_package_function (Callable[[str, str], int]) – Function to upload the package. Defaults to upload_package.

Returns:

Return code of the command.

Return type:

int