From 470abf361760b49772536ed1158122e3a9254f67 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Sat, 22 Apr 2017 21:39:37 +0300 Subject: Update bumper.yarn for version.txt, version.yaml --- bumper.yarn | 53 +++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 41 insertions(+), 12 deletions(-) diff --git a/bumper.yarn b/bumper.yarn index f29224f..7a5410e 100644 --- a/bumper.yarn +++ b/bumper.yarn @@ -22,40 +22,60 @@ simpler. Here's a list: are supported, sorry, but that's just because git is the only thing the author uses now. -* The project is in Python. Again, this is just because that's what - the author uses. +* The project may use any programming languages. -* The project contains exactly one file called `version.py`, and that - file only sets the variables `__version__` and `__version_info__`. - Bumper will overwrite that file so it sets the desired values, and - commits those changes to git. +* In projects using Python, the source tree contains exactly one file + called `version.py`, and that file only sets the variables + `__version__` and `__version_info__`. Bumper will overwrite that + file so it sets the desired values, and commits those changes to + git. * `setup.py` is assumed to get the version from `__version__` from the file Bumper writes, in some suitable way. Likewise the rest of the project. -* It's OK for Bumper to make several commits and a tag in the git - repository. +* In projects not using Python, the version number is stored in the + file `version.txt` or `version.yaml`, and the build system is + expected to get it from there. If the project version is 1.2, then + `version.txt` would contain "1.2\n" and `version.yaml` would contain + "version: 1.2\nversion_info: [1, 2]\n". If both files exist, the + YAML file has precedence. + +* Bumper will update all of `version.py`, `version.txt`, and + `version.yaml` if they exist. + +* Bumper will update NEWS and debian/changelog as well, if they exist + to make sure the version number is correct. It will update them in + one commit to have the release number, and in a subsequent commit + with a non-release number. + +* Bumper will make several commits and a release tag in the git + repository. The release tag is signed and annotated and of the form + `foo-x.y` for project foo, release x.y. # Using Bumper -In the examples below, we'll use Bumper on a fairly typical Python -project called `foo`, and we'll make a release 3.2 of it. +In the examples below, we'll use Bumper on a project called `foo`, and +we'll make a release 3.2 of it. SCENARIO release a project -We will use a PGP test key for signing tags. +We will use a PGP test key for signing tags. This is in the +`dot-gnupg` directory in the source tree. GIVEN a PGP key with id AA8CD13C The Foo project consists of a main program, which uses a little Python package where all the real code is, and where the version number is -also stored. +also stored. It also has the `version.txt` and `version.yaml` files. GIVEN Python project foo, version controlled by git AND a file foolib/version.py in foo containing ... "__version__ = '1.0'\n__version_info__ = (1, 0)\n" + AND a file version.txt in foo containing "1.0\n" + AND a file version.yaml in foo containing + ... "version = 1.0\nversion_info = [1, 0]\n" AND project foo has Debian packaging We run Bumper to update version numbers and tag a new release. We @@ -74,6 +94,9 @@ to have the right version number. THEN git repository foo has tag foo-3.2, signed with AA8CD13C AND in foo, tag foo-3.2, foolib/version.py contains ... "__version__ = "3.2"\n__version_info__ = (3, 2)\n" + AND in foo, tag foo-3.2, version.txt contains "version = 3.2\n" + AND in foo, tag foo-3.2, version.yaml contains + ... "version: 3.2\nversion_info: [3, 2]\n" AND in foo, tag foo-3.2, NEWS matches ... "^Version 3.2, released \\d\\d\\d\\d-\\d\\d-\\d\\d$" AND in foo, tag foo-3.2, has Debian version 3.2-1 @@ -86,6 +109,9 @@ the tag) won't report a version number that looks like a release. ... "__version__ = "3.2+git"\n__version_info__ = (3, 2, '+git')\n" AND file debian/changelog in foo matches ... "foo \\(3\\.2\\+git-1\\) UNRELEASED;" + AND file version.txt in foo contains "version = 3.2+git\n" + AND file version.yaml in foo contains + ... "version: 3.2+git\nversion_info: [3, 2, '+git']\n" AND file NEWS in foo matches ... "Version 3\\.2\\+git, not yet released" @@ -97,6 +123,9 @@ We can also make a second release. ... "__version__ = "3.4"\n__version_info__ = (3, 4)\n" AND in foo, tag foo-3.4, NEWS matches ... "^Version 3.4, released \\d\\d\\d\\d-\\d\\d-\\d\\d$" + AND in foo, tag foo-3.4, version.txt contains "version = 3.4\n" + AND in foo, tag foo-3.4, version.yaml contains + ... "version: 3.4\nversion_info: [3, 4]\n" AND in foo, tag foo-3.4, has Debian version 3.4-1 AND file foolib/version.py in foo contains ... "__version__ = "3.4+git"\n__version_info__ = (3, 4, '+git')\n" -- cgit v1.2.1