Skip to content

Commit 8894ee9

Browse files
Pass through NUMBER_OF_PROCESSORS on Windows (#2647)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent a9bfef3 commit 8894ee9

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

docs/changelog/2629.bugfix.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Pass through ``NUMBER_OF_PROCESSORS`` on Windows as is needed for ``multiprocessing.cpu_count`` -
2+
by :user:`gaborbernat`.

src/tox/tox_env/python/api.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ def _default_pass_env(self) -> list[str]:
9494
"SYSTEMROOT", # needed for python's crypto module
9595
"COMSPEC", # needed for distutils cygwin compiler
9696
"PROCESSOR_ARCHITECTURE", # platform.machine()
97+
"NUMBER_OF_PROCESSORS", # multiprocessing.cpu_count()
9798
],
9899
)
99100
env.extend(["REQUESTS_CA_BUNDLE"])

tests/session/cmd/test_show_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
100100
expected = (
101101
(["COMSPEC"] if is_win else [])
102102
+ ["CURL_CA_BUNDLE", "LANG", "LANGUAGE", "LD_LIBRARY_PATH"]
103-
+ (["MSYSTEM", "PATHEXT"] if is_win else [])
103+
+ (["MSYSTEM", "NUMBER_OF_PROCESSORS", "PATHEXT"] if is_win else [])
104104
+ ["PIP_*"]
105105
+ (["PROCESSOR_ARCHITECTURE"] if is_win else [])
106106
+ (["PROGRAMDATA"] if is_win else [])

0 commit comments

Comments
 (0)