summaryrefslogtreecommitdiffstats
path: root/contrib/python
diff options
context:
space:
mode:
authorrobot-piglet <[email protected]>2025-07-06 19:45:45 +0300
committerrobot-piglet <[email protected]>2025-07-06 19:57:20 +0300
commitfe9c0a0dcc51bfa397fdf0c767305e60b51afff9 (patch)
tree343ac7de53a943ed15a38c47199e1f7e1bbcc2ac /contrib/python
parentbce30d95e1d6b1a48c2286ea60ae1e7e339268c9 (diff)
Intermediate changes
commit_hash:b696835a393f656c678f0f5c80f2196b031046e9
Diffstat (limited to 'contrib/python')
-rw-r--r--contrib/python/jaraco.functools/py3/.dist-info/METADATA45
-rw-r--r--contrib/python/jaraco.functools/py3/LICENSE31
-rw-r--r--contrib/python/jaraco.functools/py3/README.rst4
-rw-r--r--contrib/python/jaraco.functools/py3/jaraco/functools/__init__.py23
-rw-r--r--contrib/python/jaraco.functools/py3/jaraco/functools/__init__.pyi20
-rw-r--r--contrib/python/jaraco.functools/py3/ya.make2
6 files changed, 72 insertions, 53 deletions
diff --git a/contrib/python/jaraco.functools/py3/.dist-info/METADATA b/contrib/python/jaraco.functools/py3/.dist-info/METADATA
index e0a75d48073..01a82d660f1 100644
--- a/contrib/python/jaraco.functools/py3/.dist-info/METADATA
+++ b/contrib/python/jaraco.functools/py3/.dist-info/METADATA
@@ -1,37 +1,38 @@
-Metadata-Version: 2.1
+Metadata-Version: 2.4
Name: jaraco.functools
-Version: 4.1.0
+Version: 4.2.1
Summary: Functools like those found in stdlib
Author-email: "Jason R. Coombs" <[email protected]>
+License-Expression: MIT
Project-URL: Source, https://github.com/jaraco/jaraco.functools
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
-Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
-Requires-Python: >=3.8
+Requires-Python: >=3.9
Description-Content-Type: text/x-rst
License-File: LICENSE
-Requires-Dist: more-itertools
+Requires-Dist: more_itertools
+Provides-Extra: test
+Requires-Dist: pytest!=8.1.*,>=6; extra == "test"
+Requires-Dist: jaraco.classes; extra == "test"
+Provides-Extra: doc
+Requires-Dist: sphinx>=3.5; extra == "doc"
+Requires-Dist: jaraco.packaging>=9.3; extra == "doc"
+Requires-Dist: rst.linker>=1.9; extra == "doc"
+Requires-Dist: furo; extra == "doc"
+Requires-Dist: sphinx-lint; extra == "doc"
+Requires-Dist: jaraco.tidelift>=1.4; extra == "doc"
Provides-Extra: check
-Requires-Dist: pytest-checkdocs >=2.4 ; extra == 'check'
-Requires-Dist: pytest-ruff >=0.2.1 ; (sys_platform != "cygwin") and extra == 'check'
+Requires-Dist: pytest-checkdocs>=2.4; extra == "check"
+Requires-Dist: pytest-ruff>=0.2.1; sys_platform != "cygwin" and extra == "check"
Provides-Extra: cover
-Requires-Dist: pytest-cov ; extra == 'cover'
-Provides-Extra: doc
-Requires-Dist: sphinx >=3.5 ; extra == 'doc'
-Requires-Dist: jaraco.packaging >=9.3 ; extra == 'doc'
-Requires-Dist: rst.linker >=1.9 ; extra == 'doc'
-Requires-Dist: furo ; extra == 'doc'
-Requires-Dist: sphinx-lint ; extra == 'doc'
-Requires-Dist: jaraco.tidelift >=1.4 ; extra == 'doc'
+Requires-Dist: pytest-cov; extra == "cover"
Provides-Extra: enabler
-Requires-Dist: pytest-enabler >=2.2 ; extra == 'enabler'
-Provides-Extra: test
-Requires-Dist: pytest !=8.1.*,>=6 ; extra == 'test'
-Requires-Dist: jaraco.classes ; extra == 'test'
+Requires-Dist: pytest-enabler>=2.2; extra == "enabler"
Provides-Extra: type
-Requires-Dist: pytest-mypy ; extra == 'type'
+Requires-Dist: pytest-mypy; extra == "type"
+Dynamic: license-file
.. image:: https://img.shields.io/pypi/v/jaraco.functools.svg
:target: https://pypi.org/project/jaraco.functools
@@ -42,14 +43,14 @@ Requires-Dist: pytest-mypy ; extra == 'type'
:target: https://github.com/jaraco/jaraco.functools/actions?query=workflow%3A%22tests%22
:alt: tests
-.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
+.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
:target: https://github.com/astral-sh/ruff
:alt: Ruff
.. image:: https://readthedocs.org/projects/jaracofunctools/badge/?version=latest
:target: https://jaracofunctools.readthedocs.io/en/latest/?badge=latest
-.. image:: https://img.shields.io/badge/skeleton-2024-informational
+.. image:: https://img.shields.io/badge/skeleton-2025-informational
:target: https://blog.jaraco.com/skeleton
.. image:: https://tidelift.com/badges/package/pypi/jaraco.functools
diff --git a/contrib/python/jaraco.functools/py3/LICENSE b/contrib/python/jaraco.functools/py3/LICENSE
index 1bb5a44356f..f60bd572013 100644
--- a/contrib/python/jaraco.functools/py3/LICENSE
+++ b/contrib/python/jaraco.functools/py3/LICENSE
@@ -1,17 +1,18 @@
-Permission is hereby granted, free of charge, to any person obtaining a copy
-of this software and associated documentation files (the "Software"), to
-deal in the Software without restriction, including without limitation the
-rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
-sell copies of the Software, and to permit persons to whom the Software is
-furnished to do so, subject to the following conditions:
+MIT License
-The above copyright notice and this permission notice shall be included in
-all copies or substantial portions of the Software.
+Copyright (c) 2025 <copyright holders>
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
-FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
-IN THE SOFTWARE.
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
+associated documentation files (the "Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
+following conditions:
+
+The above copyright notice and this permission notice shall be included in all copies or substantial
+portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
+LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
+EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
+USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/contrib/python/jaraco.functools/py3/README.rst b/contrib/python/jaraco.functools/py3/README.rst
index a7f48543a10..4986c6f9c7a 100644
--- a/contrib/python/jaraco.functools/py3/README.rst
+++ b/contrib/python/jaraco.functools/py3/README.rst
@@ -7,14 +7,14 @@
:target: https://github.com/jaraco/jaraco.functools/actions?query=workflow%3A%22tests%22
:alt: tests
-.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
+.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
:target: https://github.com/astral-sh/ruff
:alt: Ruff
.. image:: https://readthedocs.org/projects/jaracofunctools/badge/?version=latest
:target: https://jaracofunctools.readthedocs.io/en/latest/?badge=latest
-.. image:: https://img.shields.io/badge/skeleton-2024-informational
+.. image:: https://img.shields.io/badge/skeleton-2025-informational
:target: https://blog.jaraco.com/skeleton
.. image:: https://tidelift.com/badges/package/pypi/jaraco.functools
diff --git a/contrib/python/jaraco.functools/py3/jaraco/functools/__init__.py b/contrib/python/jaraco.functools/py3/jaraco/functools/__init__.py
index d510530789b..e12474dcd6d 100644
--- a/contrib/python/jaraco.functools/py3/jaraco/functools/__init__.py
+++ b/contrib/python/jaraco.functools/py3/jaraco/functools/__init__.py
@@ -8,7 +8,6 @@ import operator
import time
import types
import warnings
-
from typing import Callable, TypeVar
import more_itertools
@@ -291,6 +290,26 @@ def invoke(f, /, *args, **kwargs):
return f
+_T = TypeVar('_T')
+
+
+def passthrough(func: Callable[..., object]) -> Callable[[_T], _T]:
+ """
+ Wrap the function to always return the first parameter.
+
+ >>> passthrough(print)('3')
+ 3
+ '3'
+ """
+
+ @functools.wraps(func)
+ def wrapper(first: _T, *args, **kwargs) -> _T:
+ func(first, *args, **kwargs)
+ return first
+
+ return wrapper
+
+
class Throttler:
"""Rate-limit a function (or other callable)."""
@@ -488,7 +507,7 @@ def save_method_args(method):
>>> my_ob._saved_method.args
()
"""
- args_and_kwargs = collections.namedtuple('args_and_kwargs', 'args kwargs')
+ args_and_kwargs = collections.namedtuple('args_and_kwargs', 'args kwargs') # noqa: PYI024 # Internal; stubs used for typing
@functools.wraps(method)
def wrapper(self, /, *args, **kwargs):
diff --git a/contrib/python/jaraco.functools/py3/jaraco/functools/__init__.pyi b/contrib/python/jaraco.functools/py3/jaraco/functools/__init__.pyi
index 19191bf93ee..6f834bf06d9 100644
--- a/contrib/python/jaraco.functools/py3/jaraco/functools/__init__.pyi
+++ b/contrib/python/jaraco.functools/py3/jaraco/functools/__init__.pyi
@@ -1,7 +1,6 @@
from collections.abc import Callable, Hashable, Iterator
from functools import partial
from operator import methodcaller
-import sys
from typing import (
Any,
Generic,
@@ -10,14 +9,12 @@ from typing import (
overload,
)
-if sys.version_info >= (3, 10):
- from typing import Concatenate, ParamSpec
-else:
- from typing_extensions import Concatenate, ParamSpec
+from typing_extensions import Concatenate, ParamSpec, TypeVarTuple, Unpack
_P = ParamSpec('_P')
_R = TypeVar('_R')
_T = TypeVar('_T')
+_Ts = TypeVarTuple('_Ts')
_R1 = TypeVar('_R1')
_R2 = TypeVar('_R2')
_V = TypeVar('_V')
@@ -66,10 +63,10 @@ def method_cache(
cache_wrapper: Callable[[Callable[..., _R]], _MethodCacheWrapper[_R]] = ...,
) -> _MethodCacheWrapper[_R] | _ProxyMethodCacheWrapper[_R]: ...
def apply(
- transform: Callable[[_R], _T]
+ transform: Callable[[_R], _T],
) -> Callable[[Callable[_P, _R]], Callable[_P, _T]]: ...
def result_invoke(
- action: Callable[[_R], Any]
+ action: Callable[[_R], Any],
) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
def invoke(
f: Callable[_P, _R], /, *args: _P.args, **kwargs: _P.kwargs
@@ -95,23 +92,23 @@ method_caller: Callable[..., methodcaller]
def retry_call(
func: Callable[..., _R],
cleanup: Callable[..., None] = ...,
- retries: int | float = ...,
+ retries: float = ...,
trap: type[BaseException] | tuple[type[BaseException], ...] = ...,
) -> _R: ...
def retry(
cleanup: Callable[..., None] = ...,
- retries: int | float = ...,
+ retries: float = ...,
trap: type[BaseException] | tuple[type[BaseException], ...] = ...,
) -> Callable[[Callable[..., _R]], Callable[..., _R]]: ...
def print_yielded(func: Callable[_P, Iterator[Any]]) -> Callable[_P, None]: ...
def pass_none(
- func: Callable[Concatenate[_T, _P], _R]
+ func: Callable[Concatenate[_T, _P], _R],
) -> Callable[Concatenate[_T, _P], _R]: ...
def assign_params(
func: Callable[..., _R], namespace: dict[str, Any]
) -> partial[_R]: ...
def save_method_args(
- method: Callable[Concatenate[_S, _P], _R]
+ method: Callable[Concatenate[_S, _P], _R],
) -> Callable[Concatenate[_S, _P], _R]: ...
def except_(
*exceptions: type[BaseException], replace: Any = ..., use: Any = ...
@@ -123,3 +120,4 @@ def bypass_when(
def bypass_unless(
check: Any,
) -> Callable[[Callable[[_T], _R]], Callable[[_T], _T | _R]]: ...
+def splat(func: Callable[[Unpack[_Ts]], _R]) -> Callable[[tuple[Unpack[_Ts]]], _R]: ...
diff --git a/contrib/python/jaraco.functools/py3/ya.make b/contrib/python/jaraco.functools/py3/ya.make
index 36e37b14d58..0105ad7c272 100644
--- a/contrib/python/jaraco.functools/py3/ya.make
+++ b/contrib/python/jaraco.functools/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(4.1.0)
+VERSION(4.2.1)
LICENSE(MIT)