Skip to content

Commit 77998d9

Browse files
committed
ci: better checks
1 parent 4736fca commit 77998d9

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

tox.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,8 +139,10 @@ passenv =
139139
deps = twine >6.0, <7.0
140140
skip_install = true
141141
commands_pre =
142-
# check whether the distribution’s long description will render correctly on PyPI
143-
; twine check {env:DIST_DIR}/software[\-_]patterns-{env:PACKAGE_DIST_VERSION:}*
142+
python -c 'import os; n = "TWINE_USERNAME"; v = os.environ.get(n); exec("if not v:\n print(\"Please set the \" + str(n) + \" variable.\")\n exit(1)");'
143+
python -c 'import os; n = "TWINE_PASSWORD"; v = os.environ.get(n); exec("if not v:\n print(\"Please set the \" + str(n) + \" variable.\")\n exit(1)");'
144+
python -c 'import os; n = "PACKAGE_DIST_VERSION"; v = os.environ.get(n); exec("if not v:\n print(\"Please set the \" + str(n) + \" variable.\")\n exit(1)");'
145+
python -c 'import os; n = "PYPI_SERVER"; exec("if n in os.environ:\n v = os.environ[n]\n if v != \"pypi\":\n print(\"Environment variable PYPI_SERVER detected, but was not set to pypi. Please set to pypi or run tox -e deploy from an environment where the PYPI_SERVER variable is NOT present at all.\")\n exit(1)");'
144146
twine check {env:DIST_DIR}/{env:PY_PACKAGE}-{env:PACKAGE_DIST_VERSION:}*
145147
commands =
146148
twine {posargs:upload --non-interactive} --repository {env:PYPI_SERVER:testpypi --skip-existing} {env:DIST_DIR}/{env:PY_PACKAGE}-{env:PACKAGE_DIST_VERSION}* --verbose

0 commit comments

Comments
 (0)