Skip to content
This repository has been archived by the owner on Aug 25, 2023. It is now read-only.

Feature/manipulate version #44

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

mrmasterplan
Copy link
Contributor

@mrmasterplan mrmasterplan commented Mar 23, 2023

Manipulate Versions

In our release pipelines, we pursue a stategy of combined manual and automated
version handling. The file src/VERSION.txt contains a version of the form major. minor.micro in conformance with Python PEP-0440.
We provide a tool to automatically increment the micro and release candidate version so
that it is higher with respect to PyPI and test.PyPI, so that uploads can happen
automatically.

The intention is that all release candidates are uploaded only to test.PyPi, while
all final versions are uploaded to PyPI proper.

The tool supports this manipulation in when used as follows:

usage: spetlr-manipulate-version [-h] [-t] [--name NAME] [--version-file VERSION_FILE]

Automatically set the version for upload to pypi

optional arguments:
  -h, --help            show this help message and exit
  -t                    prepare pre-release version for test.pypi
  --name NAME           Package name, if different from name in setup.cfg
  --version-file VERSION_FILE
                        location of version to manipulate

In the current repo, it can be used without arguments. The manipulations are best
illustrated by this example:

situation VERSION.txt pypi.org test.pypi.org cli flags new version
post-integration version 0.2.8 0.2.8 0.1.34 0.1.34rc4 -t 0.2.8rc1
release new version 0.2.8 0.2.8 0.1.34 0.2.8rc1 0.2.8
normal post-integration 0.2.8 0.2.8 0.2.8rc1 -t 0.2.9rc1
second post-integration 0.2.8 0.2.8 0.2.9rc1 -t 0.2.9rc2
normal release 0.2.8 0.2.8 0.2.9rc1 0.2.9
re-run of release 0.2.8 0.2.9 0.2.9rc1 0.2.10

@mrmasterplan
Copy link
Contributor Author

We had this as a script for a long time. I just improved it and put in in as a full cli tool

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant