def main(): arguments = initialise() version_arguments = ['--major', '--minor', '--patch'] commands = ['release', 'changelog', 'run_tests', 'bump_version', 'tag', 'upload', 'install', 'pypi'] suppress_version_prompt_for = ['run_tests', 'upload'] if arguments['--new-version']: arguments['new_version'] = arguments['--new-version'] module_name = config.arguments['<module_name>'] if not probe.probe_project(module_name): raise Exception('Project does not meet `changes` requirements') for command in commands: if arguments[command]: if command not in suppress_version_prompt_for: arguments['new_version'] = version.get_new_version( module_name, version.current_version(module_name), arguments.get('--noinput', False), **util.extract_arguments(arguments, version_arguments) ) globals()[command]()
def main(context, module_name, dry_run, debug, no_input, requirements, patch, minor, major, version_prefix): """Ch-ch-changes""" logging.basicConfig(level=logging.DEBUG if debug else logging.INFO) new_version = version.get_new_version( module_name, version.current_version(module_name), no_input, major, minor, patch, ) current_version = version.current_version(module_name) repo_url = attributes.extract_attribute(module_name, '__url__') context.obj = config.Changes(module_name, dry_run, debug, no_input, requirements, new_version, current_version, repo_url, version_prefix) probe.probe_project(context.obj)
def main(context, module_name, dry_run, debug, no_input, requirements, patch, minor, major, version_prefix): """Ch-ch-changes""" logging.basicConfig(level=logging.DEBUG if debug else logging.INFO) new_version = version.get_new_version( module_name, version.current_version(module_name), no_input, major, minor, patch, ) current_version = version.current_version(module_name) repo_url = attributes.extract_attribute(module_name, '__url__') context.obj = config.CLI(module_name, dry_run, debug, no_input, requirements, new_version, current_version, repo_url, version_prefix) probe.probe_project(context.obj)
def test_probe_with_alt_requirements(self): config.arguments['--requirements'] = 'test-requirements.txt' self.assertFalse(probe.probe_project(self.module_name))
def test_probe_project(self): self.assertTrue(probe.probe_project(self.module_name))
def test_probe_project(): assert probe.probe_project(context)
def test_probe_with_alt_requirements(): with raises(Exception): shutil.rmtree(context.requirements) probe.probe_project(context)
def test_probe_project(python_module): assert probe.probe_project('test_app')