mirror of https://github.com/zulip/zulip.git
sanity_check: Test for the virtualenv by its path.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
parent
94839c9492
commit
42aa916967
|
@ -4,17 +4,7 @@ import sys
|
||||||
|
|
||||||
|
|
||||||
def check_venv(filename: str) -> None:
|
def check_venv(filename: str) -> None:
|
||||||
try:
|
if os.path.basename(sys.prefix) != "zulip-py3-venv":
|
||||||
# Here we import 3 modules that we expect to be in any valid
|
|
||||||
# Zulip virtualenv but are unlikely to all be present on a
|
|
||||||
# host system to help check whether we're in Vagrant.
|
|
||||||
import bitfield
|
|
||||||
import django
|
|
||||||
import zulip
|
|
||||||
bitfield
|
|
||||||
django
|
|
||||||
zulip
|
|
||||||
except ImportError:
|
|
||||||
print(f"You need to run {filename} inside a Zulip dev environment.")
|
print(f"You need to run {filename} inside a Zulip dev environment.")
|
||||||
user_id = os.getuid()
|
user_id = os.getuid()
|
||||||
user_name = pwd.getpwuid(user_id).pw_name
|
user_name = pwd.getpwuid(user_id).pw_name
|
||||||
|
|
Loading…
Reference in New Issue