Skip to content

Commit

Permalink
Pass throughy NUMBER_OF_PROCESSORS on Windows
Browse files Browse the repository at this point in the history
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
  • Loading branch information
gaborbernat committed Dec 8, 2022
1 parent 31ad830 commit a17b2bd
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions docs/changelog/2629.bugfix.rst
Original file line number Diff line number Diff line change
@@ -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
Original file line number Diff line number Diff line change
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
3 changes: 2 additions & 1 deletion tests/session/cmd/test_show_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
pass_env = outcome.env_conf("py")["pass_env"]
is_win = sys.platform == "win32"
expected = (
(["COMSPEC"] if is_win else [])
(["NUMBER_OF_PROCESSORS"] if is_win else [])
+ (["COMSPEC"] if is_win else [])
+ ["CURL_CA_BUNDLE", "LANG", "LANGUAGE", "LD_LIBRARY_PATH"]
+ (["MSYSTEM", "PATHEXT"] if is_win else [])
+ ["PIP_*"]
Expand Down

0 comments on commit a17b2bd

Please sign in to comment.