Skip to content

Commit 252299c

Browse files
committed
Check 3.11 support (#2492)
1 parent ec337a4 commit 252299c

File tree

6 files changed

+21
-6
lines changed

6 files changed

+21
-6
lines changed

.github/workflows/check.yml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ jobs:
1717
fail-fast: false
1818
matrix:
1919
py:
20+
- "3.11.0-rc.1"
2021
- "3.10"
2122
- "3.9"
2223
- "3.8"
@@ -45,12 +46,11 @@ jobs:
4546
python-version: ${{ matrix.py }}
4647
- name: Pick environment to run
4748
run: |
48-
import json
49-
import os
50-
import subprocess
51-
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))
52-
with open(os.environ['GITHUB_ENV'], 'a') as file_handler:
53-
file_handler.write('TOXENV=' + ("py" if impl == "CPython" else "pypy") + ("{}{}".format(major, minor) if impl == "CPython" else "3") + "\n")
49+
import os; import platform; import sys; from pathlib import Path
50+
env = f'TOXENV=py{"" if platform.python_implementation() == "CPython" else "py"}3{sys.version_info.minor}'
51+
print(f"Picked: {env} for {sys.version} based of {sys.executable}")
52+
with Path(os.environ["GITHUB_ENV"]).open("ta") as file_handler:
53+
file_handler.write(env)
5454
shell: python
5555
- name: Setup test suite
5656
run: tox r -vv --notest

docs/changelog/2492.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
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`.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ classifiers = [
7676
"Programming Language :: Python :: 3.8",
7777
"Programming Language :: Python :: 3.9",
7878
"Programming Language :: Python :: 3.10",
79+
"Programming Language :: Python :: 3.11",
7980
"Topic :: Software Development :: Libraries",
8081
"Topic :: Software Development :: Testing",
8182
"Topic :: Utilities",

src/tox/tox_env/python/api.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,9 @@ def _default_pass_env(self) -> list[str]:
8787
if sys.platform == "win32": # pragma: win32 cover
8888
env.extend(
8989
[
90+
"PROGRAMDATA", # needed for discovering the VS compiler
91+
"PROGRAMFILES(x86)", # needed for discovering the VS compiler
92+
"PROGRAMFILES", # needed for discovering the VS compiler
9093
"SYSTEMDRIVE",
9194
"SYSTEMROOT", # needed for python's crypto module
9295
"COMSPEC", # needed for distutils cygwin compiler

tests/session/cmd/test_show_config.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,9 @@ def test_pass_env_config_default(tox_project: ToxProjectCreator, stdout_is_atty:
103103
+ (["MSYSTEM", "PATHEXT"] if is_win else [])
104104
+ ["PIP_*"]
105105
+ (["PROCESSOR_ARCHITECTURE"] if is_win else [])
106+
+ (["PROGRAMDATA"] if is_win else [])
107+
+ (["PROGRAMFILES"] if is_win else [])
108+
+ (["PROGRAMFILES(x86)"] if is_win else [])
106109
+ ["REQUESTS_CA_BUNDLE", "SSL_CERT_FILE"]
107110
+ (["SYSTEMDRIVE", "SYSTEMROOT", "TEMP"] if is_win else [])
108111
+ (["TERM"] if stdout_is_atty else [])

tox.ini

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[tox]
22
envlist =
33
fix
4+
py311
45
py310
56
py39
67
py38
@@ -9,6 +10,7 @@ envlist =
910
type
1011
docs
1112
pkg_meta
13+
isolated_build = true
1214
skip_missing_interpreters = true
1315

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

49+
[testenv:py311]
50+
setenv =
51+
{[testenv]setenv}
52+
AIOHTTP_NO_EXTENSIONS = 1
53+
4754
[testenv:type]
4855
description = run type check on code base
4956
setenv =

0 commit comments

Comments
 (0)