Commit Graph

10 Commits

Author SHA1 Message Date
Tim Burke 500b4016eb build-python-release: Add flag for whether to build a wheel or not
Default to true to preserve existing behavior.

Change-Id: I7d34fdce546fd37d13aeed78e45f119fc52fe2ef
2021-06-08 14:24:44 -07:00
Ian Wienand 67f223b53a Partial revert "Ensure wheel exists for build-release-python"; move to ensure-pip
This partially reverts commit
3f961ce202.

This alternative installs wheel with the ensure-pip role instead of in
a separate role.  wheel is very closely linked with pip install
operations so this isn't a large overreach of the role.

I suggest this for several reasons; firstly the python-wheel role
doesn't try to install packages, so we end up with mixed system pip
and upstream versions of wheel most of the time.  This is the type of
thing that has proven problematic in the past.  It also installs via
pip --user; something we've already had problems with tox when for
various reasons roles want to run this as non-zuul user.  Using
ensure-pip we keep the packaged versions together.

[1] did try to install wheel with root, but during runtime which
didn't work due to sudo being revoked.  This should work for the
existing build-python-release job, because it already includes
ensure-pip in pre-run via playbooks/python/pre.yaml

I believe our conclusion on the ensure-* roles was that requiring
root/become: for installation is OK, but we should have a no-op path
if the tools are found.  This is consistent with that approach
(i.e. if you want wheel and can't do sudo, you should pre-install it
on your image using whatever you build that with).

This adds a check to the existing "is pip installed" check to also
check if wheel packages are available.  If not we trigger the install
path.

This revealed some issues with RedHat.yaml -- we can always install
Python 3 (packages available for CentOS 7) so remove that check, and
if Ansible is running under Python 2; ensure we install the
dependencies too (not only if it is forced).

Update the documentation to describe that it will enable support for
bdist_wheel, and add a basic sanity test that wheels are produced by
pip.  The existing build-python-release job is kept; although it is
modified to use the playbooks/python/pre.yaml playbook as the build
job does.

Change-Id: I2ab11bb45b6b2a49d54db39195228ab40141185c
[1] https://review.opendev.org/#/c/736001/5/roles/build-python-release/tasks/main.yaml
2020-06-18 12:51:56 +00:00
Sorin Sbarnea 3f961ce202 Ensure wheel exists for build-release-python
We need it to exist for building wheels. It should be
installed in a pre-playbook.

Change-Id: Ieaec3d21911decf11283e82fed97dd26b3a93ffa
2020-06-17 16:59:24 -05:00
Sorin Sbarnea (zbr) 548d2b387a Revert "Make sure wheel is installed for python releases"
This broke multiple zuul deployments. Please do not make changes without having tests on them.

This reverts commit fe4ce563f2.

Change-Id: I0eac14d9c9c4e717883965e37fa6e3bbaf37f35a
2020-06-17 12:25:17 +00:00
Monty Taylor fe4ce563f2 Make sure wheel is installed for python releases
We need to rework this whole thing, becuase we need to install
wheel into a virtualenv so that we can do it without root. But
this should get us by until we can do that.

Change-Id: I2816a9c76a049f8986839c17c641d6cad541833d
2020-06-16 18:08:40 -05:00
Jeremy Stanley 2711d10186 Be consistent about spaces before and after vars
With the arrival of ansible-lint 4, Jinja2 variable expansions must
include spaces before and after the variable name inside the
brackets.

Adjust the new violations accordingly and remove the rule
206 exclusion.

Change-Id: Ib3ff7b0233a5d5cf99772f9c2adc81861cf34ffa
2019-08-07 20:17:41 +01:00
Andreas Jaeger 9566cbe07d Fix RST formatting
Remove whitespaces from build-python-release which make
the sphinx display as "** Role Variable
**" instead of bold "Role Variables".

Fix buildset-artifacts-location to display items as list.

Fix stage-output to display the example as example - and not wrap
around.

Change-Id: I8da3ec0c507d26f47ee9bb71dc9d1b3ed9ca23a5
2018-10-13 10:36:36 +02:00
Doug Hellmann 836cc85eec support passing extra arguments to bdist_wheel in build-python-release
Users of this role may want to pass extra arguments, such as the
--universal flag. Those arguments need to come after the bdist_wheel
argument to setup.py so that the command line processor understands them.

Change-Id: I38a3ef28b2c78821ec81a3f1adf0cfeef946d98f
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-10-04 14:27:13 -04:00
Doug Hellmann be339b7746 allow build-python-release consumers to override python version
Define a release_python variable that users of the
build-python-release role can override to set which version of python
they are using for building sdists and wheels.

Change-Id: I1502c572304000fab45a43e1a6d674f5aa7e9a9e
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
2018-06-11 15:17:40 -04:00
Monty Taylor 04c7247604
Make build-python-release job
python-sdist isn't an accurate name since this also builds wheels. Make
a new job named build-python-release.

Also, use zuul_work_dir as the working dir variable.

This role was written rather early and isn't used yet. Change it to use
zuul_work_dir so that it matches other things.

Change-Id: Icfad9ad6ba5c7a0c62a8d5ce243952b81f28a47f
Depends-On: I8dfe5a41710392d6ca8453ce365f674a9d5e4f6e
2017-11-20 09:09:40 -06:00