Commit Graph

17 Commits

Author SHA1 Message Date
Ian Wienand 8c6512107c
Standarise block/when ordering
Newer ansbile-lint finds "when" or "become" statements that are at the
end of blocks.  Ordering these before the block seems like a very
logical thing to do, as we read from top-to-bottom so it's good to see
if the block will execute or not.

This is a no-op, and just moves the places the newer linter found.

Change-Id: If4d1dc4343ea2575c64510e1829c3fe02d6c273f
2022-11-07 10:37:53 +11:00
Ian Wienand a46b34b9f7 ensure-twine : remove ensure-pip
This was added with I55ef79bf9c5af9e4d1da24ed654821277edb663b but
unfortunately breaks the OpenDev use where this runs on the executor
and doesn't have sudo.  Let's just leave it the way it was.

Change-Id: I2cf4224228860b8a2cddd360636bb8633967b07e
2022-07-19 08:15:26 +10:00
Ian Wienand ffe4f4fea5 ensure-twine: make python3 default, ensure pip installed
Make the default twine python installation use "python3".  Use the
ensure-pip role before calling pip.

This role currently isn't tested; it is added with upload-pypi testing
in the follow-on Ie40ec32b3b2ffc4646301c6e145c527fe6a3bae2

Change-Id: I55ef79bf9c5af9e4d1da24ed654821277edb663b
2022-07-13 15:18:10 +10:00
Zuul bbf4c1bbaa Merge "ensure-twine: Avoid Reinstalling twine if present" 2021-10-04 20:58:04 +00:00
Ian Wienand 6f76d3f68a ensure-twine: remove readme_renderer
This dependency was added with
Iaf4da5aedaa3814b2ecebed4391da2324d3e388d to prevent a warning when
using "twine check" with text/markdown descriptions.

Per [1], this check doesn't really do anything and will never fail.

We are now having issues using this role with with Python 3.8 on the
executor as the md dependency pulls in cmarkgfm which has binary
dependencies but does not publish any wheels; meaning the executor
fails to install as it does not have a toolchain setup.  Unfortunately
upstream is not particularly active, so building good manylinux wheels
is not something we're going to be able to deal with in a timely
fashion.

Given that this is not a failure, and isn't really doing anything and
blocks Python 3.8, it seems our best course is to remove this
dependency.

[1] https://github.com/pypa/twine/pull/421

Change-Id: Iac5c9f63d41375889e4fdad67b9a45a24a644341
2020-10-02 09:08:58 +10:00
Guillaume Chauvel f465198cb0 ensure-twine: Avoid Reinstalling twine if present
On a static node where twine isn't present in the PATH, twine would be
always reinstalled even if already present in venv because it's not checked.

This patch adds twine pip check, the first matching line is used to get
executable path

Change-Id: I2c972147269bf717c30f093975ca6349bed68fbe
2020-06-12 15:57:38 +02:00
Guillaume Chauvel d370c590b3 ensure-twine: Check executable presence using shell+bin/bash
While making test with a node:
- with tox installed using "pip install --user" as a non-root user
- PATH modified using ~/.ssh/environment
- declared in nodepool to run as this non-root user

twine executable is not found:

using "command": twine is not found
using "shell" without /bin/bash: twine is not found
using "shell" with /bin/bash: twine is found!

Change-Id: Ia06218a830b5d44f04e0f10e0444be2cf9ad682e
2020-05-30 22:58:06 +02:00
Sean McGinnis 58c84203f6
Revert "Add environment debugging to ensure-twine role"
This reverts commit a874df5865
and follow on fix 9674e1d442.

Change-Id: I6bcc4ca9025cd26f2c9c7bb5dce8e6dcf09db485
2019-04-26 10:35:22 -05:00
Sean McGinnis 9674e1d442
Correct debug statement for ensure-twine environment
Formatting output for printing out python environment information was
incorrect. This fixes the debug task.

Change-Id: Id33157eb52267e1646a42587777fd974340932d3
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-04-24 09:56:16 -05:00
Sean McGinnis a874df5865
Add environment debugging to ensure-twine role
This looks up some runtime environment information and emits it for
debugging.

Change-Id: I7ac121f38d4e01e4f0a2a51199a8da5d055c5030
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-04-24 09:00:06 -05:00
Sean McGinnis ee5d385343
Block installation of requests-toolbelt 0.9.0
This release of requests-toolbelt expects pyOpenSSL to be installed for
urllib3, but does not have it in its default requirements. This is being
tracked in [0], so should be fixed post 0.9.0. For now, block the use of
the 0.9.0 version.

[0] https://github.com/requests/toolbelt/compare/0.8.0...0.9.0

Change-Id: I06445adaaeecf244f6482b6db26db58a09426489
Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
2019-01-29 16:15:25 -06:00
Doug Hellmann 125eeed6fe enable setting python version for ensure-twine
Add twine_python so we can control the version of python used to
install twine.

Change-Id: I36ddbdf78f549ddc022cce86f3ada9631fb19c37
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-11-08 14:06:07 -05:00
Sorin Sbarnea a17765ca4f Add missing optional dependencies to ensure-twine
Avoids potential twine execution cause by:
https://github.com/pypa/readme_renderer/issues/128

Resolves:
UserWarning: Markdown renderers are not available.
Install 'readme_render[md]' to enable Markdown rendering.

Example:
http://logs.openstack.org/25/613725/1/check/test-release-openstack-python3/df34317/job-output.txt.gz

Change-Id: Iaf4da5aedaa3814b2ecebed4391da2324d3e388d
2018-10-27 17:18:32 +01:00
Monty Taylor d46fcf019e
Block twine 1.12.0 when we install it
1.12.0 is broken and a 1.12.1 fix is on the way. Don't install 1.12.0.

Change-Id: Ia54736b74d3306614869a9bcb0ecec524ce26f94
2018-09-24 12:57:13 -05:00
Monty Taylor f6eb7b2fc8
Move name from block to tasks in the block
block allows adding a name - but it's not actually emitted anywhere in
the logging. So while this documents the source code, it's not reflected
in logging.

I just happened to learn this elsewhere.

Change-Id: I95362ed94418144e332f7289b1bfa5b2ade68de7
2017-08-30 17:30:38 -05:00
Paul Belanger 4c9a13df88
Refactor ensure-twine
This didn't work as expected on executor. So, now pip install
depending on the rc status of which.

Change-Id: Icd9da523d220973c66bc7cb4fbbd9999ec6c0dd0
Signed-off-by: Paul Belanger <pabelanger@redhat.com>
2017-08-23 17:55:18 -04:00
Monty Taylor e14a0d9285
Add ensure-twine role
Change-Id: Ic00e4f0c08fc42ce9d68f39be8522b6c2bba6396
2017-08-23 16:35:23 -04:00