Skip to content

Commit

Permalink
pythongh-202: Simply Windows installation
Browse files Browse the repository at this point in the history
  • Loading branch information
jkloth committed May 17, 2022
1 parent 6e7b445 commit c503652
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
21 changes: 0 additions & 21 deletions doc/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
==============
Expand Down
6 changes: 6 additions & 0 deletions pyperformance/venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit c503652

Please sign in to comment.