Skip to content

chore: centralize twine configuration logic and remove dependency on pypirc #297

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 1, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
35 changes: 27 additions & 8 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,9 @@ passenv =
# Pass through AWS credentials
AWS_ACCESS_KEY_ID AWS_SECRET_ACCESS_KEY AWS_SESSION_TOKEN \
# Pass through AWS profile name (useful for local testing)
AWS_PROFILE
AWS_PROFILE \
# Pass through custom pip config file settings
PIP_CONFIG_FILE
sitepackages = False
deps = -rtest/requirements.txt
commands =
Expand Down Expand Up @@ -332,22 +334,39 @@ deps =
commands =
python setup.py sdist bdist_wheel

[testenv:test-release]
[testenv:release-base]
basepython = python3
skip_install = true
deps =
{[testenv:build]deps}
twine
passenv =
{[testenv]passenv} \
TWINE_USERNAME \
TWINE_PASSWORD \
TWINE_REPOSITORY_URL
commands =
{[testenv:build]commands}
twine upload --skip-existing --repository testpypi dist/*
twine upload --skip-existing {toxinidir}/dist/*

[testenv:test-release]
basepython = python3
skip_install = true
deps = {[testenv:release-base]deps}
passenv =
{[testenv:release-base]passenv}
setenv =
TWINE_REPOSITORY_URL = https://test.pypi.org/legacy/
commands = {[testenv:release-base]commands}

[testenv:release]
basepython = python3
skip_install = true
deps =
{[testenv:build]deps}
twine
deps = {[testenv:release-base]deps}
passenv =
{[testenv:release-base]passenv}
whitelist_externals = unset
commands =
{[testenv:build]commands}
twine upload --skip-existing --repository pypi dist/*
# Unsetting the TWINE_REPOSITORY_URL defaults twine to using production PyPI
unset TWINE_REPOSITORY_URL
{[testenv:release-base]commands}