Ejemplo n.º 1
0
def test_commit_version_change(mocker):
    dry_run = mocker.patch('changes.shell.dry_run')
    vcs.commit_version_change(context)
    dry_run.assert_has_calls([
        call('git commit --message="0.0.2" test_app/__init__.py CHANGELOG.md', True),
        call('git push', True)
    ])
Ejemplo n.º 2
0
def publish(context):
    """Publishes the project"""
    commit_version_change(context)

    if context.github:
        # github token
        project_settings = project_config(context.module_name)
        if not project_settings['gh_token']:
            click.echo('You need a GitHub token for changes to create a release.')
            click.pause('Press [enter] to launch the GitHub "New personal access '
                        'token" page, to create a token for changes.')
            click.launch('https://github.com/settings/tokens/new')
            project_settings['gh_token'] = click.prompt('Enter your changes token')

            store_settings(context.module_name, project_settings)
        description = click.prompt('Describe this release')

        upload_url = create_github_release(context, project_settings['gh_token'], description)

        upload_release_distributions(
            context,
            project_settings['gh_token'],
            build_distributions(context),
            upload_url,
        )

        click.pause('Press [enter] to review and update your new release')
        click.launch('{0}/releases/tag/{1}'.format(context.repo_url, context.new_version))
    else:
        tag_and_push(context)
Ejemplo n.º 3
0
def test_commit_version_change(mocker):
    dry_run = mocker.patch('changes.shell.dry_run')
    vcs.commit_version_change(context)
    dry_run.assert_has_calls([
        call('git commit --message="0.0.2" test_app/__init__.py CHANGELOG.md',
             True),
        call('git push', True)
    ])
Ejemplo n.º 4
0
def test_commit_version_change(mocker):
    with CliRunner().isolated_filesystem():
        dry_run = mocker.patch('changes.shell.dry_run')
        vcs.commit_version_change(context)
        dry_run.assert_has_calls([
            mocker.call(
                'git commit --message="0.0.2" test_app/__init__.py CHANGELOG.md',
                True,
            ),
            mocker.call('git push', True),
        ])
Ejemplo n.º 5
0
def release():
    try:
        if not config.arguments['--skip-changelog']:
            changelog()
        bump_version()
        run_tests()
        commit_version_change()
        install()
        upload()
        pypi()
        tag()
    except:
        log.exception('Error releasing')
Ejemplo n.º 6
0
def perform_release(context):
    """Executes the release process."""
    try:
        run_tests()

        if not context.skip_changelog:
            generate_changelog(context)
        increment_version(context)

        build_package(context)
        install_package(context)
        upload_package(context)
        install_from_pypi(context)

        commit_version_change(context)
        tag_and_push(context)
    except:
        log.exception('Error releasing')
Ejemplo n.º 7
0
def test_commit_version_change():
    vcs.commit_version_change(context)
Ejemplo n.º 8
0
def test_commit_version_change():
    vcs.commit_version_change(context)
Ejemplo n.º 9
0
 def test_commit_version_change(self):
     vcs.commit_version_change()
Ejemplo n.º 10
0
 def test_commit_version_change(self):
     vcs.commit_version_change()