summaryrefslogtreecommitdiff
path: root/pkgs/development/interpreters/python/hooks/python-output-dist-hook.sh
blob: be54b546cadb85296096763f28b4c4f3d083c04f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# Setup hook for storing dist folder (wheels/sdists) in a separate output
# shellcheck shell=bash

echo "Sourcing python-catch-conflicts-hook.sh"

pythonOutputDistPhase() {
    echo "Executing pythonOutputDistPhase"
    if [[ -d dist ]]; then
        # shellcheck disable=SC2154
        mv "dist" "$dist"
    else
        cat >&2 <<EOF
The build contains no ./dist directory.
If this project is not setuptools-based, pass

  format = "other";

to buildPythonApplication/buildPythonPackage or another appropriate value as described here:

  https://nixos.org/manual/nixpkgs/stable/#buildpythonpackage-function
EOF
        false
    fi
    echo "Finished executing pythonOutputDistPhase"
}

appendToVar preFixupPhases pythonOutputDistPhase