From e0a2b647a674ae46499cbd401dd78f2ce5de5d7d Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Wed, 27 Jul 2022 05:50:40 +1000 Subject: [PATCH] test/upload-pypi : install venv When we added this test I used ensure-pip in the ensure-twine role to pull in the pip dependency. But we soon realised that ensure-twine ran in a rootless context so couldn't install packages, and reverted it with I2cf4224228860b8a2cddd360636bb8633967b07e. However, this testing wasn't fixed up. Use ensure-pip in the test playbook before we run the test, and add a note to ensure-twine that it runs without privileges. Change-Id: I6aef14b188dce8c4de774b09ddad718fec8fbf6c --- roles/ensure-twine/README.rst | 4 ++++ test-playbooks/python/upload-pypi.yaml | 3 +++ 2 files changed, 7 insertions(+) diff --git a/roles/ensure-twine/README.rst b/roles/ensure-twine/README.rst index 604d61a54..9f0a62bb5 100644 --- a/roles/ensure-twine/README.rst +++ b/roles/ensure-twine/README.rst @@ -1,5 +1,9 @@ Ensure twine is installed. +This role is designed to run without permissions, so assumes a working +Python 3 ``pip`` environment (i.e. it will not install system +packages). + **Role Variables** .. zuul:rolevar:: twine_python diff --git a/test-playbooks/python/upload-pypi.yaml b/test-playbooks/python/upload-pypi.yaml index 3a0e67317..50f627aa2 100644 --- a/test-playbooks/python/upload-pypi.yaml +++ b/test-playbooks/python/upload-pypi.yaml @@ -1,5 +1,8 @@ - hosts: all tasks: + - name: Ensure pip works for ensure-twine + include_role: + name: ensure-pip - name: Install twine include_role: