diff --git a/setup.py b/setup.py index ce81e5cf..1e96baed 100644 --- a/setup.py +++ b/setup.py @@ -80,10 +80,12 @@ class release(bump_version): user_options = [ ("message=", 'm', "message containing the release notes"), + ("sign", "s", "make a GPG-signed tag, using the default key"), ] def initialize_options(self): self.message = None + self.sign = False def finalize_options(self): import re @@ -110,6 +112,7 @@ def finalize_options(self): raise DistutilsSetupError("release notes message is empty") self.message = u"v{new_version}\n\n%s" % message + self.sign = bool(self.sign) @staticmethod def edit_release_notes(): @@ -142,13 +145,14 @@ def run(self): self.bumpversion("release", tag=True, message="Release {new_version}", - tag_message=self.message) + tag_message=self.message, + sign_tags=self.sign) needs_wheel = {'bdist_wheel'}.intersection(sys.argv) wheel = ['wheel'] if needs_wheel else [] needs_bump2version = {'release', 'bump_version'}.intersection(sys.argv) -bump2version = ['bump2version'] if needs_bump2version else [] +bump2version = ['bump2version >= 0.5.7'] if needs_bump2version else [] with open('README.rst', 'r', encoding='utf-8') as f: long_description = f.read()