Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

demo: check if we are in a virtualenv before overriding PYTHONPATH #12916

Merged
merged 3 commits into from
May 30, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog.d/12916.misc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Check if we are in a virtual environment before overriding the `PYTHONPATH` environment variable in the demo script.
11 changes: 6 additions & 5 deletions demo/start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ CWD=$(pwd)

cd "$DIR/.." || exit

PYTHONPATH=$(readlink -f "$(pwd)")
export PYTHONPATH


echo "$PYTHONPATH"
# Do not override PYTHONPATH if we are in a virtual env
if [ "$VIRTUAL_ENV" = "" ]; then
PYTHONPATH=$(readlink -f "$(pwd)")
export PYTHONPATH
echo "$PYTHONPATH"
fi

# Create servers which listen on HTTP at 808x and HTTPS at 848x.
for port in 8080 8081 8082; do
Expand Down