From 23315d78b5a82063be132048bad21e52b08f01ad Mon Sep 17 00:00:00 2001 From: Sorin Sbarnea Date: Sat, 17 Dec 2022 09:52:50 +0000 Subject: [PATCH] Move mypy config to pyproject.toml (#88) --- mypy.ini | 11 ----------- pyproject.toml | 12 ++++++++++++ src/subprocess_tee/__init__.py | 6 +----- 3 files changed, 13 insertions(+), 16 deletions(-) delete mode 100644 mypy.ini diff --git a/mypy.ini b/mypy.ini deleted file mode 100644 index 2cf4199..0000000 --- a/mypy.ini +++ /dev/null @@ -1,11 +0,0 @@ -[mypy] -python_version = 3.6 -color_output = True -error_summary = True -disallow_any_generics = True -disallow_any_unimported = True -disallow_untyped_calls = True -disallow_untyped_defs = True -warn_redundant_casts = True -warn_return_any = True -warn_unused_configs = True diff --git a/pyproject.toml b/pyproject.toml index a1b9e17..2e41538 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -61,5 +61,17 @@ test =[ profile = "black" known_first_party = "subprocess_tee" +[tool.mypy] +python_version = 3.8 +color_output = true +error_summary = true +disallow_any_generics = true +disallow_any_unimported = true +disallow_untyped_calls = true +disallow_untyped_defs = true +warn_redundant_casts = true +warn_return_any = true +warn_unused_configs = true + [tool.setuptools_scm] local_scheme = "no-local-version" diff --git a/src/subprocess_tee/__init__.py b/src/subprocess_tee/__init__.py index 97c8f84..c13109e 100644 --- a/src/subprocess_tee/__init__.py +++ b/src/subprocess_tee/__init__.py @@ -6,6 +6,7 @@ import sys from asyncio import StreamReader from importlib.metadata import PackageNotFoundError, version # type: ignore +from shlex import join from typing import TYPE_CHECKING, Any, Callable, Dict, List, Optional, Union try: @@ -20,11 +21,6 @@ else: CompletedProcess = subprocess.CompletedProcess -try: - from shlex import join # type: ignore -except ImportError: - from subprocess import list2cmdline as join # pylint: disable=ungrouped-imports - STREAM_LIMIT = 2**23 # 8MB instead of default 64kb, override it if you need