From 9521a7e95775a7a9a102278bb046843f085c49cd Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Mon, 13 Apr 2020 17:29:02 -0500 Subject: [PATCH 1/3] Build in editable mode to avoid copying tree with 'pip install .' --- build-py-project-within-miniconda.sh | 7 +++++++ build-py-project.sh | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/build-py-project-within-miniconda.sh b/build-py-project-within-miniconda.sh index 1e8c316..e5b7b1d 100644 --- a/build-py-project-within-miniconda.sh +++ b/build-py-project-within-miniconda.sh @@ -15,6 +15,13 @@ echo "-----------------------------------------------" # keep this consistent in build-py-project.sh and build-py-project-within-miniconda.sh +# Append --editable to PROJECT_INSTALL_FLAGS, if not there already. +# See: https://gitlab.tiker.net/inducer/ci-support/-/issues/3 +# Can be removed after pip 20.1 is released. +if [[ ! $(printf "%s\n" "$PROJECT_INSTALL_FLAGS" | grep -w -- --editable) ]]; then + PROJECT_INSTALL_FLAGS="$PROJECT_INSTALL_FLAGS --editable" +fi + rm -Rf .env rm -Rf build find . -name '*.pyc' -delete diff --git a/build-py-project.sh b/build-py-project.sh index 5e96b31..8ecf6a9 100644 --- a/build-py-project.sh +++ b/build-py-project.sh @@ -13,6 +13,13 @@ echo "-----------------------------------------------" # keep this consistent in build-py-project.sh and build-py-project-within-miniconda.sh +# Append --editable to PROJECT_INSTALL_FLAGS, if not there already. +# See: https://gitlab.tiker.net/inducer/ci-support/-/issues/3 +# Can be removed after pip 20.1 is released. +if [[ ! $(printf "%s\n" "$PROJECT_INSTALL_FLAGS" | grep -w -- --editable) ]]; then + PROJECT_INSTALL_FLAGS="$PROJECT_INSTALL_FLAGS --editable" +fi + rm -Rf .env rm -Rf build find . -name '*.pyc' -delete -- GitLab From d6bdb18d9ef94fc2a530a8829c6d8f77d272985d Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Mon, 13 Apr 2020 17:48:23 -0500 Subject: [PATCH 2/3] Fix match expression for PROJECT_INSTALL_FLAGS --- build-py-project-within-miniconda.sh | 2 +- build-py-project.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-py-project-within-miniconda.sh b/build-py-project-within-miniconda.sh index e5b7b1d..09b8bb4 100644 --- a/build-py-project-within-miniconda.sh +++ b/build-py-project-within-miniconda.sh @@ -18,7 +18,7 @@ echo "-----------------------------------------------" # Append --editable to PROJECT_INSTALL_FLAGS, if not there already. # See: https://gitlab.tiker.net/inducer/ci-support/-/issues/3 # Can be removed after pip 20.1 is released. -if [[ ! $(printf "%s\n" "$PROJECT_INSTALL_FLAGS" | grep -w -- --editable) ]]; then +if [[ ! $PROJECT_INSTALL_FLAGS =~ (--editable|-e)[[:space:]]*$ ]]; then PROJECT_INSTALL_FLAGS="$PROJECT_INSTALL_FLAGS --editable" fi diff --git a/build-py-project.sh b/build-py-project.sh index 8ecf6a9..132f1ab 100644 --- a/build-py-project.sh +++ b/build-py-project.sh @@ -16,7 +16,7 @@ echo "-----------------------------------------------" # Append --editable to PROJECT_INSTALL_FLAGS, if not there already. # See: https://gitlab.tiker.net/inducer/ci-support/-/issues/3 # Can be removed after pip 20.1 is released. -if [[ ! $(printf "%s\n" "$PROJECT_INSTALL_FLAGS" | grep -w -- --editable) ]]; then +if [[ ! $PROJECT_INSTALL_FLAGS =~ (--editable|-e)[[:space:]]*$ ]]; then PROJECT_INSTALL_FLAGS="$PROJECT_INSTALL_FLAGS --editable" fi -- GitLab From cb067e11527190f0479788dc64cc867590c402c5 Mon Sep 17 00:00:00 2001 From: Matt Wala Date: Mon, 13 Apr 2020 18:03:30 -0500 Subject: [PATCH 3/3] Tweak regex --- build-py-project-within-miniconda.sh | 2 +- build-py-project.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build-py-project-within-miniconda.sh b/build-py-project-within-miniconda.sh index 0381703..304df8f 100644 --- a/build-py-project-within-miniconda.sh +++ b/build-py-project-within-miniconda.sh @@ -18,7 +18,7 @@ echo "-----------------------------------------------" # Append --editable to PROJECT_INSTALL_FLAGS, if not there already. # See: https://gitlab.tiker.net/inducer/ci-support/-/issues/3 # Can be removed after pip 20.1 is released. -if [[ ! $PROJECT_INSTALL_FLAGS =~ (--editable|-e)[[:space:]]*$ ]]; then +if [[ ! $PROJECT_INSTALL_FLAGS =~ (^|[[:space:]]*)(--editable|-e)[[:space:]]*$ ]]; then PROJECT_INSTALL_FLAGS="$PROJECT_INSTALL_FLAGS --editable" fi diff --git a/build-py-project.sh b/build-py-project.sh index ed467ca..fa6ced9 100644 --- a/build-py-project.sh +++ b/build-py-project.sh @@ -16,7 +16,7 @@ echo "-----------------------------------------------" # Append --editable to PROJECT_INSTALL_FLAGS, if not there already. # See: https://gitlab.tiker.net/inducer/ci-support/-/issues/3 # Can be removed after pip 20.1 is released. -if [[ ! $PROJECT_INSTALL_FLAGS =~ (--editable|-e)[[:space:]]*$ ]]; then +if [[ ! $PROJECT_INSTALL_FLAGS =~ (^|[[:space:]]*)(--editable|-e)[[:space:]]*$ ]]; then PROJECT_INSTALL_FLAGS="$PROJECT_INSTALL_FLAGS --editable" fi -- GitLab