示例#1
0
文件: cli.py 项目: bossjones/changes
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]()
示例#2
0
文件: cli.py 项目: bmcorser/changes
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)
示例#3
0
文件: cli.py 项目: michaelaye/changes
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)
示例#4
0
 def test_probe_with_alt_requirements(self):
     config.arguments['--requirements'] = 'test-requirements.txt'
     self.assertFalse(probe.probe_project(self.module_name))
示例#5
0
 def test_probe_project(self):
     self.assertTrue(probe.probe_project(self.module_name))
示例#6
0
 def test_probe_with_alt_requirements(self):
     config.arguments['--requirements'] = 'test-requirements.txt'
     self.assertFalse(probe.probe_project(self.module_name))
示例#7
0
 def test_probe_project(self):
     self.assertTrue(probe.probe_project(self.module_name))
示例#8
0
def test_probe_project():
    assert probe.probe_project(context)
示例#9
0
def test_probe_with_alt_requirements():
    with raises(Exception):
        shutil.rmtree(context.requirements)
        probe.probe_project(context)
示例#10
0
def test_probe_project(python_module):
    assert probe.probe_project('test_app')
示例#11
0
def test_probe_project():
    assert probe.probe_project(context)
示例#12
0
def test_probe_with_alt_requirements():
    with raises(Exception):
        shutil.rmtree(context.requirements)
        probe.probe_project(context)