Skip to content

Commit 0e273cd

Browse files
committed
08.export-stage/02.export-sources: Download sources for pip installed packages
Signed-off-by: mlradu <larisa.radu@analog.com>
1 parent 94cb479 commit 0e273cd

File tree

1 file changed

+18
-0
lines changed
  • stages/08.export-stage/02.export-sources

1 file changed

+18
-0
lines changed

stages/08.export-stage/02.export-sources/run.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ if [ "${EXPORT_SOURCES}" = y ]; then
1717
mkdir -p kuiper-volume/sources/deb-src-rpi
1818
mkdir -p kuiper-volume/sources/adi-git
1919
mkdir -p kuiper-volume/sources/adi-boot
20+
mkdir -p kuiper-volume/sources/pip-src
2021

2122

2223
######################## ADI git sources ########################
@@ -88,6 +89,23 @@ EOF
8889
rm -r "${BUILD_DIR}/deb-src-rpi"
8990
fi
9091

92+
######################## Pip packages sources ########################
93+
94+
mkdir "${BUILD_DIR}/pip-src"
95+
mount --bind /kuiper-volume/sources/pip-src "${BUILD_DIR}/pip-src"
96+
97+
# --format=freeze: install only one version of the package
98+
# --no-binary :all: : downloads only sources, not precompiled weels
99+
# --no-deps: does not download dependencies
100+
# --no-build-isolation: avoid virtual environments
101+
# || true: ensures that the script continues running even if the pip command is not installed, a package has missing or broken dependencies, or if the required wheels cannot be found
102+
chroot "${BUILD_DIR}" << EOF
103+
pip list --format=freeze | xargs -I {} /usr/bin/python3 -m pip download {} --no-binary :all: --no-deps --no-build-isolation -d /pip-src/ || true
104+
EOF
105+
106+
umount "${BUILD_DIR}/pip-src"
107+
rm -r "${BUILD_DIR}/pip-src"
108+
91109
else
92110
echo "Sources won't be exported because EXPORT_SOURCES is set to 'n'."
93111
fi

0 commit comments

Comments
 (0)