pythonwrench 0.6.5__tar.gz → 0.6.6__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/CHANGELOG.md +4 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/CITATION.cff +1 -1
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/PKG-INFO +1 -1
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/__init__.py +1 -1
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/logging.py +4 -3
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_typing.py +15 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/.github/workflows/test.yaml +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/.gitignore +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/.pre-commit-config.yaml +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/.readthedocs.yaml +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/LICENSE +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/README.md +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/Makefile +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/conf.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/index.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/make.bat +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/modules.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.abc.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.argparse.dataclass_.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.argparse.parsers.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.argparse.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.cast.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.checksum.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.collections.collections.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.collections.prop.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.collections.reducers.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.collections.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.concurrent.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.csv.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.dataclasses.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.datetime.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.difflib.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.disk_cache.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.enum.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.functools.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.hashlib.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.importlib.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.inspect.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.json.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.jsonl.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.logging.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.math.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.os.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.pickle.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.random.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.re.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.semver.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.serialization.csv.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.serialization.json.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.serialization.jsonl.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.serialization.pickle.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.serialization.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.time.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.typing.checks.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.typing.classes.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.typing.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/pythonwrench.warnings.rst +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/docs/update.bash +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/pyproject.toml +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/setup.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/__main__.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/_core.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/abc.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/argparse/__init__.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/argparse/dataclass_.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/argparse/parsers.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/cast.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/checksum.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/collections/__init__.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/collections/collections.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/collections/prop.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/collections/reducers.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/concurrent.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/csv.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/dataclasses.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/datetime.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/difflib.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/disk_cache.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/entrypoints/info.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/entrypoints/safe_rmdir.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/entrypoints/tree.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/enum.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/functools.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/hashlib.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/importlib.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/inspect.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/json.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/jsonl.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/math.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/os.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/pickle.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/random.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/re.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/semver.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/serialization/__init__.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/serialization/_core.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/serialization/csv.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/serialization/json.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/serialization/jsonl.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/serialization/pickle.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/time.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/typing/__init__.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/typing/checks.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/typing/classes.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/src/pythonwrench/warnings.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_abc.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_argparse.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_cast.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_checksum.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_collections.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_core.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_csv.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_dataclasses.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_difflib.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_disk_cache.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_entrypoints.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_enum.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_functools.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_hashlib.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_importlib.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_inspect.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_json.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_jsonl.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_logging.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_math.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_os.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_random.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_readme.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/tests/test_semver.py +0 -0
- {pythonwrench-0.6.5 → pythonwrench-0.6.6}/uv.lock +0 -0
|
@@ -2,6 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.6.6] 2026-08-20
|
|
6
|
+
### Fixed
|
|
7
|
+
- `setup_logging_level` isinstance check.
|
|
8
|
+
|
|
5
9
|
## [0.6.5] 2026-08-20
|
|
6
10
|
### Added
|
|
7
11
|
- `return_single_namespace` option for `parse_args_using_dataclass` function.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: pythonwrench
|
|
3
|
-
Version: 0.6.
|
|
3
|
+
Version: 0.6.6
|
|
4
4
|
Summary: Python library with tools for typing, manipulating collections, and more!
|
|
5
5
|
Project-URL: Homepage, https://pypi.org/project/pythonwrench/
|
|
6
6
|
Project-URL: Documentation, https://pythonwrench.readthedocs.io/
|
|
@@ -5,10 +5,11 @@ import inspect
|
|
|
5
5
|
import logging
|
|
6
6
|
import sys
|
|
7
7
|
from functools import lru_cache
|
|
8
|
+
from io import TextIOBase
|
|
8
9
|
from logging import FileHandler, Formatter, Logger, StreamHandler
|
|
9
10
|
from pathlib import Path
|
|
10
11
|
from types import ModuleType
|
|
11
|
-
from typing import IO, Iterable, List, Literal, Optional, TypeVar, Union
|
|
12
|
+
from typing import IO, Iterable, List, Literal, Optional, TextIO, TypeVar, Union
|
|
12
13
|
|
|
13
14
|
from typing_extensions import TypeAlias
|
|
14
15
|
|
|
@@ -117,11 +118,11 @@ def setup_logging_level(
|
|
|
117
118
|
for handler in logging.getLogger().handlers
|
|
118
119
|
if isinstance(handler, StreamHandler)
|
|
119
120
|
]
|
|
120
|
-
elif isinstance(stream,
|
|
121
|
+
elif isinstance(stream, (TextIOBase, TextIO)):
|
|
121
122
|
streams = [stream]
|
|
122
123
|
elif stream is None:
|
|
123
124
|
streams = stream
|
|
124
|
-
elif isinstance_generic(stream, Iterable[
|
|
125
|
+
elif isinstance_generic(stream, Iterable[Union[TextIOBase, TextIO]]):
|
|
125
126
|
streams = list(stream)
|
|
126
127
|
else:
|
|
127
128
|
raise TypeError(f"Invalid argument type {type(stream)=}.")
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
#!/usr/bin/env python
|
|
2
2
|
# -*- coding: utf-8 -*-
|
|
3
3
|
|
|
4
|
+
import logging
|
|
4
5
|
import unittest
|
|
5
6
|
from dataclasses import dataclass
|
|
7
|
+
from io import TextIOBase
|
|
8
|
+
from logging import StreamHandler
|
|
6
9
|
from numbers import Number
|
|
7
10
|
from pathlib import Path
|
|
8
11
|
from typing import (
|
|
@@ -331,6 +334,18 @@ class TestIsInstanceGuard(TestCase):
|
|
|
331
334
|
assert isinstance_generic([], List[int], check_only_first=True)
|
|
332
335
|
assert isinstance_generic([1, 2], List, check_only_first=True)
|
|
333
336
|
|
|
337
|
+
def test_io_check(self) -> None:
|
|
338
|
+
assert isinstance_generic([], Iterable[TextIOBase])
|
|
339
|
+
assert not isinstance_generic([1], Iterable[TextIOBase])
|
|
340
|
+
|
|
341
|
+
logger = logging.getLogger()
|
|
342
|
+
streams = [
|
|
343
|
+
handler.stream
|
|
344
|
+
for handler in logger.handlers
|
|
345
|
+
if isinstance(handler, StreamHandler)
|
|
346
|
+
]
|
|
347
|
+
assert isinstance_generic(streams, Iterable[TextIOBase])
|
|
348
|
+
|
|
334
349
|
|
|
335
350
|
class TestCheckArgsType(TestCase):
|
|
336
351
|
def test_example_1(self) -> None:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|