diff --git a/roles/upload-pypi/README.rst b/roles/upload-pypi/README.rst index 8c6f3da79..cbcc0dab1 100644 --- a/roles/upload-pypi/README.rst +++ b/roles/upload-pypi/README.rst @@ -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 diff --git a/roles/upload-pypi/defaults/main.yaml b/roles/upload-pypi/defaults/main.yaml index 4e71e83f5..c0cb93b96 100644 --- a/roles/upload-pypi/defaults/main.yaml +++ b/roles/upload-pypi/defaults/main.yaml @@ -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 diff --git a/roles/upload-pypi/templates/.pypirc.j2 b/roles/upload-pypi/templates/.pypirc.j2 index 3cc8ab2a2..03ccded83 100644 --- a/roles/upload-pypi/templates/.pypirc.j2 +++ b/roles/upload-pypi/templates/.pypirc.j2 @@ -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 }}