All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] tools/make_pip: Use venv when invoking pip
@ 2025-04-16 12:36 Mattijs Korpershoek
  2025-04-16 12:47 ` Quentin Schulz
  2025-04-25 13:42 ` Tom Rini
  0 siblings, 2 replies; 7+ messages in thread
From: Mattijs Korpershoek @ 2025-04-16 12:36 UTC (permalink / raw)
  To: Tom Rini, Simon Glass; +Cc: u-boot, Mattijs Korpershoek

Recent Ubuntu versions (24.04+) disallow pip by default when
installing packages. The recommended approach is to use a virtual
environment (venv) instead.
Because of this, "make pip" is failing on such versions.

To prepare CI container migration to Ubuntu 24.04, use a venv in the
make_pip script.

Note: This has been reported on [1]

[1] https://source.denx.de/u-boot/custodians/u-boot-dm/-/issues/37

Signed-off-by: Mattijs Korpershoek <mkorpershoek@kernel.org>
---
This has been tested in docker on ubuntu:24.04 after running:
$ apt install python3 python3-venv

with:
$ ./scripts/make_pip.sh u_boot_pylib "-n"

And shows:
Successfully built u_boot_pylib-0.0.6.tar.gz and u_boot_pylib-0.0.6-py3-none-any.whl

Also tested with "$ make pip".
---
Changes in v2:
- Use venv instead of virtualenv (Tom)
- Link to v1: https://lore.kernel.org/r/20250409-ubuntu-24-04-v1-1-056728207b6c@kernel.org
---
 scripts/make_pip.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/scripts/make_pip.sh b/scripts/make_pip.sh
index d2639ffd6e43..33ad51ada703 100755
--- a/scripts/make_pip.sh
+++ b/scripts/make_pip.sh
@@ -106,6 +106,10 @@ fi
 mkdir ${dir}/tests
 cd ${dir}
 
+# Use virtual environment
+python3 -m venv .venv
+source .venv/bin/activate
+
 # Make sure the tools are up to date
 python3 -m pip install --upgrade build
 python3 -m pip install --upgrade twine
@@ -122,6 +126,8 @@ if [ -n "${upload}" ]; then
 	echo "Completed upload of ${tool}"
 fi
 
+# Finish using virtual environment
+deactivate
 rm -rf "${dir}"
 
 echo -e "done\n\n"

---
base-commit: 9d9fbdab0e9664bff147109cc89ad2786f6ecd83
change-id: 20250408-ubuntu-24-04-0dce32b95770

Best regards,
-- 
Mattijs Korpershoek <mkorpershoek@kernel.org>


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2025-04-25 13:43 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-04-16 12:36 [PATCH v2] tools/make_pip: Use venv when invoking pip Mattijs Korpershoek
2025-04-16 12:47 ` Quentin Schulz
2025-04-16 14:21   ` Mattijs Korpershoek
2025-04-16 14:26     ` Quentin Schulz
2025-04-16 15:06       ` Mattijs Korpershoek
2025-04-16 15:09         ` Quentin Schulz
2025-04-25 13:42 ` Tom Rini

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.