Skip to content
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
12 changes: 5 additions & 7 deletions python/deploy.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
import tempfile
import subprocess


if 'PYPI_USERNAME' not in os.environ or 'PYPI_PASSWORD' not in os.environ:
print("\n>>> WARNING: set PYPI_USERNAME and PYPI_PASSWORD to push to PyPI\n\n")
sys.exit(1)
Expand Down Expand Up @@ -40,15 +39,15 @@

os.environ['IS_RELEASED'] = 'y'


def twine_upload(wheel):
cmd_prefix = ["python3", "-m"]
if PYPI_USERNAME is not None and PYPI_PASSWORD is not None:
invoke = subprocess.check_call if not USE_TEST_PYPI else subprocess.call
ret = invoke(cmd_prefix + [
"twine", "upload", "-u", PYPI_USERNAME, "-p", PYPI_PASSWORD] + ([
"--repository-url", "https://test.pypi.org/legacy/"]
if USE_TEST_PYPI else []
) + [wheel])
cmd = ["twine", "upload", "-u", PYPI_USERNAME, "-p", PYPI_PASSWORD]
ret = invoke(cmd_prefix + cmd + (["--repository-url", "https://test.pypi.org/legacy/"] if USE_TEST_PYPI else [])
+ [wheel])
invoke(cmd_prefix + cmd + ["dist/*"])
else:
print(">>> WARNING: not pushing to PyPI (one of PYPI_USERNAME or PYPI_PASSWORD was empty)")

Expand All @@ -61,7 +60,6 @@ def invoke_bdist():


def run_bdist(deploy_dir):

print(">>> Building staging area for deployment ...")

old_cwd = os.getcwd()
Expand Down