Bug 1644320 - Fix how we setup the virtualenv r=sparky

Fix how we setup the virtualenv

Differential Revision: https://phabricator.services.mozilla.com/D81597
This commit is contained in:
Tarek Ziadé 2020-07-01 18:12:06 +00:00
Родитель f6598088e1
Коммит 410c14bebe
2 изменённых файлов: 3 добавлений и 43 удалений

Просмотреть файл

@ -109,7 +109,7 @@ jobs:
- macosx64-geckodriver
run:
command: >-
virtualenv/virtualenv.py -p python3 . &&
python3 -m venv . &&
bin/python3 condprof/main.py
--geckodriver ${MOZ_FETCHES_DIR}/geckodriver
--firefox ${MOZ_FETCHES_DIR}/target.dmg

Просмотреть файл

@ -15,43 +15,6 @@ PY3 = sys.version_info.major == 3
TOPDIR = os.path.join(os.path.dirname(__file__), "..")
def update_pip():
""" Pip is updated using 19.2.3 version, along with setuptools.
See Bug 1585554 and Bug 1585038 for why we have to pick them at pythonhosted.org
Hopefully we will be able to get rid of this once we have those packages
everywhere in our infra.
"""
import pip
if pip.__version__ != "19.2.3":
subprocess.check_call(
[
sys.executable,
"-m",
"pip",
"install",
"--no-cache-dir",
"--index-url",
"https://pypi.python.org/simple",
"--upgrade",
(
"https://files.pythonhosted.org/packages/30/db/"
"9e38760b32e3e7f40cce46dd5fb107b8c73840df38f0046"
"d8e6514e675a1/pip-19.2.3-py2.py3-none-any.whl"
),
(
"https://files.pythonhosted.org/packages/b2/"
"86/095d2f7829badc207c893dd4ac767e871f6cd547145df"
"797ea26baea4e2e/setuptools-41.2.0-py2.py3-none-any.whl"
),
]
)
return True
return False
def install_reqs():
""" We install requirements one by one, with no cache, and in isolated mode.
"""
@ -102,12 +65,9 @@ def install_reqs():
def check():
""" Called by the runner.
The check function will restart the app after pip has been updated,
and then after all deps have been installed.
The check function will restart the app after
all deps have been installed.
"""
if update_pip():
os.execl(sys.executable, sys.executable, *sys.argv)
os._exit(0)
if install_reqs():
os.execl(sys.executable, sys.executable, *sys.argv)
os._exit(0)