Skip to content

Commit 6b1cc14

Browse files
authored
Drop python 3.6 support (#2275)
1 parent 84acf04 commit 6b1cc14

File tree

180 files changed

+1017
-768
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

180 files changed

+1017
-768
lines changed

.github/workflows/check.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ jobs:
2828
- "3.9.9"
2929
- "3.8"
3030
- "3.7"
31-
- "3.6"
3231
os:
3332
- Ubuntu
3433
- Windows

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ repos:
2020
rev: v2.29.1
2121
hooks:
2222
- id: pyupgrade
23-
args: ["--py36-plus"]
23+
args: ["--py37-plus"]
2424
exclude: "^(tests/demo_pkg_inline/build.py)$"
2525
- id: pyupgrade
2626
files: "^(tests/demo_pkg_inline/build.py)$"

docs/changelog/2275.feature.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Drop python 3.6 support - by :user:`gaborbernat`.

setup.cfg

Lines changed: 4 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ classifiers =
2121
Operating System :: POSIX
2222
Programming Language :: Python :: 3
2323
Programming Language :: Python :: 3 :: Only
24-
Programming Language :: Python :: 3.6
2524
Programming Language :: Python :: 3.7
2625
Programming Language :: Python :: 3.8
2726
Programming Language :: Python :: 3.9
@@ -48,7 +47,7 @@ install_requires =
4847
virtualenv>=20.6
4948
importlib-metadata>=4.6.1;python_version<"3.8"
5049
typing-extensions>=3.10;python_version<"3.8"
51-
python_requires = >=3.6
50+
python_requires = >=3.7
5251
package_dir =
5352
=src
5453

@@ -122,23 +121,9 @@ skip_covered = false
122121
subtract_omit = */.tox/*
123122

124123
[mypy]
125-
python_version = 3.6
126-
disallow_any_generics = True
127-
disallow_subclassing_any = True
128-
disallow_untyped_calls = True
129-
disallow_untyped_defs = True
130-
disallow_incomplete_defs = True
131-
disallow_untyped_decorators = True
132-
show_error_codes = True
133-
no_implicit_optional = True
134-
warn_redundant_casts = True
135-
warn_unused_ignores = False
136-
warn_no_return = True
137-
warn_return_any = True
138-
implicit_reexport = False
139-
strict_equality = True
140-
warn_unused_configs = True
141-
pretty = True
124+
python_version = 3.7
125+
strict = true
126+
show_error_codes = true
142127

143128
[mypy-colorama.*]
144129
ignore_missing_imports = True

setup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from setuptools import setup
24

35
setup()

src/tox/__init__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from .run import main
24
from .version import version as __version__
35

src/tox/__main__.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
from __future__ import annotations
2+
13
from tox.run import run
24

35
if __name__ == "__main__":

src/tox/config/cli/env_var.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,18 @@
11
"""
22
Provides configuration values from the environment variables.
33
"""
4+
from __future__ import annotations
5+
46
import logging
57
import os
6-
from typing import Any, Optional, Tuple, Type
8+
from typing import Any
79

810
from tox.config.loader.str_convert import StrConvert
911

1012
CONVERT = StrConvert()
1113

1214

13-
def get_env_var(key: str, of_type: Type[Any]) -> Optional[Tuple[Any, str]]:
15+
def get_env_var(key: str, of_type: type[Any]) -> tuple[Any, str] | None:
1416
"""Get the environment variable option.
1517
1618
:param key: the config key requested

src/tox/config/cli/ini.py

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
"""
22
Provides configuration values from tox.ini files.
33
"""
4+
from __future__ import annotations
5+
46
import logging
57
import os
68
from configparser import ConfigParser
79
from pathlib import Path
8-
from typing import Any, Dict, Optional, Tuple, Type
10+
from typing import Any
911

1012
from platformdirs import user_config_dir
1113

@@ -24,9 +26,9 @@ def __init__(self) -> None:
2426
config_file = os.environ.get(self.TOX_CONFIG_FILE_ENV_VAR, None)
2527
self.is_env_var = config_file is not None
2628
self.config_file = Path(config_file if config_file is not None else DEFAULT_CONFIG_FILE)
27-
self._cache: Dict[Tuple[str, Type[Any]], Any] = {}
28-
self.has_config_file: Optional[bool] = self.config_file.exists()
29-
self.ini: Optional[IniLoader] = None
29+
self._cache: dict[tuple[str, type[Any]], Any] = {}
30+
self.has_config_file: bool | None = self.config_file.exists()
31+
self.ini: IniLoader | None = None
3032

3133
if self.has_config_file:
3234
self.config_file = self.config_file.absolute()
@@ -42,7 +44,7 @@ def __init__(self) -> None:
4244
logging.error("failed to read config file %s because %r", config_file, exception)
4345
self.has_config_file = None
4446

45-
def get(self, key: str, of_type: Type[Any]) -> Any:
47+
def get(self, key: str, of_type: type[Any]) -> Any:
4648
cache_key = key, of_type
4749
if cache_key in self._cache:
4850
result = self._cache[cache_key]

src/tox/config/cli/parse.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
"""
22
This module pulls together this package: create and parse CLI arguments for tox.
33
"""
4+
from __future__ import annotations
45

5-
from typing import Dict, Optional, Sequence, Tuple, cast
6+
from typing import Dict, Sequence, cast
67

78
from tox.config.source import Source, discover_source
89
from tox.report import ToxHandler, setup_report
@@ -12,8 +13,8 @@
1213
Handlers = Dict[str, Handler]
1314

1415

15-
def get_options(*args: str) -> Tuple[Parsed, Handlers, Optional[Sequence[str]], ToxHandler, Source]:
16-
pos_args: Optional[Tuple[str, ...]] = None
16+
def get_options(*args: str) -> tuple[Parsed, Handlers, Sequence[str] | None, ToxHandler, Source]:
17+
pos_args: tuple[str, ...] | None = None
1718
try: # remove positional arguments passed to parser if specified, they are pulled directly from sys.argv
1819
pos_arg_at = args.index("--")
1920
except ValueError:
@@ -29,7 +30,7 @@ def get_options(*args: str) -> Tuple[Parsed, Handlers, Optional[Sequence[str]],
2930
return parsed, cmd_handlers, pos_args, log_handler, source
3031

3132

32-
def _get_base(args: Sequence[str]) -> Tuple[int, ToxHandler, Source]:
33+
def _get_base(args: Sequence[str]) -> tuple[int, ToxHandler, Source]:
3334
"""First just load the base options (verbosity+color) to setup the logging framework."""
3435
tox_parser = ToxParser.base()
3536
parsed, _ = tox_parser.parse_known_args(args)
@@ -44,7 +45,7 @@ def _get_base(args: Sequence[str]) -> Tuple[int, ToxHandler, Source]:
4445
return guess_verbosity, handler, source
4546

4647

47-
def _get_all(args: Sequence[str]) -> Tuple[Parsed, Handlers]:
48+
def _get_all(args: Sequence[str]) -> tuple[Parsed, Handlers]:
4849
"""Parse all the options."""
4950
tox_parser = _get_parser()
5051
parsed = cast(Parsed, tox_parser.parse_args(args))

0 commit comments

Comments
 (0)