Skip to content

Commit cad03c9

Browse files
committed
fix: changelog and update test list
Signed-off-by: Henry Schreiner <[email protected]>
1 parent 4da7fcd commit cad03c9

File tree

3 files changed

+6
-2
lines changed

3 files changed

+6
-2
lines changed

docs/changelog/3446.feature.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Add a ``schema`` command to produce a JSON Schema for tox and the current plugins.
2+
3+
- by :user:`henryiii`

src/tox/session/cmd/schema.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import sys
77
import typing
88
from pathlib import Path
9-
from types import NoneType
109
from typing import TYPE_CHECKING
1110

1211
import packaging.requirements
@@ -39,7 +38,7 @@ def _process_type(of_type: typing.Any) -> dict[str, typing.Any]: # noqa: C901,
3938
}:
4039
return {"type": "string"}
4140
if typing.get_origin(of_type) is typing.Union:
42-
types = [x for x in typing.get_args(of_type) if x is not NoneType]
41+
types = [x for x in typing.get_args(of_type) if x is not type(None)]
4342
if len(types) == 1:
4443
return _process_type(types[0])
4544
msg = f"Union types are not supported: {of_type}"

tests/config/cli/conftest.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
from tox.session.cmd.run.parallel import run_parallel
1414
from tox.session.cmd.run.sequential import run_sequential
1515
from tox.session.cmd.show_config import show_config
16+
from tox.session.cmd.schema import gen_schema
1617

1718
if TYPE_CHECKING:
1819
from tox.session.state import State
@@ -23,6 +24,7 @@ def core_handlers() -> dict[str, Callable[[State], int]]:
2324
return {
2425
"config": show_config,
2526
"c": show_config,
27+
"schema": gen_schema,
2628
"list": list_env,
2729
"l": list_env,
2830
"run": run_sequential,

0 commit comments

Comments
 (0)