diff options
author | Lars Wirzenius <liw@liw.fi> | 2016-02-14 12:33:34 +0200 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2016-02-14 12:35:07 +0200 |
commit | bd62b20bea61e82bce57d15f32bc8a98ece7cca2 (patch) | |
tree | e3b4dde3e6afe27e8a9dbf44a8c72b5f271dd6c1 | |
parent | f36ae7218b9850fa4ed37c32f3879e99782cc1f0 (diff) | |
download | bumper-bd62b20bea61e82bce57d15f32bc8a98ece7cca2.tar.gz |
Update debian/changelog
-rwxr-xr-x | bumper | 13 | ||||
-rw-r--r-- | bumper.yarn | 21 |
2 files changed, 31 insertions, 3 deletions
@@ -26,11 +26,18 @@ class Bumper(cliapp.Application): version = args[0] filename = args[1] self.write_version_py(filename, version) - self.commit(filename) + self.update_debian_changelog(version) + self.commit(version) self.make_release_tag(version) - def commit(self, filename): - cliapp.runcmd(['git', 'commit', '-m', 'Version bump', filename]) + def update_debian_changelog(self, version): + debian_version = '{}-1'.format(version) + cliapp.runcmd(['dch', '-v', debian_version, 'New upstream release.']) + cliapp.runcmd(['dch', '-r', '']) + + def commit(self, version): + msg = 'Prepare to release version {}'.format(version) + cliapp.runcmd(['git', 'commit', '-am', msg]) def make_release_tag(self, version): name = self.get_project_name() diff --git a/bumper.yarn b/bumper.yarn index 365870f..f60b4f6 100644 --- a/bumper.yarn +++ b/bumper.yarn @@ -55,6 +55,7 @@ also stored. GIVEN Python project foo, version controlled by git AND a file foolib/version.py in foo containing ... "__version__ = '0.0'\n__version_info__ = (0, 0)\n" + AND project foo has Debian packaging We run Bumper, and it does several things. @@ -64,6 +65,7 @@ We run Bumper, and it does several things. ... "__version__ = "3.2"\n__version_info__ = (3, 2)\n" AND file foolib/version.py in foo contains ... "__version__ = "3.2"\n__version_info__ = (3, 2)\n" + AND in foo, tag foo-3.2, has Debian version 3.2-1 # Appendix: Scenario step implementations @@ -109,6 +111,15 @@ for Bumper. ['git', 'commit', '-m', 'Add {}'.format(filename)], cwd=dirname) + IMPLEMENTS GIVEN project (\S+) has Debian packaging + import os, cliapp, yarnstep + project = yarnstep.get_next_match() + dirname = yarnstep.datadir(project) + os.mkdir(os.path.join(dirname, 'debian')) + cliapp.runcmd( + ['dch', '--create', '-v', '0.0-1', '--package', project, ''], + cwd=dirname) + IMPLEMENTS WHEN user runs "bumper (\S+) (\S+)" in the (\S+) directory import cliapp, yarnstep version = yarnstep.get_next_match() @@ -138,6 +149,16 @@ for Bumper. cwd=dirname) assert wanted_data == actual_data + IMPLEMENTS THEN in (\S+), tag (\S+), has Debian version (\S+) + import os, yarnstep + dirname = yarnstep.get_next_match_as_datadir_path() + tagname = yarnstep.get_next_match() + version = yarnstep.get_next_match() + text = yarnstep.cat(os.path.join(dirname, 'debian/changelog')) + line1, _ = text.split('\n', 1) + assert '({})'.format(version) in line1 + assert line1.split()[2] != 'UNRELEASED;' + IMPLEMENTS THEN git repository (\S+) has tag (\S+), signed with (\S+) import subprocess, cliapp, yarnstep dirname = yarnstep.get_next_match_as_datadir_path() |