Merge "Add ensure-venv element, install glean with it"

This commit is contained in:
Zuul 2020-03-10 05:08:54 +00:00 committed by Gerrit Code Review
commit 61b72ca2c2
8 changed files with 54 additions and 3 deletions

View File

@ -0,0 +1,5 @@
===========
ensure-venv
===========
A simple element to make sure `python3 -m venv` will work.

View File

@ -0,0 +1 @@
package-installs

View File

@ -0,0 +1 @@
python3-venv:

View File

@ -0,0 +1,19 @@
{
"family": {
"debian": {
"python3-venv": "python3-venv"
},
"gentoo": {
"python3-venv": "dev-lang/python"
},
"redhat": {
"python3-venv": "python3"
},
"suse": {
"python3-venv": "python3"
}
},
"default": {
"python3-venv": ""
}
}

View File

@ -1,6 +1,6 @@
cloud-init-datasources cloud-init-datasources
dib-init-system dib-init-system
ensure-venv
install-types install-types
pip-and-virtualenv
runtime-ssh-host-keys runtime-ssh-host-keys
source-repositories source-repositories

View File

@ -21,4 +21,10 @@ fi
set -eu set -eu
set -o pipefail set -o pipefail
$DIB_PYTHON_PIP install /tmp/glean.git python3 -m venv /usr/glean
/usr/glean/bin/pip install /tmp/glean.git
mkdir -p /usr/local/bin
ln -sf /usr/glean/bin/glean /usr/local/bin/glean
ln -sf /usr/glean/bin/glean.sh /usr/local/bin/glean.sh
ln -sf /usr/glean/bin/glean-install /usr/local/bin/glean-install

View File

@ -21,4 +21,10 @@ fi
set -eu set -eu
set -o pipefail set -o pipefail
$DIB_PYTHON_PIP install glean python3 -m venv /usr/glean
/usr/glean/bin/pip install glean
mkdir -p /usr/local/bin
ln -sf /usr/glean/bin/glean /usr/local/bin/glean
ln -sf /usr/glean/bin/glean.sh /usr/local/bin/glean.sh
ln -sf /usr/glean/bin/glean-install /usr/local/bin/glean-install

View File

@ -0,0 +1,13 @@
---
features:
- |
The `ensure-venv` module is added to ensure that `python3 -m venv`
is available on the host. This can be useful if you wish to
install non-distribution-packaged Python software on a host during
build, but not mix any non-distro installation. This works on all
platforms with Python 3 available.
depreceations:
- |
The `simple-init` element now uses `ensure-venv` so is technically
Python 3 only. At this stage, all supported platforms have Python
3 available.