tangled
alpha
login
or
join now
pyrox.dev
/
nixpkgs
0
fork
atom
lol
0
fork
atom
overview
issues
pulls
pipelines
pythonImportsCheckHook: support __structuredAttrs = true
Yueh-Shun Li
1 year ago
967e5b43
69f48715
+6
-5
1 changed file
expand all
collapse all
unified
split
pkgs
development
interpreters
python
hooks
python-imports-check-hook.sh
+6
-5
pkgs/development/interpreters/python/hooks/python-imports-check-hook.sh
···
4
4
pythonImportsCheckPhase() {
5
5
echo "Executing pythonImportsCheckPhase"
6
6
7
7
-
if [ -n "$pythonImportsCheck" ]; then
8
8
-
echo "Check whether the following modules can be imported: $pythonImportsCheck"
9
9
-
pythonImportsCheckOutput=$out
10
10
-
if [ -n "$python" ]; then
7
7
+
if [ -n "${pythonImportsCheck[*]-}" ]; then
8
8
+
echo "Check whether the following modules can be imported: ${pythonImportsCheck[*]}"
9
9
+
# shellcheck disable=SC2154
10
10
+
pythonImportsCheckOutput="$out"
11
11
+
if [ -n "${python-}" ]; then
11
12
echo "Using python specific output \$python for imports check"
12
13
pythonImportsCheckOutput=$python
13
14
fi
14
15
export PYTHONPATH="$pythonImportsCheckOutput/@pythonSitePackages@:$PYTHONPATH"
15
15
-
(cd $pythonImportsCheckOutput && @pythonCheckInterpreter@ -c 'import os; import importlib; list(map(lambda mod: importlib.import_module(mod), os.environ["pythonImportsCheck"].split()))')
16
16
+
(cd "$pythonImportsCheckOutput" && @pythonCheckInterpreter@ -c 'import sys; import importlib; list(map(lambda mod: importlib.import_module(mod), sys.argv[1:]))' ${pythonImportsCheck[*]})
16
17
fi
17
18
}
18
19