summaryrefslogtreecommitdiff
path: root/pkgs/development/interpreters/python/hooks/python-remove-tests-dir-hook.sh
blob: 43c991b74469fa8cda69233c447cc371defc9f2f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# Clean up top-level tests directory in site-package installation.
# shellcheck shell=bash

echo "Sourcing python-remove-tests-dir-hook"

pythonRemoveTestsDir() {
    echo "Executing pythonRemoveTestsDir"

    # shellcheck disable=SC2154
    rm -rf "$out/@pythonSitePackages@/tests"
    rm -rf "$out/@pythonSitePackages@/test"

    echo "Finished executing pythonRemoveTestsDir"
}

if [ -z "${dontUsePythonRemoveTestsDir-}" ]; then
    postFixupHooks+=(pythonRemoveTestsDir)
fi