Use URL-encoded PIP_FIND_LINKS to support spaces in paths

This commit is contained in:
Richard Berger
2021-04-30 18:18:58 -04:00
parent ee0e48ff86
commit dfa9f15817
2 changed files with 4 additions and 3 deletions

View File

@ -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.

View File

@ -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..."