thds.core 1.45.20250828214748__py3-none-any.whl → 1.45.20250902220316__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 thds.core might be problematic. Click here for more details.
- thds/core/cache.py +2 -4
- thds/core/calgitver.py +9 -9
- thds/core/concurrency.py +1 -0
- thds/core/decos.py +2 -4
- thds/core/fretry.py +1 -1
- thds/core/generators.py +1 -0
- thds/core/hashing.py +1 -2
- thds/core/meta.py +5 -10
- thds/core/parallel.py +3 -6
- thds/core/protocols.py +2 -4
- thds/core/sqlite/structured.py +2 -3
- thds/core/sqlite/types.py +2 -4
- thds/core/stack_context.py +1 -0
- {thds_core-1.45.20250828214748.dist-info → thds_core-1.45.20250902220316.dist-info}/METADATA +1 -1
- {thds_core-1.45.20250828214748.dist-info → thds_core-1.45.20250902220316.dist-info}/RECORD +18 -18
- {thds_core-1.45.20250828214748.dist-info → thds_core-1.45.20250902220316.dist-info}/WHEEL +0 -0
- {thds_core-1.45.20250828214748.dist-info → thds_core-1.45.20250902220316.dist-info}/entry_points.txt +0 -0
- {thds_core-1.45.20250828214748.dist-info → thds_core-1.45.20250902220316.dist-info}/top_level.txt +0 -0
thds/core/cache.py
CHANGED
|
@@ -145,8 +145,7 @@ def _locking_factory(
|
|
|
145
145
|
|
|
146
146
|
|
|
147
147
|
@ty.overload
|
|
148
|
-
def locking(func: ty.Callable[_P, _R]) -> ty.Callable[_P, _R]:
|
|
149
|
-
... # pragma: no cover
|
|
148
|
+
def locking(func: ty.Callable[_P, _R]) -> ty.Callable[_P, _R]: ... # pragma: no cover
|
|
150
149
|
|
|
151
150
|
|
|
152
151
|
@ty.overload
|
|
@@ -155,8 +154,7 @@ def locking(
|
|
|
155
154
|
*,
|
|
156
155
|
cache_lock: ty.Optional[proto.ContextManager] = ...,
|
|
157
156
|
make_func_lock: ty.Optional[ty.Callable[[HashedTuple], proto.ContextManager]] = ...,
|
|
158
|
-
) -> ty.Callable[[ty.Callable[_P, _R]], ty.Callable[_P, _R]]:
|
|
159
|
-
... # pragma: no cover
|
|
157
|
+
) -> ty.Callable[[ty.Callable[_P, _R]], ty.Callable[_P, _R]]: ... # pragma: no cover
|
|
160
158
|
|
|
161
159
|
|
|
162
160
|
# overloads cover typical usage of `locking_cache` but aren't comprehensive
|
thds/core/calgitver.py
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"""Uses local git repo info to construct a more informative CalVer version string.
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
This time format was chosen to be CalVer-esque but to drop time
|
|
4
|
+
fractions smaller than minutes since they're exceeding rarely
|
|
5
|
+
semantically meaningful, and the git commit hash will in 99.999%
|
|
6
|
+
of cases be a great disambiguator for cases where multiple
|
|
7
|
+
versions happen to be generated within the same minute by
|
|
8
|
+
different users.
|
|
9
|
+
|
|
10
|
+
We use only dots as separators to be compatible with both Container Registry
|
|
11
|
+
formats and PEP440.
|
|
12
12
|
"""
|
|
13
13
|
|
|
14
14
|
import os
|
thds/core/concurrency.py
CHANGED
thds/core/decos.py
CHANGED
|
@@ -4,13 +4,11 @@ F = ty.TypeVar("F", bound=ty.Callable)
|
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
@ty.overload
|
|
7
|
-
def compose(*decorators: ty.Callable[[F], F]) -> ty.Callable[[F], F]:
|
|
8
|
-
... # pragma: no cover
|
|
7
|
+
def compose(*decorators: ty.Callable[[F], F]) -> ty.Callable[[F], F]: ... # pragma: no cover
|
|
9
8
|
|
|
10
9
|
|
|
11
10
|
@ty.overload
|
|
12
|
-
def compose(*decorators: ty.Callable[[F], F], f: F) -> F:
|
|
13
|
-
... # pragma: no cover
|
|
11
|
+
def compose(*decorators: ty.Callable[[F], F], f: F) -> F: ... # pragma: no cover
|
|
14
12
|
|
|
15
13
|
|
|
16
14
|
def compose(*decorators: ty.Callable[[F], F], f: ty.Optional[F] = None) -> ty.Callable[[F], F]:
|
thds/core/fretry.py
CHANGED
|
@@ -144,7 +144,7 @@ async def aenumerate(
|
|
|
144
144
|
|
|
145
145
|
|
|
146
146
|
def iter_to_async(
|
|
147
|
-
sync_iter_factory: ty.Callable[[], ty.Iterable[T]]
|
|
147
|
+
sync_iter_factory: ty.Callable[[], ty.Iterable[T]],
|
|
148
148
|
) -> ty.Callable[[], ty.AsyncIterator[T]]:
|
|
149
149
|
"""Convert a synchronous iterable factory to an async iterator factory."""
|
|
150
150
|
|
thds/core/generators.py
CHANGED
thds/core/hashing.py
CHANGED
thds/core/meta.py
CHANGED
|
@@ -58,18 +58,15 @@ def format_name(name: str, format: NameFormatType = "git") -> str:
|
|
|
58
58
|
|
|
59
59
|
|
|
60
60
|
@ty.overload
|
|
61
|
-
def get_timestamp() -> str:
|
|
62
|
-
... # pragma: no cover
|
|
61
|
+
def get_timestamp() -> str: ... # pragma: no cover
|
|
63
62
|
|
|
64
63
|
|
|
65
64
|
@ty.overload
|
|
66
|
-
def get_timestamp(as_datetime: ty.Literal[True]) -> datetime:
|
|
67
|
-
... # pragma: no cover
|
|
65
|
+
def get_timestamp(as_datetime: ty.Literal[True]) -> datetime: ... # pragma: no cover
|
|
68
66
|
|
|
69
67
|
|
|
70
68
|
@ty.overload
|
|
71
|
-
def get_timestamp(as_datetime: ty.Literal[False]) -> str:
|
|
72
|
-
... # pragma: no cover
|
|
69
|
+
def get_timestamp(as_datetime: ty.Literal[False]) -> str: ... # pragma: no cover
|
|
73
70
|
|
|
74
71
|
|
|
75
72
|
def get_timestamp(as_datetime: bool = False):
|
|
@@ -109,13 +106,11 @@ def extract_timestamp(version: str) -> str:
|
|
|
109
106
|
|
|
110
107
|
|
|
111
108
|
@ty.overload
|
|
112
|
-
def extract_timestamp(version: str, as_datetime: ty.Literal[True]) -> datetime:
|
|
113
|
-
... # pragma: no cover
|
|
109
|
+
def extract_timestamp(version: str, as_datetime: ty.Literal[True]) -> datetime: ... # pragma: no cover
|
|
114
110
|
|
|
115
111
|
|
|
116
112
|
@ty.overload
|
|
117
|
-
def extract_timestamp(version: str, as_datetime: ty.Literal[False]) -> str:
|
|
118
|
-
... # pragma: no cover
|
|
113
|
+
def extract_timestamp(version: str, as_datetime: ty.Literal[False]) -> str: ... # pragma: no cover
|
|
119
114
|
|
|
120
115
|
|
|
121
116
|
def extract_timestamp(version: str, as_datetime: bool = False):
|
thds/core/parallel.py
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
"""Some utilities for running things in parallel - potentially large numbers of things.
|
|
2
|
-
"""
|
|
1
|
+
"""Some utilities for running things in parallel - potentially large numbers of things."""
|
|
3
2
|
|
|
4
3
|
import concurrent.futures
|
|
5
4
|
import itertools
|
|
@@ -22,11 +21,9 @@ logger = log.getLogger(__name__)
|
|
|
22
21
|
|
|
23
22
|
|
|
24
23
|
class IterableWithLen(ty.Protocol[T_co]):
|
|
25
|
-
def __iter__(self) -> ty.Iterator[T_co]:
|
|
26
|
-
... # pragma: no cover
|
|
24
|
+
def __iter__(self) -> ty.Iterator[T_co]: ... # pragma: no cover
|
|
27
25
|
|
|
28
|
-
def __len__(self) -> int:
|
|
29
|
-
... # pragma: no cover
|
|
26
|
+
def __len__(self) -> int: ... # pragma: no cover
|
|
30
27
|
|
|
31
28
|
|
|
32
29
|
class IteratorWithLen(ty.Generic[R]):
|
thds/core/protocols.py
CHANGED
|
@@ -5,13 +5,11 @@ _T_co = ty.TypeVar("_T_co", covariant=True)
|
|
|
5
5
|
|
|
6
6
|
|
|
7
7
|
class ContextManager(ty.Protocol[_T_co]):
|
|
8
|
-
def __enter__(self) -> _T_co:
|
|
9
|
-
...
|
|
8
|
+
def __enter__(self) -> _T_co: ...
|
|
10
9
|
|
|
11
10
|
def __exit__(
|
|
12
11
|
self,
|
|
13
12
|
exc_type: ty.Optional[ty.Type[BaseException]],
|
|
14
13
|
exc_value: ty.Optional[BaseException],
|
|
15
14
|
traceback: ty.Optional[TracebackType],
|
|
16
|
-
) -> ty.Optional[bool]:
|
|
17
|
-
...
|
|
15
|
+
) -> ty.Optional[bool]: ...
|
thds/core/sqlite/structured.py
CHANGED
|
@@ -40,8 +40,7 @@ class UnknownColumns(ValueError):
|
|
|
40
40
|
|
|
41
41
|
|
|
42
42
|
class _Table(ty.Protocol):
|
|
43
|
-
def __call__(self, ignore_mmap_size: bool = False) -> TableMeta:
|
|
44
|
-
...
|
|
43
|
+
def __call__(self, ignore_mmap_size: bool = False) -> TableMeta: ...
|
|
45
44
|
|
|
46
45
|
|
|
47
46
|
class StructTable(ty.Generic[T]):
|
|
@@ -101,7 +100,7 @@ class StructTable(ty.Generic[T]):
|
|
|
101
100
|
|
|
102
101
|
|
|
103
102
|
def autometa_factory(
|
|
104
|
-
src: ty.Callable[[], DbPathAndTableName]
|
|
103
|
+
src: ty.Callable[[], DbPathAndTableName],
|
|
105
104
|
) -> ty.Callable[[ty.Optional[int]], ThreadLocalLazy[TableMeta]]:
|
|
106
105
|
"""Use this factory to defer the connection and other settings (e.g., mmap_size) within each thread"""
|
|
107
106
|
|
thds/core/sqlite/types.py
CHANGED
|
@@ -8,12 +8,10 @@ from thds.core.source import Source
|
|
|
8
8
|
|
|
9
9
|
class DbAndTableP(ty.Protocol):
|
|
10
10
|
@property # read-only
|
|
11
|
-
def db_path(self) -> os.PathLike:
|
|
12
|
-
...
|
|
11
|
+
def db_path(self) -> os.PathLike: ...
|
|
13
12
|
|
|
14
13
|
@property # read-only
|
|
15
|
-
def table_name(self) -> str:
|
|
16
|
-
...
|
|
14
|
+
def table_name(self) -> str: ...
|
|
17
15
|
|
|
18
16
|
|
|
19
17
|
class DbAndTable(ty.NamedTuple):
|
thds/core/stack_context.py
CHANGED
|
@@ -4,6 +4,7 @@ create a global StackContext, and use a with statement to set its
|
|
|
4
4
|
value for everything below the current place on the stack.
|
|
5
5
|
Only affects your thread/green thread (works with async).
|
|
6
6
|
"""
|
|
7
|
+
|
|
7
8
|
import contextlib as cl
|
|
8
9
|
import contextvars as cv
|
|
9
10
|
import typing as ty
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
thds/core/__init__.py,sha256=tgEnfB_yhKLZ1tyMcQCAXaFybJj-anjm0g0vg8xKx_o,986
|
|
2
2
|
thds/core/ansi_esc.py,sha256=QZ3CptZbX4N_hyP2IgqfTbNt9tBPaqy7ReTMQIzGbrc,870
|
|
3
|
-
thds/core/cache.py,sha256=
|
|
4
|
-
thds/core/calgitver.py,sha256=
|
|
3
|
+
thds/core/cache.py,sha256=VPAQmaQ58N9YWBzKCdJ852qfc1Jqyu2UAp8H8gRXc2A,7180
|
|
4
|
+
thds/core/calgitver.py,sha256=Azy8cuzwwqzgP5avvS_AXLyHH-ePk0CiQLR3x18mJO0,2465
|
|
5
5
|
thds/core/cm.py,sha256=WZB8eQU0DaBYj9s97nc3PuCtai9guovfyiQH68zhLzY,1086
|
|
6
|
-
thds/core/concurrency.py,sha256=
|
|
6
|
+
thds/core/concurrency.py,sha256=iuiQd_x4vWxo4f_eIARkLZ-3FOYhfjHpktFHoKngSfg,3521
|
|
7
7
|
thds/core/config.py,sha256=VWymw6pqPRvX7wwsJ0Y-D2gLoCclAHhARmTnuUw7kb0,10014
|
|
8
8
|
thds/core/cpus.py,sha256=wcxNvcJaXfm7P-peLusbF5EhD0fGGt9tG_EeL5rbKU8,3836
|
|
9
|
-
thds/core/decos.py,sha256=
|
|
9
|
+
thds/core/decos.py,sha256=lE4W6W6yjiCtwjM_qaa_NDuzuVV4EFDF2mMVoyVidPo,1333
|
|
10
10
|
thds/core/dict_utils.py,sha256=MatsjZC9lchfdaDqNAzL2mkTZytDnCAqg56sMm71wbE,6364
|
|
11
11
|
thds/core/dump_stacks.py,sha256=srE4VlgU1kwcMFf12skenSdinx7Lu174MjV-gLNh6n4,1033
|
|
12
12
|
thds/core/env.py,sha256=HkuyFmGpCgdQUB1r2GbpCqB3cs1lCsvp47Ghk1DHBo8,1083
|
|
13
13
|
thds/core/exit_after.py,sha256=0lz63nz2NTiIdyBDYyRa9bQShxQKe7eISy8VhXeW4HU,3485
|
|
14
14
|
thds/core/files.py,sha256=aGJ6D23DcxTlqFtSZLLPDINUsEwGAI980mMO5U0W44M,4678
|
|
15
15
|
thds/core/fp.py,sha256=S9hM7YmjbmaYbe4l5jSGnzf3HWhEaItmUOv6GMQpHo8,508
|
|
16
|
-
thds/core/fretry.py,sha256=
|
|
16
|
+
thds/core/fretry.py,sha256=01yJ0cj4PlgdGiIruXncqWj-DHJhGukIAHa6x9SIrSI,6943
|
|
17
17
|
thds/core/futures.py,sha256=JgqEP9TFC5UVr4tpfaVePHuI-pTsKAFHDWLxkE4aDb0,7372
|
|
18
|
-
thds/core/generators.py,sha256=
|
|
18
|
+
thds/core/generators.py,sha256=cAomVJ_Y5T3GF_ONF-d3_frD9uszPB0_AKatH56COi8,1940
|
|
19
19
|
thds/core/git.py,sha256=cfdN1oXyfz7k7T2XaseTqL6Ng53B9lfKtzDLmFjojRs,2947
|
|
20
20
|
thds/core/hash_cache.py,sha256=jSFijG33UUQjVSkbuACdg4KzIBaf28i7hSQXCO49Qh0,4066
|
|
21
|
-
thds/core/hashing.py,sha256=
|
|
21
|
+
thds/core/hashing.py,sha256=dR4HEWcAdU8O-9ASGkl8naKs6I1Sd7aps4EcVefvVLQ,4246
|
|
22
22
|
thds/core/home.py,sha256=tTClL_AarIKeri1aNCpuIC6evD7qr83ESGD173B81hU,470
|
|
23
23
|
thds/core/hostname.py,sha256=canFGr-JaaG7nUfsQlyL0JT-2tnZoT1BvXzyaOMK1vA,208
|
|
24
24
|
thds/core/imports.py,sha256=0LVegY8I8_XKZPcqiIp2OVVzEDtyqYA3JETf9OAKNKs,568
|
|
@@ -28,19 +28,19 @@ thds/core/lazy.py,sha256=e1WvG4LsbEydV0igEr_Vl1cq05zlQNIE8MFYT90yglE,3289
|
|
|
28
28
|
thds/core/link.py,sha256=4-9d22l_oSkKoSzlYEO-rwxO1hvvj6VETY7LwvGcX6M,5534
|
|
29
29
|
thds/core/logical_root.py,sha256=gWkIYRv9kNQfzbpxJaYiwNXVz1neZ2NvnvProtOn9d8,1399
|
|
30
30
|
thds/core/merge_args.py,sha256=7oj7dtO1-XVkfTM3aBlq3QlZbo8tb6X7E3EVIR-60t8,5781
|
|
31
|
-
thds/core/meta.py,sha256=
|
|
32
|
-
thds/core/parallel.py,sha256=
|
|
31
|
+
thds/core/meta.py,sha256=Df0DxV5UzHcEsu5UCYaE1BWipMPTEXycn9Ug4cdquMk,12114
|
|
32
|
+
thds/core/parallel.py,sha256=Oee5kFvL9OsqVodctRwVIQMyQ5dUJHrUWhXszVcnqaE,7595
|
|
33
33
|
thds/core/pickle_visit.py,sha256=QNMWIi5buvk2zsvx1-D-FKL7tkrFUFDs387vxgGebgU,833
|
|
34
34
|
thds/core/prof.py,sha256=5ViolfPsAPwUTHuhAe-bon7IArPGXydpGoB5uZmObDk,8264
|
|
35
35
|
thds/core/progress.py,sha256=tY8tc_6CMnu_O8DVisnsRoDpFJOw5vqyYzLhQDxsLn8,4361
|
|
36
36
|
thds/core/project_root.py,sha256=K18U3MLthZnzmdrWmKKtHLd6iu7am9b2vNAThqknpfo,891
|
|
37
|
-
thds/core/protocols.py,sha256=
|
|
37
|
+
thds/core/protocols.py,sha256=Thq4-_kfc4jvRbII_P87BbWq2AxA-SI2Sb3czPOoZLE,393
|
|
38
38
|
thds/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
39
|
thds/core/refcount.py,sha256=KWhF5vULrCUCJPoqh3X58JkbfYo8HmYpUrmCHjrUx64,4020
|
|
40
40
|
thds/core/scaling.py,sha256=f7CtdgK0sN6nroTq5hLAkG8xwbWhbCZUULstSKjoxO0,1615
|
|
41
41
|
thds/core/scope.py,sha256=9RWWCFRqsgjTyH6rzRm_WnO69N_sEBRaykarc2PAnBY,10834
|
|
42
42
|
thds/core/source_serde.py,sha256=X4c7LiT3VidejqtTel9YB6dWGB3x-ct39KF9E50Nbx4,139
|
|
43
|
-
thds/core/stack_context.py,sha256=
|
|
43
|
+
thds/core/stack_context.py,sha256=Lti4kCDYtTEtuwtXlkepfNPE-R2F2IYC4s16gqVmSOQ,1333
|
|
44
44
|
thds/core/thread_debug.py,sha256=ox0XmZQxkwoeIVyM6-BV4PNic5VbucJF3GhjkmaP5UQ,3240
|
|
45
45
|
thds/core/thunks.py,sha256=p1OvMBJ4VGMsD8BVA7zwPeAp0L3y_nxVozBF2E78t3M,1053
|
|
46
46
|
thds/core/timer.py,sha256=aOpNP-wHKaKs6ONK5fOtIOgx00FChVZquG4PeaEYH_k,5376
|
|
@@ -70,12 +70,12 @@ thds/core/sqlite/merge.py,sha256=NxettDMJ_mcrWfteQn_ERY7MUB5ETR-yJLKg7uvF6zA,377
|
|
|
70
70
|
thds/core/sqlite/meta.py,sha256=4P65PAmCjagHYO1Z6nWM-wkjEWv3hxw5qVa4cIpcH_8,5859
|
|
71
71
|
thds/core/sqlite/read.py,sha256=5pWvrbed3XNWgSy-79-8ONWkkt4jWbTzFNW6SnOrdYQ,2576
|
|
72
72
|
thds/core/sqlite/sqlmap.py,sha256=LeyiJtY0ww_mbeSp7LQM-YuWnckulQqropxwAfkt5To,6818
|
|
73
|
-
thds/core/sqlite/structured.py,sha256=
|
|
74
|
-
thds/core/sqlite/types.py,sha256=
|
|
73
|
+
thds/core/sqlite/structured.py,sha256=8t1B6XbM5NnudKEeBLsdjRVbSXXSr6iHOW0HwEAqtXU,4818
|
|
74
|
+
thds/core/sqlite/types.py,sha256=Zb1FtSAmC1L7QPPCV1eRnWpJuF74t9R293ai1SHtdS4,1292
|
|
75
75
|
thds/core/sqlite/upsert.py,sha256=BmKK6fsGVedt43iY-Lp7dnAu8aJ1e9CYlPVEQR2pMj4,5827
|
|
76
76
|
thds/core/sqlite/write.py,sha256=z0219vDkQDCnsV0WLvsj94keItr7H4j7Y_evbcoBrWU,3458
|
|
77
|
-
thds_core-1.45.
|
|
78
|
-
thds_core-1.45.
|
|
79
|
-
thds_core-1.45.
|
|
80
|
-
thds_core-1.45.
|
|
81
|
-
thds_core-1.45.
|
|
77
|
+
thds_core-1.45.20250902220316.dist-info/METADATA,sha256=GM8Im3fxxegEo_SfdqR7ILes-b90x6ybYtyJ7rqNlhs,2216
|
|
78
|
+
thds_core-1.45.20250902220316.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
79
|
+
thds_core-1.45.20250902220316.dist-info/entry_points.txt,sha256=bOCOVhKZv7azF3FvaWX6uxE6yrjK6FcjqhtxXvLiFY8,161
|
|
80
|
+
thds_core-1.45.20250902220316.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
|
|
81
|
+
thds_core-1.45.20250902220316.dist-info/RECORD,,
|
|
File without changes
|
{thds_core-1.45.20250828214748.dist-info → thds_core-1.45.20250902220316.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{thds_core-1.45.20250828214748.dist-info → thds_core-1.45.20250902220316.dist-info}/top_level.txt
RENAMED
|
File without changes
|