Skip to content

Commit d373c5e

Browse files
authored
Inherit PYTHONPATH when spawning workers. (psf#148)
Prepare release 2.6.0.
1 parent a422732 commit d373c5e

File tree

8 files changed

+16
-10
lines changed

8 files changed

+16
-10
lines changed

doc/changelog.rst

+6
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
Changelog
22
=========
33

4+
Version 2.6.0 (2022-11-21)
5+
-------------
6+
7+
* Inherit ``PYTHONPATH`` environment variable by default.
8+
Patch by Theodore Ni.
9+
410
Version 2.5.0 (2022-11-04)
511
-------------
612

doc/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
# built documents.
5656
#
5757
# The short X.Y version.
58-
version = release = '2.5.0'
58+
version = release = '2.6.0'
5959

6060
# The language for content autogenerated by Sphinx. Refer to documentation
6161
# for a list of supported languages.

doc/runner.rst

+4-3
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,10 @@ Option::
118118
isolated CPUs are found. See :ref:`CPU pinning and CPU isolation <pin-cpu>`.
119119
* ``--inherit-environ=VARS``: ``VARS`` is a comma-separated list of environment
120120
variable names which are inherited by worker child processes. By default,
121-
only the following variables are inherited: ``PATH``, ``HOME``, ``TEMP``,
122-
``COMSPEC``, ``SystemRoot`` and locale environment variables. See the
123-
``--no-locale`` below for locale environment variables.
121+
only the following variables are inherited: ``PATH``, ``PYTHONPATH``,
122+
``HOME``, ``TEMP``, ``COMSPEC``, ``SystemRoot``, ``SystemDrive``, and locale
123+
environment variables. See the ``--no-locale`` below for locale environment
124+
variables.
124125
* ``--copy-env``: Inherit all environment variables.
125126
* ``--no-locale``: Don't inherit locale environment variables:
126127

pyperf/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from time import perf_counter
22

3-
VERSION = (2, 5, 0)
3+
VERSION = (2, 6, 0)
44
__version__ = '.'.join(map(str, VERSION))
55

66
# Export pyperf.perf_counter for backward compatibility with pyperf 1.7

pyperf/_utils.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ def create_environ(inherit_environ, locale, copy_all):
279279
return os.environ
280280
env = {}
281281

282-
copy_env = ["PATH", "HOME", "TEMP", "COMSPEC", "SystemRoot", "SystemDrive"]
282+
copy_env = ["PATH", "PYTHONPATH", "HOME", "TEMP", "COMSPEC", "SystemRoot", "SystemDrive"]
283283
if locale:
284284
copy_env.extend(('LANG', 'LC_ADDRESS', 'LC_ALL', 'LC_COLLATE',
285285
'LC_CTYPE', 'LC_IDENTIFICATION', 'LC_MEASUREMENT',

pyperf/tests/test_examples.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def check_command(self, script, args, nproc=3):
2727
self.TESTED.add(script)
2828
script = os.path.join(EXAMPLES_DIR, script)
2929

30-
cmd = [sys.executable] + [script] + args + ["--inherit-env=PYTHONPATH"]
30+
cmd = [sys.executable] + [script] + args
3131
proc = tests.get_output(cmd)
3232

3333
self.assertRegex(proc.stdout,

pyperf/tests/test_timeit.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,7 @@ def test_python_option(self):
237237

238238
# Run benchmark to check if --python works
239239
args = ('--metadata',
240-
'--python', tmp_exe,
241-
'--inherit-env', 'PYTHONPATH')
240+
'--python', tmp_exe)
242241
args = PERF_TIMEIT + args + FAST_BENCH_ARGS
243242
cmd = tests.get_output(args, env=env)
244243
finally:

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
# - git commit -a -m "post-release"
2525
# - git push or send the PR to the repository
2626

27-
VERSION = '2.5.0'
27+
VERSION = '2.6.0'
2828

2929
DESCRIPTION = 'Python module to run and analyze benchmarks'
3030
CLASSIFIERS = [

0 commit comments

Comments
 (0)