dycw-utilities 0.125.3__py3-none-any.whl → 0.125.5__py3-none-any.whl

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.
@@ -1,16 +1,16 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dycw-utilities
3
- Version: 0.125.3
3
+ Version: 0.125.5
4
4
  Author-email: Derek Wan <d.wan@icloud.com>
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.12
7
7
  Requires-Dist: typing-extensions<4.14,>=4.13.1
8
8
  Provides-Extra: test
9
- Requires-Dist: hypothesis<6.132,>=6.131.27; extra == 'test'
9
+ Requires-Dist: hypothesis<6.132,>=6.131.28; extra == 'test'
10
10
  Requires-Dist: pytest-asyncio<0.27,>=0.26.0; extra == 'test'
11
11
  Requires-Dist: pytest-cov<6.2,>=6.1.1; extra == 'test'
12
12
  Requires-Dist: pytest-instafail<0.6,>=0.5.0; extra == 'test'
13
- Requires-Dist: pytest-lazy-fixtures<1.2,>=1.1.2; extra == 'test'
13
+ Requires-Dist: pytest-lazy-fixtures<1.2,>=1.1.3; extra == 'test'
14
14
  Requires-Dist: pytest-only<2.2,>=2.1.2; extra == 'test'
15
15
  Requires-Dist: pytest-randomly<3.17,>=3.16.0; extra == 'test'
16
16
  Requires-Dist: pytest-regressions<2.8,>=2.7.0; extra == 'test'
@@ -41,7 +41,7 @@ Requires-Dist: whenever<0.9,>=0.8.2; extra == 'zzz-test-click'
41
41
  Provides-Extra: zzz-test-contextlib
42
42
  Provides-Extra: zzz-test-contextvars
43
43
  Provides-Extra: zzz-test-cryptography
44
- Requires-Dist: cryptography<45.1,>=45.0.2; extra == 'zzz-test-cryptography'
44
+ Requires-Dist: cryptography<45.1,>=45.0.3; extra == 'zzz-test-cryptography'
45
45
  Provides-Extra: zzz-test-cvxpy
46
46
  Requires-Dist: cvxpy<1.7,>=1.6.5; extra == 'zzz-test-cvxpy'
47
47
  Provides-Extra: zzz-test-dataclasses
@@ -78,7 +78,7 @@ Provides-Extra: zzz-test-hypothesis
78
78
  Requires-Dist: aiosqlite<0.22,>=0.21.0; extra == 'zzz-test-hypothesis'
79
79
  Requires-Dist: asyncpg<0.31,>=0.30.0; extra == 'zzz-test-hypothesis'
80
80
  Requires-Dist: greenlet<3.3,>=3.2.0; extra == 'zzz-test-hypothesis'
81
- Requires-Dist: hypothesis<6.132,>=6.131.27; extra == 'zzz-test-hypothesis'
81
+ Requires-Dist: hypothesis<6.132,>=6.131.28; extra == 'zzz-test-hypothesis'
82
82
  Requires-Dist: luigi<3.7,>=3.6.0; extra == 'zzz-test-hypothesis'
83
83
  Requires-Dist: numpy<2.3,>=2.2.6; extra == 'zzz-test-hypothesis'
84
84
  Requires-Dist: pathvalidate<3.3,>=3.2.3; extra == 'zzz-test-hypothesis'
@@ -174,7 +174,7 @@ Requires-Dist: scipy<1.16,>=1.15.3; extra == 'zzz-test-scipy'
174
174
  Provides-Extra: zzz-test-sentinel
175
175
  Provides-Extra: zzz-test-shelve
176
176
  Provides-Extra: zzz-test-slack-sdk
177
- Requires-Dist: aiohttp<3.12,>=3.11.16; extra == 'zzz-test-slack-sdk'
177
+ Requires-Dist: aiohttp<3.13,>=3.12.0; extra == 'zzz-test-slack-sdk'
178
178
  Requires-Dist: slack-sdk<3.36,>=3.35.0; extra == 'zzz-test-slack-sdk'
179
179
  Provides-Extra: zzz-test-socket
180
180
  Provides-Extra: zzz-test-sqlalchemy
@@ -1,4 +1,4 @@
1
- utilities/__init__.py,sha256=S9hi5nUNGrmUoeHSNNw9CdOdoY68OUGHaOm0V7chzZo,60
1
+ utilities/__init__.py,sha256=DteTSv79-JnoG5SiUi0i4Es8z2F38hAIDg1-tlzG4mc,60
2
2
  utilities/altair.py,sha256=Gpja-flOo-Db0PIPJLJsgzAlXWoKUjPU1qY-DQ829ek,9156
3
3
  utilities/asyncio.py,sha256=gr2eUx0E6LiCup6VKgUGwh8lAUriGdX2TlK-PZdlvfo,28284
4
4
  utilities/atomicwrites.py,sha256=geFjn9Pwn-tTrtoGjDDxWli9NqbYfy3gGL6ZBctiqSo,5393
@@ -26,9 +26,10 @@ utilities/http.py,sha256=WcahTcKYRtZ04WXQoWt5EGCgFPcyHD3EJdlMfxvDt-0,946
26
26
  utilities/hypothesis.py,sha256=a75izXg9aCBhhDkj_ZgK3TDzlzk38evP8TO7JbYYQvg,46264
27
27
  utilities/importlib.py,sha256=mV1xT_O_zt_GnZZ36tl3xOmMaN_3jErDWY54fX39F6Y,429
28
28
  utilities/ipython.py,sha256=V2oMYHvEKvlNBzxDXdLvKi48oUq2SclRg5xasjaXStw,763
29
- utilities/iterables.py,sha256=prKXBdF5QfLTGC-q4567DwO8xzUng_Z-2a4wBkMqyDo,45360
29
+ utilities/iterables.py,sha256=wqq2lKfEAq1qncE-lR848DHX627aerFaq4BXmLen-NE,43589
30
30
  utilities/jupyter.py,sha256=ft5JA7fBxXKzP-L9W8f2-wbF0QeYc_2uLQNFDVk4Z-M,2917
31
- utilities/lightweight_charts.py,sha256=vyVOzarYhBIOZj2xDhqdbP85qbSKUjdc6Au91rc1W4M,2814
31
+ utilities/libcst.py,sha256=zqZxfvTdcsi83Ph-HC4lP8zyOqAun7eKABeRdhMtoMM,4846
32
+ utilities/lightweight_charts.py,sha256=0xNfcsrgFI0R9xL25LtSm-W5yhfBI93qQNT6HyaXAhg,2769
32
33
  utilities/logging.py,sha256=gwo3pusPjnWO1ollrtn1VKYyRAQJTue4SkCbMeNvec4,25715
33
34
  utilities/loguru.py,sha256=MEMQVWrdECxk1e3FxGzmOf21vWT9j8CAir98SEXFKPA,3809
34
35
  utilities/luigi.py,sha256=fpH9MbxJDuo6-k9iCXRayFRtiVbUtibCJKugf7ygpv0,5988
@@ -46,14 +47,14 @@ utilities/pathlib.py,sha256=31WPMXdLIyXgYOMMl_HOI2wlo66MGSE-cgeelk-Lias,1410
46
47
  utilities/period.py,sha256=o4wXYEXVlFomop4-Ra4L0yRP4i99NZFjIe_fa7NdZck,11024
47
48
  utilities/pickle.py,sha256=Bhvd7cZl-zQKQDFjUerqGuSKlHvnW1K2QXeU5UZibtg,657
48
49
  utilities/platform.py,sha256=NU7ycTvAXAG-fdYmDXaM1m4EOml2cGiaYwaUzfzSqyU,1767
49
- utilities/polars.py,sha256=tGO3r6S4lFtir6zbdIvZ_kvKBWIha4lnA1eEmV3EvNQ,63632
50
- utilities/polars_ols.py,sha256=efhXf0gjrHUpQrvS6a7g8yJQJWf_ATKtJnqqF2inCOU,5680
50
+ utilities/polars.py,sha256=QlmUpYTqHNkcLnWOQh1TW22W2QyLzvifCvBcbsqhpdE,63272
51
+ utilities/polars_ols.py,sha256=Uc9V5kvlWZ5cU93lKZ-cfAKdVFFw81tqwLW9PxtUvMs,5618
51
52
  utilities/pqdm.py,sha256=foRytQybmOQ05pjt5LF7ANyzrIa--4ScDE3T2wd31a4,3118
52
53
  utilities/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
53
54
  utilities/pydantic.py,sha256=f6qtR5mO2YMuyvNmbaEj5YeD9eGA4YYfb7Bjzh9jUs0,1845
54
55
  utilities/pyinstrument.py,sha256=OJFDh4o1CWIa4aYPYURdQjgap_nvP45KUsCEe94rQHY,829
55
- utilities/pyrsistent.py,sha256=MoDcAqQGlSNkmlS32DCJLw-cZFAfHB6K9kpox_iyI4k,2512
56
- utilities/pytest.py,sha256=85QUax4g2VBBAqAHtM9wekcSLB7_9O8AKFTaCshztL8,7989
56
+ utilities/pyrsistent.py,sha256=wVOVIe_68AAaa-lUE9y-TEzDawVp1uEIc_zfoDgr5ww,2287
57
+ utilities/pytest.py,sha256=KoHSwJbIY2CHtFUlUr_gnEk7z1DVTaldl8RDQ4tDkG4,7837
57
58
  utilities/pytest_regressions.py,sha256=-SVT9647Dg6-JcdsiaDKXe3NdOmmrvGevLKWwGjxq3c,5088
58
59
  utilities/python_dotenv.py,sha256=iWcnpXbH7S6RoXHiLlGgyuH6udCupAcPd_gQ0eAenQ0,3190
59
60
  utilities/random.py,sha256=lYdjgxB7GCfU_fwFVl5U-BIM_HV3q6_urL9byjrwDM8,4157
@@ -67,7 +68,7 @@ utilities/shelve.py,sha256=HZsMwK4tcIfg3sh0gApx4-yjQnrY4o3V3ZRimvRhoW0,738
67
68
  utilities/slack_sdk.py,sha256=Q8UakiB7qo6SUfaBDB0j1N4b8MuFzaD9lG5HGq7rtuw,3200
68
69
  utilities/socket.py,sha256=K77vfREvzoVTrpYKo6MZakol0EYu2q1sWJnnZqL0So0,118
69
70
  utilities/sqlalchemy.py,sha256=p8vsHaNRoeq5zJouIKyp9piFM26wtm5yR4DkzCMFDSw,35471
70
- utilities/sqlalchemy_polars.py,sha256=wjJpoUo-yO9E2ujpG_06vV5r2OdvBiQ4yvV6wKCa2Tk,15605
71
+ utilities/sqlalchemy_polars.py,sha256=s7hQNep2O5DTgIRXyN_JRQma7a4DAtNd25tshaZW8iw,15490
71
72
  utilities/statsmodels.py,sha256=koyiBHvpMcSiBfh99wFUfSggLNx7cuAw3rwyfAhoKpQ,3410
72
73
  utilities/streamlit.py,sha256=U9PJBaKP1IdSykKhPZhIzSPTZsmLsnwbEPZWzNhJPKk,2955
73
74
  utilities/sys.py,sha256=h0Xr7Vj86wNalvwJVP1wj5Y0kD_VWm1vzuXZ_jw94mE,2743
@@ -87,7 +88,7 @@ utilities/warnings.py,sha256=un1LvHv70PU-LLv8RxPVmugTzDJkkGXRMZTE2-fTQHw,1771
87
88
  utilities/whenever.py,sha256=jS31ZAY5OMxFxLja_Yo5Fidi87Pd-GoVZ7Vi_teqVDA,16743
88
89
  utilities/zipfile.py,sha256=24lQc9ATcJxHXBPc_tBDiJk48pWyRrlxO2fIsFxU0A8,699
89
90
  utilities/zoneinfo.py,sha256=-5j7IQ9nb7gR43rdgA7ms05im-XuqhAk9EJnQBXxCoQ,1874
90
- dycw_utilities-0.125.3.dist-info/METADATA,sha256=vMdoTZVKyi-BNSOGgeJYjY6uY-icfbVmvUlAo_SwJmM,12852
91
- dycw_utilities-0.125.3.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
92
- dycw_utilities-0.125.3.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
93
- dycw_utilities-0.125.3.dist-info/RECORD,,
91
+ dycw_utilities-0.125.5.dist-info/METADATA,sha256=OP9MTsqYyVzlwUsK9XdBKW3Z_5p4PNCNC3K8Io5dyMs,12851
92
+ dycw_utilities-0.125.5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
93
+ dycw_utilities-0.125.5.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
94
+ dycw_utilities-0.125.5.dist-info/RECORD,,
utilities/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.125.3"
3
+ __version__ = "0.125.5"
utilities/iterables.py CHANGED
@@ -25,7 +25,6 @@ from typing import (
25
25
  Any,
26
26
  Generic,
27
27
  Literal,
28
- Self,
29
28
  TypeGuard,
30
29
  TypeVar,
31
30
  assert_never,
@@ -45,7 +44,7 @@ from utilities.math import (
45
44
  )
46
45
  from utilities.reprlib import get_repr
47
46
  from utilities.sentinel import Sentinel, sentinel
48
- from utilities.types import Sign, THashable, THashable2, TSupportsAdd, TSupportsLT
47
+ from utilities.types import Sign, THashable, TSupportsAdd, TSupportsLT
49
48
  from utilities.zoneinfo import UTC
50
49
 
51
50
  if TYPE_CHECKING:
@@ -722,57 +721,6 @@ def chunked(iterable: Iterable[_T], n: int, /) -> Iterator[Sequence[_T]]:
722
721
  ##
723
722
 
724
723
 
725
- class Collection(frozenset[THashable]):
726
- """A collection of hashable, sortable items."""
727
-
728
- def __new__(cls, *item_or_items: MaybeIterable[THashable]) -> Self:
729
- items = list(chain(*map(always_iterable, item_or_items)))
730
- cls.check_items(items)
731
- return super().__new__(cls, items)
732
-
733
- def __init__(self, *item_or_items: MaybeIterable[THashable]) -> None:
734
- super().__init__()
735
- _ = item_or_items
736
-
737
- @override
738
- def __and__(self, other: MaybeIterable[THashable], /) -> Self:
739
- if isinstance(other, type(self)):
740
- return type(self)(super().__and__(other))
741
- return self.__and__(type(self)(other))
742
-
743
- @override
744
- def __or__(self, other: MaybeIterable[THashable], /) -> Self:
745
- if isinstance(other, type(self)):
746
- return type(self)(super().__or__(other))
747
- return self.__or__(type(self)(other))
748
-
749
- @override
750
- def __sub__(self, other: MaybeIterable[THashable], /) -> Self:
751
- if isinstance(other, type(self)):
752
- return type(self)(super().__sub__(other))
753
- return self.__sub__(type(self)(other))
754
-
755
- @classmethod
756
- def check_items(cls, items: Iterable[THashable], /) -> None:
757
- _ = items
758
-
759
- def filter(self, func: Callable[[THashable], bool], /) -> Self:
760
- return type(self)(filter(func, self))
761
-
762
- def map(self, func: Callable[[THashable], THashable2], /) -> Collection[THashable2]:
763
- values = cast("Any", map(func, self))
764
- return cast("Any", type(self)(values))
765
-
766
- def partition(self, func: Callable[[THashable], bool], /) -> tuple[Self, Self]:
767
- from more_itertools import partition
768
-
769
- is_false, is_true = partition(func, self)
770
- return type(self)(is_false), type(self)(is_true)
771
-
772
-
773
- ##
774
-
775
-
776
724
  def ensure_hashables(
777
725
  *args: Any, **kwargs: Any
778
726
  ) -> tuple[list[Hashable], dict[str, Hashable]]:
utilities/libcst.py ADDED
@@ -0,0 +1,176 @@
1
+ from __future__ import annotations
2
+
3
+ from collections.abc import Sequence
4
+ from dataclasses import dataclass
5
+ from subprocess import check_output
6
+ from typing import assert_never, override
7
+
8
+ from libcst import (
9
+ AsName,
10
+ Attribute,
11
+ BaseExpression,
12
+ FormattedString,
13
+ FormattedStringExpression,
14
+ FormattedStringText,
15
+ Import,
16
+ ImportAlias,
17
+ ImportFrom,
18
+ ImportStar,
19
+ Module,
20
+ Name,
21
+ )
22
+
23
+ from utilities.errors import ImpossibleCaseError
24
+
25
+
26
+ def generate_from_import(
27
+ module: str, name: str, /, *, asname: str | None = None
28
+ ) -> ImportFrom:
29
+ """Generate an `ImportFrom` object."""
30
+ alias = ImportAlias(
31
+ name=Name(name), asname=AsName(Name(asname)) if asname else None
32
+ )
33
+ return ImportFrom(module=split_dotted_str(module), names=[alias])
34
+
35
+
36
+ def generate_f_string(var: str, suffix: str, /) -> FormattedString:
37
+ """Generate an f-string."""
38
+ return FormattedString([
39
+ FormattedStringExpression(expression=Name(var)),
40
+ FormattedStringText(suffix),
41
+ ])
42
+
43
+
44
+ def generate_import(module: str, /, *, asname: str | None = None) -> Import:
45
+ """Generate an `Import` object."""
46
+ alias = ImportAlias(
47
+ name=split_dotted_str(module), asname=AsName(Name(asname)) if asname else None
48
+ )
49
+ return Import(names=[alias])
50
+
51
+
52
+ ##
53
+
54
+
55
+ @dataclass(kw_only=True, slots=True)
56
+ class _ParseImportOutput:
57
+ module: str
58
+ name: str | None = None
59
+
60
+
61
+ def parse_import(import_: Import | ImportFrom, /) -> Sequence[_ParseImportOutput]:
62
+ """Parse an import."""
63
+ match import_:
64
+ case Import():
65
+ return [_parse_import_one(n) for n in import_.names]
66
+ case ImportFrom():
67
+ if (attr_or_name := import_.module) is None:
68
+ raise _ParseImportEmptyModuleError(import_=import_)
69
+ module = join_dotted_str(attr_or_name)
70
+ match import_.names:
71
+ case Sequence() as names:
72
+ return [_parse_import_from_one(module, n) for n in names]
73
+ case ImportStar():
74
+ return [_ParseImportOutput(module=module, name="*")]
75
+ case _ as never:
76
+ assert_never(never)
77
+ case _ as never:
78
+ assert_never(never)
79
+
80
+
81
+ def _parse_import_one(alias: ImportAlias, /) -> _ParseImportOutput:
82
+ return _ParseImportOutput(module=join_dotted_str(alias.name))
83
+
84
+
85
+ def _parse_import_from_one(module: str, alias: ImportAlias, /) -> _ParseImportOutput:
86
+ match alias.name:
87
+ case Name(name):
88
+ return _ParseImportOutput(module=module, name=name)
89
+ case Attribute() as attr:
90
+ raise _ParseImportAliasError(module=module, attr=attr)
91
+ case _ as never:
92
+ assert_never(never)
93
+
94
+
95
+ @dataclass(kw_only=True, slots=True)
96
+ class ParseImportError(Exception): ...
97
+
98
+
99
+ @dataclass(kw_only=True, slots=True)
100
+ class _ParseImportEmptyModuleError(ParseImportError):
101
+ import_: ImportFrom
102
+
103
+ @override
104
+ def __str__(self) -> str:
105
+ return f"Module must not be None; got {self.import_}"
106
+
107
+
108
+ @dataclass(kw_only=True, slots=True)
109
+ class _ParseImportAliasError(ParseImportError):
110
+ module: str
111
+ attr: Attribute
112
+
113
+ @override
114
+ def __str__(self) -> str:
115
+ attr = self.attr
116
+ return f"Invalid alias name; got module {self.module!r} and attribute '{attr.value}.{attr.attr}'"
117
+
118
+
119
+ ##
120
+
121
+
122
+ def split_dotted_str(dotted: str, /) -> Name | Attribute:
123
+ """Split a dotted string into a name/attribute."""
124
+ parts = dotted.split(".")
125
+ node = Name(parts[0])
126
+ for part in parts[1:]:
127
+ node = Attribute(value=node, attr=Name(part))
128
+ return node
129
+
130
+
131
+ def join_dotted_str(name_or_attr: Name | Attribute, /) -> str:
132
+ """Join a dotted from from a name/attribute."""
133
+ parts: Sequence[str] = []
134
+ curr: BaseExpression | Name | Attribute = name_or_attr
135
+ while True:
136
+ match curr:
137
+ case Name(value=value):
138
+ parts.append(value)
139
+ break
140
+ case Attribute(value=value, attr=Name(value=attr_value)):
141
+ parts.append(attr_value)
142
+ curr = value
143
+ case BaseExpression(): # pragma: no cover
144
+ raise ImpossibleCaseError(case=[f"{curr=}"])
145
+ case _ as never:
146
+ assert_never(never)
147
+ return ".".join(reversed(parts))
148
+
149
+
150
+ ##
151
+
152
+
153
+ def render_module(source: str | Module, /) -> str:
154
+ """Render a module."""
155
+ match source: # skipif-ci
156
+ case str() as text:
157
+ return check_output(["ruff", "format", "-"], input=text, text=True)
158
+ case Module() as module:
159
+ return render_module(module.code)
160
+ case _ as never:
161
+ assert_never(never)
162
+
163
+
164
+ ##
165
+
166
+
167
+ __all__ = [
168
+ "ParseImportError",
169
+ "generate_f_string",
170
+ "generate_from_import",
171
+ "generate_import",
172
+ "join_dotted_str",
173
+ "parse_import",
174
+ "render_module",
175
+ "split_dotted_str",
176
+ ]
@@ -13,7 +13,7 @@ if TYPE_CHECKING:
13
13
  from lightweight_charts import AbstractChart, Chart
14
14
  from lightweight_charts.abstract import SeriesCommon
15
15
  from polars import DataFrame
16
- from polars._typing import SchemaDict # pyright: ignore[reportPrivateImportUsage]
16
+ from polars._typing import SchemaDict
17
17
 
18
18
  from utilities.types import PathLike
19
19
 
utilities/polars.py CHANGED
@@ -112,14 +112,14 @@ if TYPE_CHECKING:
112
112
  from collections.abc import Set as AbstractSet
113
113
 
114
114
  from polars._typing import (
115
- IntoExpr, # pyright: ignore[reportPrivateImportUsage]
116
- IntoExprColumn, # pyright: ignore[reportPrivateImportUsage]
117
- JoinStrategy, # pyright: ignore[reportPrivateImportUsage]
118
- JoinValidation, # pyright: ignore[reportPrivateImportUsage]
119
- PolarsDataType, # pyright: ignore[reportPrivateImportUsage]
120
- QuantileMethod, # pyright: ignore[reportPrivateImportUsage]
121
- SchemaDict, # pyright: ignore[reportPrivateImportUsage]
122
- TimeUnit, # pyright: ignore[reportPrivateImportUsage]
115
+ IntoExpr,
116
+ IntoExprColumn,
117
+ JoinStrategy,
118
+ JoinValidation,
119
+ PolarsDataType,
120
+ QuantileMethod,
121
+ SchemaDict,
122
+ TimeUnit,
123
123
  )
124
124
 
125
125
  from utilities.numpy import NDArrayB, NDArrayF
utilities/polars_ols.py CHANGED
@@ -10,9 +10,7 @@ from utilities.functions import is_sequence_of
10
10
  from utilities.polars import concat_series, ensure_expr_or_series
11
11
 
12
12
  if TYPE_CHECKING:
13
- from polars._typing import (
14
- IntoExprColumn, # pyright: ignore[reportPrivateImportUsage]
15
- )
13
+ from polars._typing import IntoExprColumn
16
14
  from polars_ols import NullPolicy
17
15
 
18
16
  from utilities.polars import ExprLike
utilities/pyrsistent.py CHANGED
@@ -5,11 +5,11 @@ from typing import TYPE_CHECKING, Any, TypeVar, dataclass_transform, overload
5
5
  from pyrsistent import PRecord as _PRecord
6
6
  from pyrsistent import field as _field
7
7
  from pyrsistent._field_common import (
8
- PFIELD_NO_FACTORY, # pyright: ignore[reportPrivateImportUsage]
9
- PFIELD_NO_INITIAL, # pyright: ignore[reportPrivateImportUsage]
10
- PFIELD_NO_INVARIANT, # pyright: ignore[reportPrivateImportUsage]
11
- PFIELD_NO_SERIALIZER, # pyright: ignore[reportPrivateImportUsage]
12
- PFIELD_NO_TYPE, # pyright: ignore[reportPrivateImportUsage]
8
+ PFIELD_NO_FACTORY,
9
+ PFIELD_NO_INITIAL,
10
+ PFIELD_NO_INVARIANT,
11
+ PFIELD_NO_SERIALIZER,
12
+ PFIELD_NO_TYPE,
13
13
  )
14
14
 
15
15
  if TYPE_CHECKING:
utilities/pytest.py CHANGED
@@ -35,11 +35,9 @@ if TYPE_CHECKING:
35
35
  )
36
36
 
37
37
  try: # WARNING: this package cannot use unguarded `pytest` imports
38
- from _pytest.config import Config # pyright: ignore[reportPrivateImportUsage]
39
- from _pytest.config.argparsing import (
40
- Parser, # pyright: ignore[reportPrivateImportUsage]
41
- )
42
- from _pytest.python import Function # pyright: ignore[reportPrivateImportUsage]
38
+ from _pytest.config import Config
39
+ from _pytest.config.argparsing import Parser
40
+ from _pytest.python import Function
43
41
  from pytest import mark, skip
44
42
  except ModuleNotFoundError: # pragma: no cover
45
43
  from typing import Any as Config
@@ -60,10 +60,7 @@ if TYPE_CHECKING:
60
60
  Mapping,
61
61
  )
62
62
 
63
- from polars._typing import (
64
- PolarsDataType, # pyright: ignore[reportPrivateImportUsage]
65
- SchemaDict, # pyright: ignore[reportPrivateImportUsage]
66
- )
63
+ from polars._typing import PolarsDataType, SchemaDict
67
64
  from sqlalchemy.sql import ColumnCollection
68
65
  from sqlalchemy.sql.base import ReadOnlyColumnCollection
69
66
  from tenacity.retry import RetryBaseT