Fullrelease process with --no-input =================================== .. :doctest: .. :setup: zest.releaser.tests.functional.setup .. :teardown: zest.releaser.tests.functional.teardown Several items are prepared for us. An svn repository: >>> repo_url 'file://TESTREPO' An svn checkout of a project: >>> svnsourcedir 'TESTTEMP/tha.example-svn' >>> import os >>> os.chdir(svnsourcedir) >>> from zest.releaser.utils import execute_command >>> print(execute_command("svn info %s" % svnsourcedir)) Path: ... URL: file://TESTREPO/tha.example/trunk ... The version is at 0.1.dev0: >>> svnhead('setup.py') from setuptools import setup, find_packages import os.path version = '0.1.dev0' Asking input on the prompt is not unittestable unless we use the prepared testing hack in utils.py: >>> from zest.releaser import utils >>> utils.TESTMODE = True Run the whole process without asking for input. For that we pass the ``--no-input`` option: >>> import sys >>> sys.argv[1:] = ['--no-input'] >>> utils.parse_options() >>> utils.AUTO_RESPONSE True Now run the fullrelease: >>> from zest.releaser import fullrelease >>> fullrelease.main() lists of files in version control and sdist match Checking data dict Checking data dict Tag needed ... The changelog and setup.py are at 0.2.dev0: >>> svnhead('CHANGES.txt') Changelog of tha.example ======================== 0.2 (unreleased) ---------------- >>> svnhead('setup.py') from setuptools import setup, find_packages import os.path version = '0.2.dev0' An alternative is to set a ``no-input`` option in the ``setup.cfg`` file: >>> sys.argv[1:] = [] >>> from zest.releaser import utils >>> utils.parse_options() >>> utils.AUTO_RESPONSE False >>> cfg = """ ... [zest.releaser] ... no-input = true ... """ >>> dont_care = open('setup.cfg', 'w').write(cfg) The prerelease part would complain when the changelog still contains '- Nothing changed yet.' So change it. >>> add_changelog_entry() Now run the fullrelease: >>> from zest.releaser import fullrelease >>> fullrelease.main() lists of files in version control and sdist match Checking data dict Checking data dict Tag needed ... Yes, the no-input was detected: >>> utils.AUTO_RESPONSE True The changelog and setup.py are at 0.3.dev0 now: >>> svnhead('CHANGES.txt') Changelog of tha.example ======================== 0.3 (unreleased) ---------------- >>> svnhead('setup.py') from setuptools import setup, find_packages import os.path version = '0.3.dev0' When you do some commits, but forget to update the changelog, prerelease (or fullrelease) will warn you, as indicated earlier: >>> from zest.releaser import prerelease >>> prerelease.main() Traceback (most recent call last): ... RuntimeError: SYSTEM EXIT (code=0)