Skip to main content

Automatically create a PR, bump version (using Commitizen), approve and merge (suitable for CI/CD).

Project description

pumper

PyPI - Version PyPI - Python Version code style - black types - mypy imports - isort

Automagically ๐Ÿงšโ€โ™€๏ธ create branch, pull request, bump version (using Commitizen), approve and merge.


pumper helps create CI/CD bump version jobs more secure ๐Ÿ‘ฎโ€โ™€๏ธ.

Common version bump strategy these days is to have CI/CD workflow run automatic version bump directly in a main branch:

common-bump-strategy

This raises following concerns (among others) in highly secured environments:

  • direct push to a main branch required
  • branch protection rules needs to be relieved
  • change in main branch is not reviewed

Bump strategy with pumper:

pumper-strategy

  1. Call great tool Commitizen. It checks your commit history and bumps your version. Check it out for more information how to configure and use it.
  2. Create a branch including changes from above step a push it.
  3. Create PR.
  4. Optionally approve a merge PR.

Quick install guide

pumper can be installed from PYPI. It's recommended to install it in isolated Python environment using venv.

python -m venv .venv
.venv/bin/pip install pumper

How to use it

Using CLI

pump create

 Usage: pumper create [OPTIONS]

 Bump version, push branch and create pull request.

โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *  --repo            TEXT  The owner and repository name, eg 'owner/repo'.     โ”‚
โ”‚                            [env var: GITHUB_REPOSITORY]                        โ”‚
โ”‚                            [default: None]                                     โ”‚
โ”‚                            [required]                                          โ”‚
โ”‚    --url             TEXT  Github API url.                                     โ”‚
โ”‚                            [env var: GITHUB_API_URL]                           โ”‚
โ”‚                            [default: https://api.github.com]                   โ”‚
โ”‚ *  --token           TEXT  Github token.   [env var: GITHUB_TOKEN]             โ”‚
โ”‚                            [default: None] [required]                          โ”‚
โ”‚    --base            TEXT  Base branch of a PR. [env var: BASE_BRANCH]         โ”‚
โ”‚                            [default: main]                                     โ”‚
โ”‚    --branch          TEXT  Branch name and PR title.                           โ”‚
โ”‚                            [default: release/{version}]                        โ”‚
โ”‚    --user            TEXT  Git user name. [default: github-actions[bot]]       โ”‚
โ”‚    --email           TEXT  Git user email.                                     โ”‚
โ”‚                            [default:                                           โ”‚
โ”‚                            github-actions[bot]@users.noreply.github.com]       โ”‚
โ”‚    --gh-env                Create 'PR_NUM' env var for GH actions              โ”‚
โ”‚    --label           TEXT  Add labels to PR. [default: None]                   โ”‚
โ”‚    --assign                Assign PR [default: True]                           โ”‚
โ”‚    --assignee        TEXT  PR assignee name. [env var: GITHUB_ACTOR]           โ”‚
โ”‚    --help                  Show this message and exit.                         โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

pumper approve

 Usage: pumper approve [OPTIONS] PR_NUM

 Approve pull request.

โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *    pr_num      INTEGER  PR number. [env var: PR_NUM] [default: None]         โ”‚
โ”‚                           [required]                                           โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *  --repo         TEXT  The owner and repository name, eg 'owner/repo'.        โ”‚
โ”‚                         [env var: GITHUB_REPOSITORY]                           โ”‚
โ”‚                         [default: None]                                        โ”‚
โ”‚                         [required]                                             โ”‚
โ”‚    --url          TEXT  Github API url.                                        โ”‚
โ”‚                         [env var: GITHUB_API_URL]                              โ”‚
โ”‚                         [default: https://api.github.com]                      โ”‚
โ”‚ *  --token        TEXT  Github token. [env var: GITHUB_TOKEN] [default: None]  โ”‚
โ”‚                         [required]                                             โ”‚
โ”‚    --body         TEXT  PR message. [default: ๐Ÿค– Approved by GH actions!]      โ”‚
โ”‚    --help               Show this message and exit.                            โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

pumper merge

 Usage: pumper merge [OPTIONS] PR_NUM

 Merge pull request.

โ•ญโ”€ Arguments โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *    pr_num      INTEGER  PR number. [env var: PR_NUM] [default: None]         โ”‚
โ”‚                           [required]                                           โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ *  --repo         TEXT  The owner and repository name, eg 'owner/repo'.        โ”‚
โ”‚                         [env var: GITHUB_REPOSITORY]                           โ”‚
โ”‚                         [default: None]                                        โ”‚
โ”‚                         [required]                                             โ”‚
โ”‚    --url          TEXT  Github API url.                                        โ”‚
โ”‚                         [env var: GITHUB_API_URL]                              โ”‚
โ”‚                         [default: https://api.github.com]                      โ”‚
โ”‚ *  --token        TEXT  Github token. [env var: GITHUB_TOKEN] [default: None]  โ”‚
โ”‚                         [required]                                             โ”‚
โ”‚    --help               Show this message and exit.                            โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Github actions

See my GH actions bumper.yaml workflow.

Required setup

Appreciation

Big thanks ๐Ÿ™ to following libraries:

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pumper-0.1.0.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

pumper-0.1.0-py3-none-any.whl (8.5 kB view details)

Uploaded Python 3

File details

Details for the file pumper-0.1.0.tar.gz.

File metadata

  • Download URL: pumper-0.1.0.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.3

File hashes

Hashes for pumper-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d8636da01f563dc99908a2f46d7bc8f6cd8308d9b471a8fe014925dfd8d65f37
MD5 47ffd31f5b6da8c9c60f2dea28433185
BLAKE2b-256 ecf1d17e4672d66422a5816e8877a851d2345d0cf47a7291001fe628a065e90c

See more details on using hashes here.

File details

Details for the file pumper-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pumper-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 8.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-httpx/0.23.3

File hashes

Hashes for pumper-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6be8762e9966e8baa52bccb9e878643f3f26eb70fda4359b6e84ba81ffe678d6
MD5 f89458fa777893bac5655c8a01d4370e
BLAKE2b-256 67ad12cc317527f8bd12ccb5eaccdd08c5bf84421c6aa87636f6a6ddfb0b7a41

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page