Commit Graph

17 Commits

Author SHA1 Message Date
Moritz Haase d8af2889f8 roles/ensure-python: Fix 'python_use_stow' option
Fix a syntax error in stow.yaml that broke the 'python_use_stow' option. While
at it, make sure that a proper error message is shown if no stow environments
are installed on the system.

Change-Id: Ifa696daa367997fb705ba22527137f4f051ca558
2023-07-11 06:17:29 +00:00
Ian Wienand 02b8b63d09 ensure-python: pull in venv package on Debuntu
When installing from packages on Debuntu, also bring in the
python<version>-venv package as a base dependency.

Change-Id: Ie3c03fea82bcec80a897f0905c15f35405a50396
2022-07-26 13:22:19 +10:00
Clark Boylan 52e84220e5 Make note of python_version being a string value
The type of the python_version variable matters when we interpret it
after yaml deserialization. If it is interpreted as a float then 3.1 ==
3.10 and those python versions are very different. Instead make note
that it should be a string and then update all of the tox jobs to set
this variable as a string.

Change-Id: I55bbc70526a13e6bd4c3c32da8590ad2af76fe7c
2022-05-16 09:16:35 -07:00
Zuul 00c8ae9204 Merge "[ensure-python] Improve check for CentOS/RHEL 9 packages" 2022-03-03 17:37:39 +00:00
Szymon Datko fab437bbfe [ensure-python] Improve check for CentOS/RHEL 9 packages
The value of python_version is float by default.
The existing comparison will only work for strings.
This commit changes it to work in both cases.

Change-Id: Ib13c33f38b611a38525d2803474b4ae1e05413f7
2022-03-02 13:16:58 +00:00
Zuul b67fc88b0c Merge "[ensure-python] Fix for CentOS/RHEL 9 packages" 2022-03-01 16:05:50 +00:00
jgilaber 1f3920f6eb Add patch to list of build dependencies
This commit adds the patch package to the list of python build
dependencies for pyenv. This is not always necessary, but some python
versions (for example 3.7.12) require a patch to be applied before
installing and the process fails if the patch package is not installed.

Change-Id: I605fc1c9255e98692a6a901cfc509b7fdb873ae1
2022-02-17 10:16:25 +01:00
Szymon Datko 272f091cf9 [ensure-python] Fix for CentOS/RHEL 9 packages
This commit introduces a conditional for RPM package name
when running on a recent CentOS/RHEL system.

Change-Id: I716cc97a8dace02c874d2e39dc90d6a42808ebf6
2022-02-16 14:27:14 +01:00
Szymon Datko ced6cd132f Add support for RPM packages
This commit extends the installation of Python interpreter
from system packages to also support RPM packages (assuming
the playbook is run in an environment with proper repositories).

Also the obsolete note about supporting only Debian distribution
is removed, as the `ensure-python` role already supports other
platforms (via pyenv and stow).

Change-Id: Id6ef8ec3537952348e0a7b233bd26b57613da327
2022-01-18 16:00:22 +01:00
Dmitriy Rabotyagov 39776cfdd9 Make sure that we pass list in loop
map returns a generator that needs to be converted to a list for
the loop.

We also don't need unique as this is iterating over a list of
directory names that must already be unique.

Change-Id: Ibd22d79be29aaa9d3a7924319c59929e665f9cbc
2020-09-28 22:45:13 +00:00
Dmitriy Rabotyagov 3faa27fd2d Add support to use stow for ensure-python
In case image is prepared with python-stow-versions element,
it make sense to use stow to just enable required python version instead
of building it for each job run.

Change-Id: Ie04a2bb59d351c1e5c79b2da79f7a094c44cdf86
2020-09-24 07:39:52 +00:00
Mohammed Naser 3fc4f44958 pyenv: install libffi-dev
Without this package, you'll get an error similar to this:

  ModuleNotFoundError: No module named '_ctypes'

Change-Id: If1b7b66217a33c9001a20449d695cd91dfa2e3c6
2020-05-09 14:03:51 -05:00
Albin Vass 9062289151 Check for loop_control in with_ type loops
Change-Id: I191265df7709a6262b44a428d78fe28ffaeb4b75
2020-05-01 13:45:34 +02:00
Ian Wienand 2f7ff89384 Python roles: misc doc updates
Some minor formatting things I noticed when reading through the page
of role documentation.

Change-Id: I2f94102badd83d82073df2dfb1e36a524c7b0686
2020-04-17 10:45:26 +02:00
Monty Taylor e71d0d2607 Add support for installing python with pyenv
In order to install particular python versions on distros that
don't otherwise have them, add an option for installing via
pyenv.

The packages to be installed to allow for Python to be built were
tested on the official Docker containers so they should provide
a fair amount of coverage from a minimal environment.

Co-Authored-By: Mohammed Naser <mnaser@vexxhost.com>
Change-Id: Ic3312458b499a4b743895fa5829bb25155f77654
2020-03-17 17:32:49 -04:00
Corey Bryant 3d934ebfda Limit ensure-python to Debian/Ubuntu use
While ensure-python has the potential to support more distros,
it currently is limited to Debian based installs. This patch
ensures that, for now, it can only be used for Debian or Ubuntu.

Change-Id: Id02251f211d700d1fdd1fe43d7310b5779c1662d
2018-10-16 08:53:34 -04:00
Corey Bryant 42cf8e680a Add ensure-python role
ensure-python allows for installation of a specific version of
the python interpreter and development files. Add this role to
tox pre.yaml.

Change-Id: Ia56cba58c87aa48de3e8e3f3d28f6252f7dcd7c3
2018-10-11 21:45:00 -04:00