Skip to content

Commit

Permalink
chore: centralize twine configuration logic and remove dependency on …
Browse files Browse the repository at this point in the history
…pypirc (#297)
  • Loading branch information
mattsb42-aws committed Sep 1, 2020
1 parent b91e44b commit eea79fc
Showing 1 changed file with 27 additions and 8 deletions.
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}

0 comments on commit eea79fc

Please sign in to comment.