def ship(self): skip_external = self.app.pargs.skip_external ra.check_pypirc() ra.test_all(skip_external) version_nb = ra.changelog_modify() try: c(['git', 'add', '.']) c(['git', 'commit', '-m', 'Tagging version \'%s\'' % version_nb]) curr_branch = check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip() c(['git', 'checkout', 'master']) c(['git', 'merge', curr_branch]) c(['git', 'tag', version_nb]) c(['git', 'clean', '-dXff']) is_release = '^[0-9.]*$' pypi_repo = 'pypi' if re.match(is_release, version_nb) else 'test' c(['python', 'setup.py', 'sdist', 'upload', '-r', pypi_repo]) c(['python', 'setup.py', 'bdist_wheel', 'upload', '-r', pypi_repo]) call('git remote | xargs -l git push --all', shell=True) call('git remote | xargs -l git push --tags', shell=True) finally: # Go back to development with the new commits from master. c(['git', 'checkout', 'development']) c(['git', 'merge', 'master'])
def test_changelog_modify(self): all_mocks = self._mock_cm() ra.changelog_modify() for mock in all_mocks: assert mock.called