cd src

export PIP_NO_INDEX=true
export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS"

# First build the sdist, then build the wheel from the sdist.
# https://pypa-build.readthedocs.io/en/latest/#python--m-build
# (Important because sagemath-objects uses MANIFEST.in for filtering.)
if [ "$SAGE_WHEELS" = yes ]; then
    sdh_build_wheel --sdist-then-wheel .
    if [ "$SAGE_EDITABLE" = yes ]; then
        # Do not install the wheel
        wheel=$(sdh_store_wheel . >&2 && echo $wheel)
    else
        wheel=$(sdh_store_and_pip_install_wheel . >&2 && echo $wheel)
    fi
    ls -l "$wheel"
fi
