Browse Source

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

tags/2.34.0^0
Zuul 4 months ago
committed by Gerrit Code Review
parent
commit
61b72ca2c2
8 changed files with 54 additions and 3 deletions
  1. +5
    -0
      diskimage_builder/elements/ensure-venv/README.rst
  2. +1
    -0
      diskimage_builder/elements/ensure-venv/element-deps
  3. +1
    -0
      diskimage_builder/elements/ensure-venv/package-installs.yaml
  4. +19
    -0
      diskimage_builder/elements/ensure-venv/pkg-map
  5. +1
    -1
      diskimage_builder/elements/simple-init/element-deps
  6. +7
    -1
      diskimage_builder/elements/simple-init/install.d/simple-init-repo-install/40-glean
  7. +7
    -1
      diskimage_builder/elements/simple-init/install.d/simple-init-source-install/40-glean
  8. +13
    -0
      releasenotes/notes/ensure-venv-d7c16a2a04fd3b8f.yaml

+ 5
- 0
diskimage_builder/elements/ensure-venv/README.rst View File

@@ -0,0 +1,5 @@
===========
ensure-venv
===========

A simple element to make sure `python3 -m venv` will work.

+ 1
- 0
diskimage_builder/elements/ensure-venv/element-deps View File

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

+ 1
- 0
diskimage_builder/elements/ensure-venv/package-installs.yaml View File

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

+ 19
- 0
diskimage_builder/elements/ensure-venv/pkg-map 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": ""
}
}

+ 1
- 1
diskimage_builder/elements/simple-init/element-deps View File

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

+ 7
- 1
diskimage_builder/elements/simple-init/install.d/simple-init-repo-install/40-glean View File

@@ -21,4 +21,10 @@ fi
set -eu
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

+ 7
- 1
diskimage_builder/elements/simple-init/install.d/simple-init-source-install/40-glean View File

@@ -21,4 +21,10 @@ fi
set -eu
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

+ 13
- 0
releasenotes/notes/ensure-venv-d7c16a2a04fd3b8f.yaml 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.

Loading…
Cancel
Save