dycw-utilities 0.166.31__py3-none-any.whl → 0.166.33__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.

Potentially problematic release.


This version of dycw-utilities might be problematic. Click here for more details.

@@ -1,10 +1,11 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dycw-utilities
3
- Version: 0.166.31
3
+ Version: 0.166.33
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: atomicwrites<1.5,>=1.4.1
8
+ Requires-Dist: jinja2>=3.1.6
8
9
  Requires-Dist: typing-extensions<4.16,>=4.15.0
9
10
  Requires-Dist: tzlocal<5.4,>=5.3.1
10
11
  Requires-Dist: whenever<0.9,>=0.8.8
@@ -12,7 +13,7 @@ Provides-Extra: logging
12
13
  Requires-Dist: coloredlogs<15.1,>=15.0.1; extra == 'logging'
13
14
  Provides-Extra: test
14
15
  Requires-Dist: dycw-pytest-only<2.2,>=2.1.1; extra == 'test'
15
- Requires-Dist: hypothesis<6.139,>=6.138.16; extra == 'test'
16
+ Requires-Dist: hypothesis<6.140,>=6.139.1; extra == 'test'
16
17
  Requires-Dist: pytest-asyncio<1.3,>=1.2.0; extra == 'test'
17
18
  Requires-Dist: pytest-cov<7.1,>=7.0.0; extra == 'test'
18
19
  Requires-Dist: pytest-instafail<0.6,>=0.5.0; extra == 'test'
@@ -1,4 +1,4 @@
1
- utilities/__init__.py,sha256=J63g-0Wc3WmP7lyA4Ia1OO0SML9uonoD5YMTXi-KZlw,61
1
+ utilities/__init__.py,sha256=Kx5TbV5cVRJDCikmGD7bMR8M-ajCMinoi2R0gAorL6g,61
2
2
  utilities/aeventkit.py,sha256=ddoleSwW9zdc2tjX5Ge0pMKtYwV_JMxhHYOxnWX2AGM,12609
3
3
  utilities/altair.py,sha256=nHdpWt8ZwdUwRQN970MvHd5bRWokNqzHcZQEdSHKRuE,9033
4
4
  utilities/asyncio.py,sha256=60l1IwjnRGeaVphAFiwDIHyfKoZYKY-XGpptUxGiU-M,17034
@@ -28,6 +28,7 @@ utilities/importlib.py,sha256=mV1xT_O_zt_GnZZ36tl3xOmMaN_3jErDWY54fX39F6Y,429
28
28
  utilities/inflect.py,sha256=v7YkOWSu8NAmVghPcf4F3YBZQoJCS47_DLf9jbfWIs0,581
29
29
  utilities/ipython.py,sha256=V2oMYHvEKvlNBzxDXdLvKi48oUq2SclRg5xasjaXStw,763
30
30
  utilities/iterables.py,sha256=t2TsW-K3rVlS6y4_tqcc1fk9RwJV-bi7G_VwduMABK0,42558
31
+ utilities/jinja2.py,sha256=Pbq29FLEaTkPxMICcRMYsHj94m5geBfJlP62hghCYKM,2704
31
32
  utilities/json.py,sha256=-WcGtSsCr9Y42wHZzAMnfvU6ihAfVftylFfRUORaDFo,2102
32
33
  utilities/jupyter.py,sha256=ft5JA7fBxXKzP-L9W8f2-wbF0QeYc_2uLQNFDVk4Z-M,2917
33
34
  utilities/libcst.py,sha256=ngD4wxnR3Kh-RBVmU5l5ST7cuZLhMZwyMDjHZe5mhTs,5581
@@ -57,7 +58,7 @@ utilities/pydantic_settings.py,sha256=bFr9UDrVhdqTl7O_TPutCLdsQ5rUp--nO76-_F8z0b
57
58
  utilities/pydantic_settings_sops.py,sha256=9Ou6Cx6PiYOU49vtkKqqW1Sdp_i3WlVyg8KkUUKNliM,2310
58
59
  utilities/pyinstrument.py,sha256=hnXaL-4HE7wWBI5JKaPfYTpsrXe68YiuZKahHV0VJn8,841
59
60
  utilities/pytest.py,sha256=4KzMZYg5Zzfyjxrw8VlnZNYCD2S0Uee1JIFMIPyIkO8,10076
60
- utilities/pytest_regressions.py,sha256=ocjHTtfOeiGfQAKIei8pKNd61sxN9dawrJJ9gPt2wzA,4097
61
+ utilities/pytest_regressions.py,sha256=vkMH4swF1LVK2117k9cenm9BhVFiTTRwK3Ys_X2wyGI,4045
61
62
  utilities/random.py,sha256=hZlH4gnAtoaofWswuJYjcygejrY8db4CzP-z_adO2Mo,4165
62
63
  utilities/re.py,sha256=S4h-DLL6ScMPqjboZ_uQ1BVTJajrqV06r_81D--_HCE,4573
63
64
  utilities/redis.py,sha256=gybjqKea33Jy50n4dHTS14JdquqHaJqHF2dixQljYWQ,30172
@@ -91,8 +92,8 @@ utilities/zoneinfo.py,sha256=tdIScrTB2-B-LH0ukb1HUXKooLknOfJNwHk10MuMYvA,3619
91
92
  utilities/pytest_plugins/__init__.py,sha256=U4S_2y3zgLZVfMenHRaJFBW8yqh2mUBuI291LGQVOJ8,35
92
93
  utilities/pytest_plugins/pytest_randomly.py,sha256=B1qYVlExGOxTywq2r1SMi5o7btHLk2PNdY_b1p98dkE,409
93
94
  utilities/pytest_plugins/pytest_regressions.py,sha256=mnHYBfdprz50UGVkVzV1bZERZN5CFfoF8YbokGxdFwU,1639
94
- dycw_utilities-0.166.31.dist-info/METADATA,sha256=_C5N_WrI7n6SDUrEsBQ_knk0sDnF7dl1PgGDkJgPbOw,1700
95
- dycw_utilities-0.166.31.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
96
- dycw_utilities-0.166.31.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
97
- dycw_utilities-0.166.31.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
98
- dycw_utilities-0.166.31.dist-info/RECORD,,
95
+ dycw_utilities-0.166.33.dist-info/METADATA,sha256=vFOq1nhTXLnENnBU5wi06qiVuZqsW5-xyDzeV9cBqvI,1728
96
+ dycw_utilities-0.166.33.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
97
+ dycw_utilities-0.166.33.dist-info/entry_points.txt,sha256=BOD_SoDxwsfJYOLxhrSXhHP_T7iw-HXI9f2WVkzYxvQ,135
98
+ dycw_utilities-0.166.33.dist-info/licenses/LICENSE,sha256=gppZp16M6nSVpBbUBrNL6JuYfvKwZiKgV7XoKKsHzqo,1066
99
+ dycw_utilities-0.166.33.dist-info/RECORD,,
utilities/__init__.py CHANGED
@@ -1,3 +1,3 @@
1
1
  from __future__ import annotations
2
2
 
3
- __version__ = "0.166.31"
3
+ __version__ = "0.166.33"
utilities/jinja2.py ADDED
@@ -0,0 +1,86 @@
1
+ from __future__ import annotations
2
+
3
+ from typing import TYPE_CHECKING, Any, Literal, override
4
+
5
+ from jinja2 import BaseLoader, BytecodeCache, Environment, Undefined
6
+ from jinja2.defaults import (
7
+ BLOCK_END_STRING,
8
+ BLOCK_START_STRING,
9
+ COMMENT_END_STRING,
10
+ COMMENT_START_STRING,
11
+ KEEP_TRAILING_NEWLINE,
12
+ LINE_COMMENT_PREFIX,
13
+ LINE_STATEMENT_PREFIX,
14
+ LSTRIP_BLOCKS,
15
+ NEWLINE_SEQUENCE,
16
+ TRIM_BLOCKS,
17
+ VARIABLE_END_STRING,
18
+ VARIABLE_START_STRING,
19
+ )
20
+
21
+ from utilities.text import pascal_case, snake_case
22
+
23
+ if TYPE_CHECKING:
24
+ from collections.abc import Callable, Sequence
25
+
26
+ from jinja2.ext import Extension
27
+
28
+
29
+ class EnhancedEnvironment(Environment):
30
+ """Environment with enhanced features."""
31
+
32
+ @override
33
+ def __init__(
34
+ self,
35
+ block_start_string: str = BLOCK_START_STRING,
36
+ block_end_string: str = BLOCK_END_STRING,
37
+ variable_start_string: str = VARIABLE_START_STRING,
38
+ variable_end_string: str = VARIABLE_END_STRING,
39
+ comment_start_string: str = COMMENT_START_STRING,
40
+ comment_end_string: str = COMMENT_END_STRING,
41
+ line_statement_prefix: str | None = LINE_STATEMENT_PREFIX,
42
+ line_comment_prefix: str | None = LINE_COMMENT_PREFIX,
43
+ trim_blocks: bool = TRIM_BLOCKS,
44
+ lstrip_blocks: bool = LSTRIP_BLOCKS,
45
+ newline_sequence: Literal["\n", "\r\n", "\r"] = NEWLINE_SEQUENCE,
46
+ keep_trailing_newline: bool = KEEP_TRAILING_NEWLINE,
47
+ extensions: Sequence[str | type[Extension]] = (),
48
+ optimized: bool = True,
49
+ undefined: type[Undefined] = Undefined,
50
+ finalize: Callable[..., Any] | None = None,
51
+ autoescape: bool | Callable[[str | None], bool] = False,
52
+ loader: BaseLoader | None = None,
53
+ cache_size: int = 400,
54
+ auto_reload: bool = True,
55
+ bytecode_cache: BytecodeCache | None = None,
56
+ enable_async: bool = False,
57
+ ) -> None:
58
+ super().__init__(
59
+ block_start_string,
60
+ block_end_string,
61
+ variable_start_string,
62
+ variable_end_string,
63
+ comment_start_string,
64
+ comment_end_string,
65
+ line_statement_prefix,
66
+ line_comment_prefix,
67
+ trim_blocks,
68
+ lstrip_blocks,
69
+ newline_sequence,
70
+ keep_trailing_newline,
71
+ extensions,
72
+ optimized,
73
+ undefined,
74
+ finalize,
75
+ autoescape,
76
+ loader,
77
+ cache_size,
78
+ auto_reload,
79
+ bytecode_cache,
80
+ enable_async,
81
+ )
82
+ self.filters["snake"] = snake_case
83
+ self.filters["pascal"] = pascal_case
84
+
85
+
86
+ __all__ = ["EnhancedEnvironment"]
@@ -97,7 +97,6 @@ class PolarsRegressionFixture:
97
97
  "describe": obj.describe(percentiles=[i / 10 for i in range(1, 10)]).rows(
98
98
  named=True
99
99
  ),
100
- "estimated_size": obj.estimated_size(),
101
100
  "is_empty": obj.is_empty(),
102
101
  "n_unique": obj.n_unique(),
103
102
  }