Skip to content

Commit

Permalink
I had a newer version of this file somewhere else
Browse files Browse the repository at this point in the history
  • Loading branch information
kmod committed Jul 21, 2022
1 parent c1a3018 commit 464d764
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions run_pyperformance.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,26 @@
from pyperformance._venv import VirtualEnvironment

if __name__ == "__main__":
packages = os.environ.get("EXTRA_PACKAGES", "")
if packages:
packages = [pkg for pkg in packages.split(':')]
raw_wheels = os.environ["EXTRA_WHEELS"]
assert raw_wheels
wheels = []
for fn in raw_wheels.split(';'):
if os.path.exists(fn):
wheels.append(os.path.abspath(fn))
else:
wheels.append(fn)
assert wheels

ensure_reqs = VirtualEnvironment.ensure_reqs
def new_ensure_reqs(self, *args, **kw):
python = self.python

r = ensure_reqs(self, *args, **kw)

if packages:
print("Installing", packages)
subprocess.check_call([python, "-m", "pip", "install"] + packages)

if "pyston_lite_autoload" in packages:
subprocess.check_call([python, "-c", "import sys; assert 'pyston_lite' in sys.modules"])
print("Installing", wheels)
subprocess.check_call([python, "-m", "pip", "install"] + wheels)
if "pyston_lite_autoload" in raw_wheels:
subprocess.check_call([python, "-c", "import sys; assert 'pyston_lite' in sys.modules"])
return r

VirtualEnvironment.ensure_reqs = new_ensure_reqs
Expand Down

0 comments on commit 464d764

Please sign in to comment.