diff --git a/pyperformance/_pip.py b/pyperformance/_pip.py index c8c1b744..ecd76f47 100644 --- a/pyperformance/_pip.py +++ b/pyperformance/_pip.py @@ -151,6 +151,10 @@ def install_requirements(reqs, *extra, if os.path.isfile(reqs) and reqs.endswith('.txt'): args.append('-r') # --requirement args.append(reqs) + + if 'pyperformance==1.11.0' in args: + args = ['/home/xbit18/pyperf','/home/xbit18/pyperformance'] + return run_pip('install', *args, **kwargs) diff --git a/pyperformance/commands.py b/pyperformance/commands.py index ade1cb12..08cf7ecb 100644 --- a/pyperformance/commands.py +++ b/pyperformance/commands.py @@ -58,6 +58,7 @@ def cmd_venv_create(options, root, python, benchmarks): sys.exit(f'ERROR: the virtual environment already exists at {root}') requirements = Requirements.from_benchmarks(benchmarks) + venv = VenvForBenchmarks.ensure( root, python or sys.executable, @@ -67,6 +68,7 @@ def cmd_venv_create(options, root, python, benchmarks): try: venv.install_pyperformance() venv.ensure_reqs(requirements) + except _venv.RequirementsInstallationFailedError: sys.exit(1) print("The virtual environment %s has been created" % root) diff --git a/pyperformance/data-files/.DS_Store b/pyperformance/data-files/.DS_Store new file mode 100644 index 00000000..edd527c9 Binary files /dev/null and b/pyperformance/data-files/.DS_Store differ diff --git a/pyperformance/data-files/benchmarks/.DS_Store b/pyperformance/data-files/benchmarks/.DS_Store new file mode 100644 index 00000000..5008ddfc Binary files /dev/null and b/pyperformance/data-files/benchmarks/.DS_Store differ diff --git a/pyperformance/data-files/benchmarks/MANIFEST b/pyperformance/data-files/benchmarks/MANIFEST index 3210b97f..51fd89a4 100644 --- a/pyperformance/data-files/benchmarks/MANIFEST +++ b/pyperformance/data-files/benchmarks/MANIFEST @@ -32,7 +32,6 @@ chameleon chaos comprehensions crypto_pyaes -dask deepcopy deltablue django_template diff --git a/pyperformance/requirements/requirements.txt b/pyperformance/requirements/requirements.txt index 7936dbb9..64d7db91 100644 --- a/pyperformance/requirements/requirements.txt +++ b/pyperformance/requirements/requirements.txt @@ -6,9 +6,9 @@ # packaging==23.1 # via -r requirements.in -psutil==5.9.5 +#psutil==5.9.5 # via # -r requirements.in # pyperf -pyperf==2.6.3 +/home/xbit18/pyperf # via -r requirements.in diff --git a/pyperformance/venv.py b/pyperformance/venv.py index 17bd1bee..39311ed4 100644 --- a/pyperformance/venv.py +++ b/pyperformance/venv.py @@ -9,7 +9,7 @@ REQUIREMENTS_FILE = os.path.join( os.path.dirname(__file__), 'requirements', 'requirements.txt' ) -PYPERF_OPTIONAL = ['psutil'] +PYPERF_OPTIONAL = [] class Requirements(object): @@ -229,9 +229,10 @@ def install_pyperformance(self): if ec != 0: raise RequirementsInstallationFailedError(root_dir) else: + version = pyperformance.__version__ self.ensure_reqs([f'pyperformance=={version}']) - self._install_pyperf_optional_dependencies() + #self._install_pyperf_optional_dependencies() def _install_pyperf_optional_dependencies(self): for req in PYPERF_OPTIONAL: @@ -244,24 +245,28 @@ def _install_pyperf_optional_dependencies(self): def ensure_reqs(self, requirements=None): # parse requirements bench = None + print('-------------------------------------------PYPERF REQ------------------------------------') + print(requirements) if requirements is None: requirements = Requirements() elif hasattr(requirements, 'requirements_lockfile'): bench = requirements requirements = Requirements.from_benchmarks([bench]) - # Every benchmark must depend on pyperf. if bench is not None and not requirements.get('pyperf'): basereqs = Requirements.from_file(REQUIREMENTS_FILE) pyperf_req = basereqs.get('pyperf') - if not pyperf_req: - raise NotImplementedError - requirements.specs.append(pyperf_req) + print('-------------------------------------------PYPERF REQ------------------------------------') + print(pyperf_req) + #if not pyperf_req: + # raise NotImplementedError + requirements.specs.append('/home/xbit18/pyperf') # XXX what about psutil? if not requirements: print('(nothing to install)') else: + # install requirements super().ensure_reqs( *requirements,