示例#1
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)
示例#2
0
def perform_release(context):
    """Executes the release process."""
    try:
        run_tests()

        if not context.skip_changelog:
            generate_changelog(context)

        increment_version(context)

        build_distributions(context)

        install_package(context)

        upload_package(context)

        install_from_pypi(context)

        publish(context)
    except Exception:
        log.exception('Error releasing')
示例#3
0
def perform_release(context):
    """Executes the release process."""
    try:
        run_tests()

        if not context.skip_changelog:
            generate_changelog(context)

        increment_version(context)

        build_distributions(context)

        install_package(context)

        upload_package(context)

        install_from_pypi(context)

        publish(context)
    except Exception:
        log.exception('Error releasing')
示例#4
0
def test_upload_release_distributions():
    context.dry_run = False
    distributions = packaging.build_distributions(context)
    context.dry_run = True
    for _ in distributions:
        responses.add(
            responses.POST,
            'http://upload.url.com/',
            status=201,
            content_type='application/json',
        )
    vcs.upload_release_distributions(context, 'gh-token', distributions,
                                     'http://upload.url.com/')
示例#5
0
def test_upload_release_distributions():
    context.dry_run = False
    distributions = packaging.build_distributions(context)
    context.dry_run = True
    for distribution in distributions:
        responses.add(
            responses.POST,
            'http://upload.url.com/',
            status=201,
            content_type='application/json'
        )
    vcs.upload_release_distributions(
        context,
        'gh-token',
        distributions,
        'http://upload.url.com/',
    )
示例#6
0
def test_build_distributions():
    with CliRunner().isolated_filesystem():
        packaging.build_distributions(context)
示例#7
0
文件: cli.py 项目: michaelaye/changes
def build(context):
    """Attempts to build the sdist and wheel."""
    build_distributions(context.obj)
示例#8
0
文件: cli.py 项目: henrywm/changes
def build(context):
    """Attempts to build the sdist and wheel."""
    build_distributions(context.obj)
示例#9
0
def test_build_distributions():
    packaging.build_distributions(context)
示例#10
0
def test_build_distributions():
    packaging.build_distributions(context)