Skip to content

Commit

Permalink
CI: Install package from outside source tree
Browse files Browse the repository at this point in the history
  • Loading branch information
effigies committed Mar 11, 2022
1 parent 3e1c42c commit b12e700
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 8 deletions.
8 changes: 4 additions & 4 deletions tools/ci/build_archive.sh
Expand Up @@ -14,16 +14,16 @@ set -x
if [ "$INSTALL_TYPE" = "sdist" -o "$INSTALL_TYPE" = "wheel" ]; then
python -m build
elif [ "$INSTALL_TYPE" = "archive" ]; then
ARCHIVE="package.tar.gz"
ARCHIVE="/tmp/package.tar.gz"
git archive -o $ARCHIVE HEAD
fi

if [ "$INSTALL_TYPE" = "sdist" ]; then
ARCHIVE=$( ls dist/*.tar.gz )
ARCHIVE=$( ls $PWD/dist/*.tar.gz )
elif [ "$INSTALL_TYPE" = "wheel" ]; then
ARCHIVE=$( ls dist/*.whl )
ARCHIVE=$( ls $PWD/dist/*.whl )
elif [ "$INSTALL_TYPE" = "pip" ]; then
ARCHIVE="."
ARCHIVE="$PWD"
fi

export ARCHIVE
Expand Down
13 changes: 9 additions & 4 deletions tools/ci/install.sh
Expand Up @@ -18,10 +18,15 @@ if [ -n "$EXTRA_PIP_FLAGS" ]; then
EXTRA_PIP_FLAGS=${!EXTRA_PIP_FLAGS}
fi

pip install $EXTRA_PIP_FLAGS $ARCHIVE

# Basic import check
python -c 'import nibabel; print(nibabel.__version__)'
(
# Ensure installation does not depend on being in source tree
mkdir ../unversioned_install_dir
cd ../unversioned_install_dir
pip install $EXTRA_PIP_FLAGS $ARCHIVE

# Basic import check
python -c 'import nibabel; print(nibabel.__version__)'
)

if [ "$CHECK_TYPE" == "skiptests" ]; then
exit 0
Expand Down

0 comments on commit b12e700

Please sign in to comment.