upload-pypi: make repository url optional

The current default URL returns an error.  The error message suggests
that we just omit the URL entirely from the config and let twine
handle it.  That's what this patch does.

Change-Id: I83b2eb30e3c93690dbe03052cd3f20a73c110350
This commit is contained in:
James E. Blair 2017-10-17 14:13:24 -07:00
parent 879a5bafa8
commit a1c25d6fc8
3 changed files with 6 additions and 4 deletions

View File

@ -19,12 +19,12 @@ Upload python packages to PyPI
.. zuul:rolevar:: repository
:default: pypi
Name of the repository to upload to
Name of the repository to upload to.
.. zuul:rolevar:: repository_url
:default: https://pypi.python.org/pypi
:default: The built-in twine default for the production pypi.org service.
URL of the PyPI repostory
URL of the PyPI repostory.
.. zuul:rolevar:: pypi_path
:default: src/{{ zuul.project.canonical_name }}/dist

View File

@ -1,5 +1,5 @@
---
pypi_path: "src/{{ zuul.project.canonical_name }}/dist"
pypi_repository: "{{ pypi_info.repository|default('pypi') }}"
pypi_repository_url: "{{ pypi_info.repository_url|default('https://pypi.python.org/pypi') }}"
pypi_repository_url: "{{ pypi_info.repository_url|default(None) }}"
pypi_twine_executable: twine

View File

@ -3,6 +3,8 @@ index-servers=
{{ pypi_repository }}
[{{ pypi_repository }}]
{% if pypi_repository_url %}
repository:{{ pypi_repository_url }}
{% endif %}
username:{{ pypi_info.username }}
password:{{ pypi_info.password }}