summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.github/workflows/check.yml12
-rw-r--r--docs/changelog/2492.feature.rst1
-rw-r--r--pyproject.toml1
-rw-r--r--src/tox/tox_env/python/api.py3
-rw-r--r--tests/session/cmd/test_show_config.py3
-rw-r--r--tox.ini7
6 files changed, 21 insertions, 6 deletions
diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml
index 4bb24b80..11e74e71 100644
--- a/.github/workflows/check.yml
+++ b/.github/workflows/check.yml
@@ -17,6 +17,7 @@ jobs:
fail-fast: false
matrix:
py:
+ - "3.11.0-rc.1"
- "3.10"
- "3.9"
- "3.8"
@@ -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
diff --git a/docs/changelog/2492.feature.rst b/docs/changelog/2492.feature.rst
new file mode 100644
index 00000000..ffa1a478
--- /dev/null
+++ b/docs/changelog/2492.feature.rst
@@ -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`.
diff --git a/pyproject.toml b/pyproject.toml
index 846652b9..d2ef1f1f 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -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",
diff --git a/src/tox/tox_env/python/api.py b/src/tox/tox_env/python/api.py
index 9731d188..2adf9bff 100644
--- a/src/tox/tox_env/python/api.py
+++ b/src/tox/tox_env/python/api.py
@@ -87,6 +87,9 @@ class Python(ToxEnv, ABC):
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
diff --git a/tests/session/cmd/test_show_config.py b/tests/session/cmd/test_show_config.py
index 4becedb5..ae803422 100644
--- a/tests/session/cmd/test_show_config.py
+++ b/tests/session/cmd/test_show_config.py
@@ -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 [])
diff --git a/tox.ini b/tox.ini
index c19acfb3..d14434c9 100644
--- a/tox.ini
+++ b/tox.ini
@@ -1,6 +1,7 @@
[tox]
envlist =
fix
+ py311
py310
py39
py38
@@ -9,6 +10,7 @@ envlist =
type
docs
pkg_meta
+isolated_build = true
skip_missing_interpreters = true
[testenv]
@@ -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 =