From c5036520bf434e38cbe305c2ddc4def0d6793a9b Mon Sep 17 00:00:00 2001 From: Jeremy Kloth Date: Tue, 17 May 2022 17:25:30 -0600 Subject: [PATCH] gh-202: Simply Windows installation --- doc/usage.rst | 21 --------------------- pyperformance/venv.py | 6 ++++++ 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/doc/usage.rst b/doc/usage.rst index c7336407..a628e9c0 100644 --- a/doc/usage.rst +++ b/doc/usage.rst @@ -23,27 +23,6 @@ extension. Commands on Fedora to install dependencies: * Python 3: ``sudo dnf install python3-devel`` * PyPy: ``sudo dnf install pypy-devel`` -Windows notes -------------- - -On Windows, to allow pyperformance to build dependencies from source -like ``greenlet``, ``dulwich`` or ``psutil``, if you want to use a -``python.exe`` built from source, you should not use the ``python.exe`` -directly. Instead, you must run the little-known command ``PC\layout`` -to create a filesystem layout that resembles an installed Python:: - - .\python.bat -m PC.layout --preset-default --copy installed -v - -(Use the ``--help`` flag for more info about ``PC\layout``.) - -Now you can use the "installed" Python executable:: - - installed\python.exe -m pip install pyperformance - installed\python.exe -m pyperformance run ... - -Using an *actually* installed Python executable (e.g. via ``py``) -works fine too. - Run benchmarks ============== diff --git a/pyperformance/venv.py b/pyperformance/venv.py index fe686a9e..db5aee9f 100644 --- a/pyperformance/venv.py +++ b/pyperformance/venv.py @@ -137,6 +137,12 @@ def _get_envvars(inherit=None, osname=None): copy_env.extend(inherit) env = {} + # Recent setuptools versions have a bug that prevents being + # used to compile from a source build virtual environment. + # [BUG](https://github.com/pypa/setuptools/issues/3325) + # The stdlib distutils does not have this problem. + if os.name == 'nt': + env['SETUPTOOLS_USE_DISTUTILS'] = 'stdlib' for name in copy_env: if name in os.environ: env[name] = os.environ[name]