Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ jobs:
fail-fast: false
matrix:
py:
- "3.11.0-rc.1"
- "3.10"
- "3.9"
- "3.8"
Expand Down Expand Up @@ -45,12 +46,11 @@ jobs:
python-version: ${{ matrix.py }}
- name: Pick environment to run
run: |
import json
import os
import subprocess
major, minor, impl = json.loads(subprocess.check_output(["python", "-c", "import json; import sys; import platform; print(json.dumps([sys.version_info[0], sys.version_info[1], platform.python_implementation()]));"], universal_newlines=True))
with open(os.environ['GITHUB_ENV'], 'a') as file_handler:
file_handler.write('TOXENV=' + ("py" if impl == "CPython" else "pypy") + ("{}{}".format(major, minor) if impl == "CPython" else "3") + "\n")
import os; import platform; import sys; from pathlib import Path
env = f'TOXENV=py{"" if platform.python_implementation() == "CPython" else "py"}3{sys.version_info.minor}'
print(f"Picked: {env} for {sys.version} based of {sys.executable}")
with Path(os.environ["GITHUB_ENV"]).open("ta") as file_handler:
file_handler.write(env)
shell: python
- name: Setup test suite
run: tox r -vv --notest
Expand Down
1 change: 1 addition & 0 deletions docs/changelog/2492.feature.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Pass ``PROGRAMDATA``, ``PROGRAMFILES(x86)``, ``PROGRAMFILES`` environments on Windows by default as it is needed for discovering the VS C++ compiler and start testing against 3.11 - by :user:`gaborbernat`.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ classifiers = [
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Topic :: Software Development :: Libraries",
"Topic :: Software Development :: Testing",
"Topic :: Utilities",
Expand Down
3 changes: 3 additions & 0 deletions src/tox/tox_env/python/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,9 @@ def _default_pass_env(self) -> list[str]:
if sys.platform == "win32": # pragma: win32 cover
env.extend(
[
"PROGRAMDATA", # needed for discovering the VS compiler
"PROGRAMFILES(x86)", # needed for discovering the VS compiler
"PROGRAMFILES", # needed for discovering the VS compiler
"SYSTEMDRIVE",
"SYSTEMROOT", # needed for python's crypto module
"COMSPEC", # needed for distutils cygwin compiler
Expand Down
3 changes: 3 additions & 0 deletions tests/session/cmd/test_show_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,9 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
+ (["MSYSTEM", "PATHEXT"] if is_win else [])
+ ["PIP_*"]
+ (["PROCESSOR_ARCHITECTURE"] if is_win else [])
+ (["PROGRAMDATA"] if is_win else [])
+ (["PROGRAMFILES"] if is_win else [])
+ (["PROGRAMFILES(x86)"] if is_win else [])
+ ["REQUESTS_CA_BUNDLE", "SSL_CERT_FILE"]
+ (["SYSTEMDRIVE", "SYSTEMROOT", "TEMP"] if is_win else [])
+ (["TERM"] if stdout_is_atty else [])
Expand Down
7 changes: 7 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[tox]
envlist =
fix
py311
py310
py39
py38
Expand All @@ -9,6 +10,7 @@ envlist =
type
docs
pkg_meta
isolated_build = true
skip_missing_interpreters = true

[testenv]
Expand Down Expand Up @@ -44,6 +46,11 @@ commands =
pre-commit run --all-files --show-diff-on-failure {tty:--color=always} {posargs}
python -c 'print(r"hint: run {envbindir}{/}pre-commit install to add checks as pre-commit hook")'

[testenv:py311]
setenv =
{[testenv]setenv}
AIOHTTP_NO_EXTENSIONS = 1

[testenv:type]
description = run type check on code base
setenv =
Expand Down