Repository: tox-dev/tox

Issue:
Consider whitelisting `PROCESSOR_ARCHITECTURE` environment variable
On windows, this is necessary for [`platform.machine()`](https://docs.python.org/3/library/platform.html#platform.machine) to function

```
$ tox --version
2.9.1 imported from c:\users\anthony\appdata\local\temp\venv\lib\site-packages\tox\__init__.pyc
```

```ini
[tox]
envlist = py27
skipsdist = true

[testenv]
commands =
    python -c 'import platform; print(platform.machine())'
```

```
$ tox -e py27
py27 create: C:\Users\Anthony\AppData\Local\Temp\.tox\py27
py27 installed:
py27 runtests: PYTHONHASHSEED='154'
py27 runtests: commands[0] | python -c import platform; print(platform.machine())

______________________________________________________ summary _______________________________________________________
  py27: commands succeeded
  congratulations :)

$ TOX_TESTENV_PASSENV=PROCESSOR_ARCHITECTURE tox -e py27
py27 installed:
py27 runtests: PYTHONHASHSEED='864'
py27 runtests: commands[0] | python -c import platform; print(platform.machine())
AMD64
______________________________________________________ summary _______________________________________________________
  py27: commands succeeded
  congratulations :)
```

Hitting this in https://github.com/pre-commit/pre-commit/pull/685 where I'm working around this by adding `PROCESSOR_ARCHITECTURE` to `passenv`

Discussion:
codecov[bot]: # [Codecov](https://codecov.io/gh/tox-dev/tox/pull/742?src=pr&el=h1) Report
> Merging [#742](https://codecov.io/gh/tox-dev/tox/pull/742?src=pr&el=desc) into [master](https://codecov.io/gh/tox-dev/tox/commit/36ff71d18d10e3c0d4275179d8912abc385b20f0?src=pr&el=desc) will **increase** coverage by `<.01%`.
> The diff coverage is `100%`.

[![Impacted file tree graph](https://codecov.io/gh/tox-dev/tox/pull/742/graphs/tree.svg?width=650&token=DYodAwDCZ5&height=150&src=pr)](https://codecov.io/gh/tox-dev/tox/pull/742?src=pr&el=tree)

```diff
@@            Coverage Diff             @@
##           master     #742      +/-   ##
==========================================
+ Coverage   94.67%   94.67%   +<.01%     
==========================================
  Files          11       11              
  Lines        2383     2384       +1     
==========================================
+ Hits         2256     2257       +1     
  Misses        127      127
```


| [Impacted Files](https://codecov.io/gh/tox-dev/tox/pull/742?src=pr&el=tree) | Coverage Δ | |
|---|---|---|
| [tox/config.py](https://codecov.io/gh/tox-dev/tox/pull/742/diff?src=pr&el=tree#diff-dG94L2NvbmZpZy5weQ==) | `97.75% <100%> (ø)` | :arrow_up: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/tox-dev/tox/pull/742?src=pr&el=continue).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/tox-dev/tox/pull/742?src=pr&el=footer). Last update [36ff71d...0c5a478](https://codecov.io/gh/tox-dev/tox/pull/742?src=pr&el=lastupdated). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments).


Patch:
diff --git a/changelog/740.feature.rst b/changelog/740.feature.rst
new file mode 100644
index 00000000..236efbd8
--- /dev/null
+++ b/changelog/740.feature.rst
@@ -0,0 +1,2 @@
+Forward ``PROCESSOR_ARCHITECTURE`` by default on Windows to fix
+``platform.machine()``.
diff --git a/tox/config.py b/tox/config.py
index d03c97e0..ec9dc6c2 100755
--- a/tox/config.py
+++ b/tox/config.py
@@ -530,6 +530,7 @@ def tox_addoption(parser):
             # for `multiprocessing.cpu_count()` on Windows
             # (prior to Python 3.4).
             passenv.add("NUMBER_OF_PROCESSORS")
+            passenv.add("PROCESSOR_ARCHITECTURE")  # platform.machine()
             passenv.add("USERPROFILE")  # needed for `os.path.expanduser()`
             passenv.add("MSYSTEM")  # fixes #429
         else:


Test patch:
diff --git a/tests/test_config.py b/tests/test_config.py
index e8e8d559..1f446caa 100644
--- a/tests/test_config.py
+++ b/tests/test_config.py
@@ -908,6 +908,7 @@ class TestConfigTestEnv:
             assert "TEMP" in envconfig.passenv
             assert "TMP" in envconfig.passenv
             assert "NUMBER_OF_PROCESSORS" in envconfig.passenv
+            assert "PROCESSOR_ARCHITECTURE" in envconfig.passenv
             assert "USERPROFILE" in envconfig.passenv
             assert "MSYSTEM" in envconfig.passenv
         else: