ci_cd

Manage configuration files for continuous integration / continuous deployment.

Classes:

ActionsManager(repo_path, templates)

Responsible for creating, updating and removing GitHub Actions workflows.

Functions:

ensure_bumpversion(repo_path, templates)

Add configuration for bumpversion to the desired repo.

get_bumpversion_filenames(templates)

Returns an iterable of filenames to have the version number bumped in.

make_actions_deploy_conda(repo_path, templates)

Add script to build Conda package and deploy to Anaconda.

make_conda_actions_ci(repo_path, templates)

Add configuration for testing conda packages on GitHub Actions to the desired repo.

make_github_ci(repo_path, templates)

Add configuration for GitHub Actions to the desired repo.

make_github_docs_test(repo_path, templates)

Add configuration for GitHub Actions documentation check to the desired repo.

make_github_flake8(repo_path, templates)

Add configuration for the Flake8 GitHub Action.

make_github_manylinux(repo_path, templates)

Add configuration for GitHub Actions manylinux wheel builds the desired repo.

make_github_mypy(repo_path, templates)

Add configuration for the mypy GitHub Action.

make_github_octocheese(repo_path, templates)

Add configuration for the OctoCheese GitHub Action.

class ActionsManager(repo_path, templates)[source]

Bases: object

Responsible for creating, updating and removing GitHub Actions workflows.

Parameters
  • repo_path (Path) – Path to the repository root.

  • templates (Environment)

New in version 2020.12.18.

Methods:

get_gh_actions_matrix()

Determines the matrix of Python versions used in GitHub Actions.

get_gh_actions_python_versions()

Prepares the mapping of Python versions to tox testenvs for use with GitHub Actions.

get_linux_ci_requirements()

Returns the Python requirements to run tests for on Linux.

get_linux_ci_versions()

Returns the Python versions to run tests for on Linux.

get_linux_mypy_requirements()

Returns the Python requirements to run tests for on Linux.

get_macos_ci_requirements()

Returns the Python requirements to run tests for on macOS.

get_macos_ci_versions()

Returns the Python versions to run tests for on macOS.

get_windows_ci_requirements()

Returns the Python requirements to run tests for on Windows.

get_windows_ci_versions()

Returns the Python versions to run tests for on Windows.

make_flake8()

Create, update or remove the flake8 action, as appropriate.

make_linux()

Create, update or remove the Linux action, as appropriate.

make_macos()

Create, update or remove the macOS action, as appropriate.

make_mypy()

Create, update or remove the mypy action, as appropriate.

make_rustpython()

Create, update or remove the RustPython action, as appropriate.

make_windows()

Create, update or remove the Windows action, as appropriate.

get_gh_actions_matrix()[source]

Determines the matrix of Python versions used in GitHub Actions.

New in version $VERSION.

Return type

Dict[str, Tuple[str, bool]]

get_gh_actions_python_versions()[source]

Prepares the mapping of Python versions to tox testenvs for use with GitHub Actions.

New in version 2020.12.21.

Return type

Dict[str, str]

get_linux_ci_requirements()[source]

Returns the Python requirements to run tests for on Linux.

Return type

List[str]

get_linux_ci_versions()[source]

Returns the Python versions to run tests for on Linux.

Return type

List[str]

get_linux_mypy_requirements()[source]

Returns the Python requirements to run tests for on Linux.

Return type

List[str]

get_macos_ci_requirements()[source]

Returns the Python requirements to run tests for on macOS.

Return type

List[str]

get_macos_ci_versions()[source]

Returns the Python versions to run tests for on macOS.

Return type

List[str]

get_windows_ci_requirements()[source]

Returns the Python requirements to run tests for on Windows.

Return type

List[str]

get_windows_ci_versions()[source]

Returns the Python versions to run tests for on Windows.

Return type

List[str]

make_flake8()[source]

Create, update or remove the flake8 action, as appropriate.

New in version 2021.8.11.

Return type

PathPlus

make_linux()[source]

Create, update or remove the Linux action, as appropriate.

Return type

PathPlus

make_macos()[source]

Create, update or remove the macOS action, as appropriate.

Return type

PathPlus

make_mypy()[source]

Create, update or remove the mypy action, as appropriate.

New in version 2020.1.27.

Return type

PathPlus

make_rustpython()[source]

Create, update or remove the RustPython action, as appropriate.

Return type

PathPlus

make_windows()[source]

Create, update or remove the Windows action, as appropriate.

Return type

PathPlus

ensure_bumpversion(repo_path, templates)[source]

Add configuration for bumpversion to the desired repo.

https://pypi.org/project/bumpversion/

Parameters
  • repo_path (Path) – Path to the repository root.

  • templates (Environment)

Return type

List[str]

get_bumpversion_filenames(templates)[source]

Returns an iterable of filenames to have the version number bumped in.

New in version 2021.3.8.

Parameters

templates (Environment)

Return type

Iterable[str]

make_actions_deploy_conda(repo_path, templates)[source]

Add script to build Conda package and deploy to Anaconda.

Parameters
  • repo_path (Path) – Path to the repository root.

  • templates (Environment)

Return type

List[str]

make_conda_actions_ci(repo_path, templates)[source]

Add configuration for testing conda packages on GitHub Actions to the desired repo.

Parameters
  • repo_path (Path) – Path to the repository root.

  • templates (Environment)

Return type

List[str]

make_github_ci(repo_path, templates)[source]

Add configuration for GitHub Actions to the desired repo.

Parameters
  • repo_path (Path) – Path to the repository root.

  • templates (Environment)

Return type

List[str]

make_github_docs_test(repo_path, templates)[source]

Add configuration for GitHub Actions documentation check to the desired repo.

Parameters
  • repo_path (Path) – Path to the repository root.

  • templates (Environment)

Return type

List[str]

make_github_flake8(repo_path, templates)[source]

Add configuration for the Flake8 GitHub Action.

Parameters
  • repo_path (Path) – Path to the repository root.

  • templates (Environment)

Return type

List[str]

make_github_manylinux(repo_path, templates)[source]

Add configuration for GitHub Actions manylinux wheel builds the desired repo.

Parameters
  • repo_path (Path) – Path to the repository root.

  • templates (Environment)

Return type

List[str]

make_github_mypy(repo_path, templates)[source]

Add configuration for the mypy GitHub Action.

Parameters
  • repo_path (Path) – Path to the repository root.

  • templates (Environment)

Return type

List[str]

make_github_octocheese(repo_path, templates)[source]

Add configuration for the OctoCheese GitHub Action.

Parameters
  • repo_path (Path) – Path to the repository root.

  • templates (Environment)

Return type

List[str]