Skip to content

Commit fe9c0a0

Browse files
committed
Intermediate changes
commit_hash:b696835a393f656c678f0f5c80f2196b031046e9
1 parent bce30d9 commit fe9c0a0

File tree

6 files changed

+72
-53
lines changed

6 files changed

+72
-53
lines changed

contrib/python/jaraco.functools/py3/.dist-info/METADATA

Lines changed: 23 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,38 @@
1-
Metadata-Version: 2.1
1+
Metadata-Version: 2.4
22
Name: jaraco.functools
3-
Version: 4.1.0
3+
Version: 4.2.1
44
Summary: Functools like those found in stdlib
55
Author-email: "Jason R. Coombs" <jaraco@jaraco.com>
6+
License-Expression: MIT
67
Project-URL: Source, https://github.com/jaraco/jaraco.functools
78
Classifier: Development Status :: 5 - Production/Stable
89
Classifier: Intended Audience :: Developers
9-
Classifier: License :: OSI Approved :: MIT License
1010
Classifier: Programming Language :: Python :: 3
1111
Classifier: Programming Language :: Python :: 3 :: Only
12-
Requires-Python: >=3.8
12+
Requires-Python: >=3.9
1313
Description-Content-Type: text/x-rst
1414
License-File: LICENSE
15-
Requires-Dist: more-itertools
15+
Requires-Dist: more_itertools
16+
Provides-Extra: test
17+
Requires-Dist: pytest!=8.1.*,>=6; extra == "test"
18+
Requires-Dist: jaraco.classes; extra == "test"
19+
Provides-Extra: doc
20+
Requires-Dist: sphinx>=3.5; extra == "doc"
21+
Requires-Dist: jaraco.packaging>=9.3; extra == "doc"
22+
Requires-Dist: rst.linker>=1.9; extra == "doc"
23+
Requires-Dist: furo; extra == "doc"
24+
Requires-Dist: sphinx-lint; extra == "doc"
25+
Requires-Dist: jaraco.tidelift>=1.4; extra == "doc"
1626
Provides-Extra: check
17-
Requires-Dist: pytest-checkdocs >=2.4 ; extra == 'check'
18-
Requires-Dist: pytest-ruff >=0.2.1 ; (sys_platform != "cygwin") and extra == 'check'
27+
Requires-Dist: pytest-checkdocs>=2.4; extra == "check"
28+
Requires-Dist: pytest-ruff>=0.2.1; sys_platform != "cygwin" and extra == "check"
1929
Provides-Extra: cover
20-
Requires-Dist: pytest-cov ; extra == 'cover'
21-
Provides-Extra: doc
22-
Requires-Dist: sphinx >=3.5 ; extra == 'doc'
23-
Requires-Dist: jaraco.packaging >=9.3 ; extra == 'doc'
24-
Requires-Dist: rst.linker >=1.9 ; extra == 'doc'
25-
Requires-Dist: furo ; extra == 'doc'
26-
Requires-Dist: sphinx-lint ; extra == 'doc'
27-
Requires-Dist: jaraco.tidelift >=1.4 ; extra == 'doc'
30+
Requires-Dist: pytest-cov; extra == "cover"
2831
Provides-Extra: enabler
29-
Requires-Dist: pytest-enabler >=2.2 ; extra == 'enabler'
30-
Provides-Extra: test
31-
Requires-Dist: pytest !=8.1.*,>=6 ; extra == 'test'
32-
Requires-Dist: jaraco.classes ; extra == 'test'
32+
Requires-Dist: pytest-enabler>=2.2; extra == "enabler"
3333
Provides-Extra: type
34-
Requires-Dist: pytest-mypy ; extra == 'type'
34+
Requires-Dist: pytest-mypy; extra == "type"
35+
Dynamic: license-file
3536

3637
.. image:: https://img.shields.io/pypi/v/jaraco.functools.svg
3738
:target: https://pypi.org/project/jaraco.functools
@@ -42,14 +43,14 @@ Requires-Dist: pytest-mypy ; extra == 'type'
4243
:target: https://github.com/jaraco/jaraco.functools/actions?query=workflow%3A%22tests%22
4344
:alt: tests
4445

45-
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
46+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
4647
:target: https://github.com/astral-sh/ruff
4748
:alt: Ruff
4849

4950
.. image:: https://readthedocs.org/projects/jaracofunctools/badge/?version=latest
5051
:target: https://jaracofunctools.readthedocs.io/en/latest/?badge=latest
5152

52-
.. image:: https://img.shields.io/badge/skeleton-2024-informational
53+
.. image:: https://img.shields.io/badge/skeleton-2025-informational
5354
:target: https://blog.jaraco.com/skeleton
5455

5556
.. image:: https://tidelift.com/badges/package/pypi/jaraco.functools
Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
Permission is hereby granted, free of charge, to any person obtaining a copy
2-
of this software and associated documentation files (the "Software"), to
3-
deal in the Software without restriction, including without limitation the
4-
rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
5-
sell copies of the Software, and to permit persons to whom the Software is
6-
furnished to do so, subject to the following conditions:
1+
MIT License
72

8-
The above copyright notice and this permission notice shall be included in
9-
all copies or substantial portions of the Software.
3+
Copyright (c) 2025 <copyright holders>
104

11-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
16-
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
17-
IN THE SOFTWARE.
5+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
6+
associated documentation files (the "Software"), to deal in the Software without restriction, including
7+
without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8+
copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the
9+
following conditions:
10+
11+
The above copyright notice and this permission notice shall be included in all copies or substantial
12+
portions of the Software.
13+
14+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
15+
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO
16+
EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
18+
USE OR OTHER DEALINGS IN THE SOFTWARE.

contrib/python/jaraco.functools/py3/README.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@
77
:target: https://github.com/jaraco/jaraco.functools/actions?query=workflow%3A%22tests%22
88
:alt: tests
99

10-
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/charliermarsh/ruff/main/assets/badge/v2.json
10+
.. image:: https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json
1111
:target: https://github.com/astral-sh/ruff
1212
:alt: Ruff
1313

1414
.. image:: https://readthedocs.org/projects/jaracofunctools/badge/?version=latest
1515
:target: https://jaracofunctools.readthedocs.io/en/latest/?badge=latest
1616

17-
.. image:: https://img.shields.io/badge/skeleton-2024-informational
17+
.. image:: https://img.shields.io/badge/skeleton-2025-informational
1818
:target: https://blog.jaraco.com/skeleton
1919

2020
.. image:: https://tidelift.com/badges/package/pypi/jaraco.functools

contrib/python/jaraco.functools/py3/jaraco/functools/__init__.py

Lines changed: 21 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import time
99
import types
1010
import warnings
11-
1211
from typing import Callable, TypeVar
1312

1413
import more_itertools
@@ -291,6 +290,26 @@ def invoke(f, /, *args, **kwargs):
291290
return f
292291

293292

293+
_T = TypeVar('_T')
294+
295+
296+
def passthrough(func: Callable[..., object]) -> Callable[[_T], _T]:
297+
"""
298+
Wrap the function to always return the first parameter.
299+
300+
>>> passthrough(print)('3')
301+
3
302+
'3'
303+
"""
304+
305+
@functools.wraps(func)
306+
def wrapper(first: _T, *args, **kwargs) -> _T:
307+
func(first, *args, **kwargs)
308+
return first
309+
310+
return wrapper
311+
312+
294313
class Throttler:
295314
"""Rate-limit a function (or other callable)."""
296315

@@ -488,7 +507,7 @@ def save_method_args(method):
488507
>>> my_ob._saved_method.args
489508
()
490509
"""
491-
args_and_kwargs = collections.namedtuple('args_and_kwargs', 'args kwargs')
510+
args_and_kwargs = collections.namedtuple('args_and_kwargs', 'args kwargs') # noqa: PYI024 # Internal; stubs used for typing
492511

493512
@functools.wraps(method)
494513
def wrapper(self, /, *args, **kwargs):

contrib/python/jaraco.functools/py3/jaraco/functools/__init__.pyi

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
from collections.abc import Callable, Hashable, Iterator
22
from functools import partial
33
from operator import methodcaller
4-
import sys
54
from typing import (
65
Any,
76
Generic,
@@ -10,14 +9,12 @@ from typing import (
109
overload,
1110
)
1211

13-
if sys.version_info >= (3, 10):
14-
from typing import Concatenate, ParamSpec
15-
else:
16-
from typing_extensions import Concatenate, ParamSpec
12+
from typing_extensions import Concatenate, ParamSpec, TypeVarTuple, Unpack
1713

1814
_P = ParamSpec('_P')
1915
_R = TypeVar('_R')
2016
_T = TypeVar('_T')
17+
_Ts = TypeVarTuple('_Ts')
2118
_R1 = TypeVar('_R1')
2219
_R2 = TypeVar('_R2')
2320
_V = TypeVar('_V')
@@ -66,10 +63,10 @@ def method_cache(
6663
cache_wrapper: Callable[[Callable[..., _R]], _MethodCacheWrapper[_R]] = ...,
6764
) -> _MethodCacheWrapper[_R] | _ProxyMethodCacheWrapper[_R]: ...
6865
def apply(
69-
transform: Callable[[_R], _T]
66+
transform: Callable[[_R], _T],
7067
) -> Callable[[Callable[_P, _R]], Callable[_P, _T]]: ...
7168
def result_invoke(
72-
action: Callable[[_R], Any]
69+
action: Callable[[_R], Any],
7370
) -> Callable[[Callable[_P, _R]], Callable[_P, _R]]: ...
7471
def invoke(
7572
f: Callable[_P, _R], /, *args: _P.args, **kwargs: _P.kwargs
@@ -95,23 +92,23 @@ method_caller: Callable[..., methodcaller]
9592
def retry_call(
9693
func: Callable[..., _R],
9794
cleanup: Callable[..., None] = ...,
98-
retries: int | float = ...,
95+
retries: float = ...,
9996
trap: type[BaseException] | tuple[type[BaseException], ...] = ...,
10097
) -> _R: ...
10198
def retry(
10299
cleanup: Callable[..., None] = ...,
103-
retries: int | float = ...,
100+
retries: float = ...,
104101
trap: type[BaseException] | tuple[type[BaseException], ...] = ...,
105102
) -> Callable[[Callable[..., _R]], Callable[..., _R]]: ...
106103
def print_yielded(func: Callable[_P, Iterator[Any]]) -> Callable[_P, None]: ...
107104
def pass_none(
108-
func: Callable[Concatenate[_T, _P], _R]
105+
func: Callable[Concatenate[_T, _P], _R],
109106
) -> Callable[Concatenate[_T, _P], _R]: ...
110107
def assign_params(
111108
func: Callable[..., _R], namespace: dict[str, Any]
112109
) -> partial[_R]: ...
113110
def save_method_args(
114-
method: Callable[Concatenate[_S, _P], _R]
111+
method: Callable[Concatenate[_S, _P], _R],
115112
) -> Callable[Concatenate[_S, _P], _R]: ...
116113
def except_(
117114
*exceptions: type[BaseException], replace: Any = ..., use: Any = ...
@@ -123,3 +120,4 @@ def bypass_when(
123120
def bypass_unless(
124121
check: Any,
125122
) -> Callable[[Callable[[_T], _R]], Callable[[_T], _T | _R]]: ...
123+
def splat(func: Callable[[Unpack[_Ts]], _R]) -> Callable[[tuple[Unpack[_Ts]]], _R]: ...

contrib/python/jaraco.functools/py3/ya.make

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
PY3_LIBRARY()
44

5-
VERSION(4.1.0)
5+
VERSION(4.2.1)
66

77
LICENSE(MIT)
88

0 commit comments

Comments
 (0)