From dfa9f15817038e464dcdc0af04d1ebbb413f36c9 Mon Sep 17 00:00:00 2001 From: Richard Berger Date: Fri, 30 Apr 2021 18:18:58 -0400 Subject: [PATCH] Use URL-encoded PIP_FIND_LINKS to support spaces in paths --- tools/offline/README.md | 3 +-- tools/offline/scripts/use_pip_cache.sh | 4 +++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/offline/README.md b/tools/offline/README.md index a13d2a660a..cb4b505fc2 100644 --- a/tools/offline/README.md +++ b/tools/offline/README.md @@ -12,8 +12,7 @@ It does so by As of April 2021, all of these downloads make up around 600MB. By default, it will download everything into $HOME/.cache/lammps, but this can be -changed with the ``LAMMPS_CACHING_DIR`` environment variable. Note that due to -a limitation in pip, the ``LAMMPS_CACHING_DIR`` can not contain spaces. +changed with the ``LAMMPS_CACHING_DIR`` environment variable. Once the caches have been initialized, they can be used for building LAMMPS documentation or compiling using CMake on an offline system. diff --git a/tools/offline/scripts/use_pip_cache.sh b/tools/offline/scripts/use_pip_cache.sh index c3e3e2cb15..6279264e9c 100644 --- a/tools/offline/scripts/use_pip_cache.sh +++ b/tools/offline/scripts/use_pip_cache.sh @@ -7,8 +7,10 @@ then exit 1 fi +URL_ENCODED_PATH="$(python3 -c "import urllib.parse; print(urllib.parse.quote(input()))" <<< "$PIP_CACHE_DIR")" + export PIP_NO_INDEX=1 -export PIP_FIND_LINKS="$PIP_CACHE_DIR" +export PIP_FIND_LINKS="file://$URL_ENCODED_PATH" echo "Disabling pip index and use local cache directory..."