Skip to content

Commit

Permalink
Pass through NUMBER_OF_PROCESSORS on Windows (#2647)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
gaborbernat and pre-commit-ci[bot] committed Dec 8, 2022
1 parent a9bfef3 commit 8894ee9
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/changelog/2629.bugfix.rst
@@ -0,0 +1,2 @@
Pass through ``NUMBER_OF_PROCESSORS`` on Windows as is needed for ``multiprocessing.cpu_count`` -
by :user:`gaborbernat`.
1 change: 1 addition & 0 deletions src/tox/tox_env/python/api.py
Expand Up @@ -94,6 +94,7 @@ def _default_pass_env(self) -> list[str]:
"SYSTEMROOT", # needed for python's crypto module
"COMSPEC", # needed for distutils cygwin compiler
"PROCESSOR_ARCHITECTURE", # platform.machine()
"NUMBER_OF_PROCESSORS", # multiprocessing.cpu_count()
],
)
env.extend(["REQUESTS_CA_BUNDLE"])
Expand Down
2 changes: 1 addition & 1 deletion tests/session/cmd/test_show_config.py
Expand Up @@ -100,7 +100,7 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
expected = (
(["COMSPEC"] if is_win else [])
+ ["CURL_CA_BUNDLE", "LANG", "LANGUAGE", "LD_LIBRARY_PATH"]
+ (["MSYSTEM", "PATHEXT"] if is_win else [])
+ (["MSYSTEM", "NUMBER_OF_PROCESSORS", "PATHEXT"] if is_win else [])
+ ["PIP_*"]
+ (["PROCESSOR_ARCHITECTURE"] if is_win else [])
+ (["PROGRAMDATA"] if is_win else [])
Expand Down

0 comments on commit 8894ee9

Please sign in to comment.