Skip to content

Commit

Permalink
Don't install dependencies from git when running Synapse in offline m…
Browse files Browse the repository at this point in the history
…ode (#1244)

Previously we used `--no-index` to prevent use of PyPI in offline mode,
but that did not apply to git dependencies. Add the `--no-deps` flag
to prevent pip from re-cloning those.

At this time, the only git dependency we might have is twisted trunk
during a daily CI run.

Signed-off-by: Sean Quah <[email protected]>
  • Loading branch information
squahtx authored Apr 21, 2022
1 parent 0d4275c commit 11ec649
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion scripts/synapse_sytest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,19 @@ if [ -n "$OFFLINE" ]; then
# pip will want to install any requirements for the build system
# (https://github.com/pypa/pip/issues/5402), so we have to provide a
# directory of pre-downloaded build requirements.
#
# We need both the `--no-deps` and `--no-index` flags for offline mode:
# `--no-index` only prevents PyPI usage and does not stop pip from
# installing dependencies from git.
# `--no-deps` skips installing dependencies but does not stop pip from
# pulling Synapse's build dependencies from PyPI.
echo "Installing Synapse using pip in offline mode..."
/venv/bin/pip install --no-index --find-links /pypi-offline-cache /synapse
/venv/bin/pip install --no-deps --no-index --find-links /pypi-offline-cache /synapse

if ! pip check ; then
echo "There are unmet dependencies which can't be installed in offline mode" >&2
exit 1
fi
else
if [ -f "/synapse/poetry.lock" ]; then
# Install Synapse and dependencies using poetry, respecting the lockfile.
Expand Down

0 comments on commit 11ec649

Please sign in to comment.