diff --git a/roles/ensure-twine/README.rst b/roles/ensure-twine/README.rst index f9dac2cbb..64e4f5172 100644 --- a/roles/ensure-twine/README.rst +++ b/roles/ensure-twine/README.rst @@ -1 +1,9 @@ Ensure twine is installed. + +**Role Variables** + +.. zuul:rolevar:: twine_python + :default: python + + The python interpreter to use to install twine if it is not already + installed. Set it to "python3" to use python 3, for example. diff --git a/roles/ensure-twine/defaults/main.yaml b/roles/ensure-twine/defaults/main.yaml new file mode 100644 index 000000000..76ec8b9d1 --- /dev/null +++ b/roles/ensure-twine/defaults/main.yaml @@ -0,0 +1,2 @@ +--- +twine_python: python diff --git a/roles/ensure-twine/tasks/main.yaml b/roles/ensure-twine/tasks/main.yaml index e83a0d5b9..c7c2832b2 100644 --- a/roles/ensure-twine/tasks/main.yaml +++ b/roles/ensure-twine/tasks/main.yaml @@ -11,7 +11,7 @@ - name: Ensure twine is installed block: - name: Ensure twine is installed - command: pip install twine!=1.12.0 readme_renderer[md]!=23.0 --user + command: "{{ twine_python }} -m pip install twine!=1.12.0 readme_renderer[md]!=23.0 --user" - name: Set pypi_twine_executable set_fact: