diff options
Diffstat (limited to 'nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh')
-rw-r--r-- | nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh b/nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh index 15d2bd0eb34c..37479d9d4111 100644 --- a/nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh +++ b/nixpkgs/pkgs/development/interpreters/python/hooks/python-namespaces-hook.sh @@ -24,6 +24,17 @@ pythonNamespacesHook() { rm -v "$pathToRemove" fi + # remove ${pname}-${version}-${python-interpeter}-nspkg.pth + # + # Still need to check that parent directory exists in the + # event of a "meta-package" package, which will just install + # other packages, but not produce anything in site-packages + # besides meta information + if [ -d "${constructedPath}/../" -a -z ${dontRemovePth-} ]; then + # .pth files are located in the parent directory of a module + @findutils@/bin/find ${constructedPath}/../ -name '*-nspkg.pth' -exec rm -v "{}" + + fi + # remove __pycache__/ entry, can be interpreter specific. E.g. __init__.cpython-38.pyc # use null characters to perserve potential whitespace in filepath if [ -d "$pycachePath" ]; then |