thds.mops 3.8.20250618170440__py3-none-any.whl → 3.8.20250619163729__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.mops might be problematic. Click here for more details.
- thds/mops/_utils/on_slow.py +1 -2
- thds/mops/k8s/launch.py +2 -2
- thds/mops/k8s/logging.py +1 -1
- thds/mops/k8s/wait_job.py +1 -1
- thds/mops/k8s/warn_image_backoff.py +1 -1
- thds/mops/k8s/watch.py +1 -1
- thds/mops/parallel.py +1 -2
- thds/mops/pure/core/memo/results.py +1 -1
- thds/mops/pure/core/pipeline_id.py +1 -2
- thds/mops/pure/pickling/_pickle.py +2 -4
- thds/mops/pure/runner/local.py +1 -1
- thds/mops/pure/tools/stress.py +1 -1
- {thds_mops-3.8.20250618170440.dist-info → thds_mops-3.8.20250619163729.dist-info}/METADATA +1 -1
- {thds_mops-3.8.20250618170440.dist-info → thds_mops-3.8.20250619163729.dist-info}/RECORD +17 -18
- thds/mops/_utils/colorize.py +0 -110
- {thds_mops-3.8.20250618170440.dist-info → thds_mops-3.8.20250619163729.dist-info}/WHEEL +0 -0
- {thds_mops-3.8.20250618170440.dist-info → thds_mops-3.8.20250619163729.dist-info}/entry_points.txt +0 -0
- {thds_mops-3.8.20250618170440.dist-info → thds_mops-3.8.20250619163729.dist-info}/top_level.txt +0 -0
thds/mops/_utils/on_slow.py
CHANGED
|
@@ -3,8 +3,7 @@ from functools import wraps
|
|
|
3
3
|
from timeit import default_timer
|
|
4
4
|
|
|
5
5
|
from thds.core import log
|
|
6
|
-
|
|
7
|
-
from .colorize import colorized, make_colorized_out
|
|
6
|
+
from thds.termtool.colorize import colorized, make_colorized_out
|
|
8
7
|
|
|
9
8
|
F = ty.TypeVar("F", bound=ty.Callable)
|
|
10
9
|
logger = log.getLogger(__name__)
|
thds/mops/k8s/launch.py
CHANGED
|
@@ -10,8 +10,8 @@ from kubernetes import client
|
|
|
10
10
|
from thds.core import scope
|
|
11
11
|
from thds.core.log import logger_context
|
|
12
12
|
from thds.mops.pure.runner.simple_shims import samethread_shim
|
|
13
|
+
from thds.termtool.colorize import colorized
|
|
13
14
|
|
|
14
|
-
from .._utils.colorize import colorized
|
|
15
15
|
from . import config
|
|
16
16
|
from ._shared import logger
|
|
17
17
|
from .auth import load_config, upsert_namespace
|
|
@@ -129,7 +129,7 @@ def launch(
|
|
|
129
129
|
|
|
130
130
|
logger.debug("Applying environment variables ...")
|
|
131
131
|
env_list = [
|
|
132
|
-
client.V1EnvVar(name="
|
|
132
|
+
client.V1EnvVar(name="MOPS_IMAGE_RECURSIVE_REF", value=container_image),
|
|
133
133
|
# by setting these, things will be 'reentrant' if it is necessary to launch jobs within this job.
|
|
134
134
|
]
|
|
135
135
|
if env_vars is not None:
|
thds/mops/k8s/logging.py
CHANGED
|
@@ -13,8 +13,8 @@ from kubernetes import client, watch
|
|
|
13
13
|
|
|
14
14
|
from thds import core
|
|
15
15
|
from thds.core.log import logger_context
|
|
16
|
+
from thds.termtool.colorize import colorized, make_colorized_out, next_color
|
|
16
17
|
|
|
17
|
-
from .._utils.colorize import colorized, make_colorized_out, next_color
|
|
18
18
|
from .._utils.locked_cache import locked_cached
|
|
19
19
|
from . import config
|
|
20
20
|
from ._shared import logger
|
thds/mops/k8s/wait_job.py
CHANGED
|
@@ -6,8 +6,8 @@ from timeit import default_timer
|
|
|
6
6
|
|
|
7
7
|
from thds.core import scope
|
|
8
8
|
from thds.core.log import logger_context
|
|
9
|
+
from thds.termtool.colorize import colorized
|
|
9
10
|
|
|
10
|
-
from .._utils.colorize import colorized
|
|
11
11
|
from . import config
|
|
12
12
|
from ._shared import logger
|
|
13
13
|
from .jobs import get_job, is_job_failed, is_job_succeeded
|
|
@@ -5,8 +5,8 @@ from datetime import datetime, timezone
|
|
|
5
5
|
from kubernetes import client
|
|
6
6
|
|
|
7
7
|
from thds.core.log import getLogger
|
|
8
|
+
from thds.termtool.colorize import colorized
|
|
8
9
|
|
|
9
|
-
from .._utils.colorize import colorized
|
|
10
10
|
from . import config
|
|
11
11
|
from .watch import K8sList, OneShotLimiter, yield_objects_from_list
|
|
12
12
|
|
thds/mops/k8s/watch.py
CHANGED
|
@@ -14,8 +14,8 @@ from kubernetes import watch as k8s_watch
|
|
|
14
14
|
|
|
15
15
|
from thds.core import scope
|
|
16
16
|
from thds.core.log import getLogger, logger_context
|
|
17
|
+
from thds.termtool.colorize import colorized
|
|
17
18
|
|
|
18
|
-
from .._utils.colorize import colorized
|
|
19
19
|
from . import config
|
|
20
20
|
from .auth import load_config
|
|
21
21
|
from .too_old_resource_version import parse_too_old_resource_version
|
thds/mops/parallel.py
CHANGED
|
@@ -10,8 +10,7 @@ from thds.core.thunks import ( # noqa: F401; for backward-compatibility, since
|
|
|
10
10
|
Thunk,
|
|
11
11
|
thunking,
|
|
12
12
|
)
|
|
13
|
-
|
|
14
|
-
from ._utils.colorize import colorized
|
|
13
|
+
from thds.termtool.colorize import colorized
|
|
15
14
|
|
|
16
15
|
ERROR = colorized(fg="white", bg="red")
|
|
17
16
|
DONE = colorized(fg="white", bg="blue")
|
|
@@ -8,8 +8,8 @@ import typing as ty
|
|
|
8
8
|
from contextlib import contextmanager
|
|
9
9
|
|
|
10
10
|
from thds.core import config, log, stack_context
|
|
11
|
+
from thds.termtool import colorize
|
|
11
12
|
|
|
12
|
-
from ...._utils import colorize
|
|
13
13
|
from ..uris import lookup_blob_store
|
|
14
14
|
|
|
15
15
|
_REQUIRE_ALL_RESULTS = config.item("require_all_results", default="")
|
|
@@ -6,8 +6,7 @@ from contextlib import contextmanager
|
|
|
6
6
|
from datetime import datetime
|
|
7
7
|
|
|
8
8
|
from thds.core import hostname, log, meta, stack_context
|
|
9
|
-
|
|
10
|
-
from ..._utils.colorize import colorized
|
|
9
|
+
from thds.termtool.colorize import colorized
|
|
11
10
|
|
|
12
11
|
# this is a global instead of a StackContext because we _do_ want it
|
|
13
12
|
# to spill over automatically into new threads.
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"""Utilities built around pickle for the purpose of transferring large amounts of on-disk
|
|
2
2
|
data and also functions."""
|
|
3
3
|
|
|
4
|
-
import inspect
|
|
5
4
|
import io
|
|
6
5
|
import os
|
|
7
6
|
import pickle
|
|
@@ -11,7 +10,7 @@ from functools import partial
|
|
|
11
10
|
# so we can pickle and re-raise exceptions with remote tracebacks
|
|
12
11
|
from tblib import pickling_support # type: ignore
|
|
13
12
|
|
|
14
|
-
from thds.core import hashing, log, source
|
|
13
|
+
from thds.core import hashing, inspect, log, source
|
|
15
14
|
|
|
16
15
|
from ..core import memo, metadata
|
|
17
16
|
from ..core.source import prepare_source_argument, prepare_source_result
|
|
@@ -131,8 +130,7 @@ def freeze_args_kwargs(dumper: Dumper, f: ty.Callable, args: Args, kwargs: Kwarg
|
|
|
131
130
|
|
|
132
131
|
Also binds default arguments, for maximum determinism/explicitness.
|
|
133
132
|
"""
|
|
134
|
-
bound_arguments = inspect.
|
|
135
|
-
bound_arguments.apply_defaults()
|
|
133
|
+
bound_arguments = inspect.bind_arguments(f, *args, **kwargs)
|
|
136
134
|
return gimme_bytes(dumper, (bound_arguments.args, bound_arguments.kwargs))
|
|
137
135
|
|
|
138
136
|
|
thds/mops/pure/runner/local.py
CHANGED
|
@@ -8,8 +8,8 @@ from datetime import datetime, timedelta, timezone
|
|
|
8
8
|
from pathlib import Path
|
|
9
9
|
|
|
10
10
|
from thds.core import config, log, scope
|
|
11
|
+
from thds.termtool.colorize import colorized, make_colorized_out
|
|
11
12
|
|
|
12
|
-
from ..._utils.colorize import colorized, make_colorized_out
|
|
13
13
|
from ...config import max_concurrent_network_ops
|
|
14
14
|
from ..core import deferred_work, lock, memo, metadata, pipeline_id_mask, uris
|
|
15
15
|
from ..core.partial import unwrap_partial
|
thds/mops/pure/tools/stress.py
CHANGED
|
@@ -5,10 +5,10 @@ from timeit import default_timer
|
|
|
5
5
|
|
|
6
6
|
from thds.adls import defaults
|
|
7
7
|
from thds.core.log import getLogger
|
|
8
|
-
from thds.mops._utils.colorize import colorized
|
|
9
8
|
from thds.mops.config import max_concurrent_network_ops
|
|
10
9
|
from thds.mops.parallel import Thunk, parallel_yield_results
|
|
11
10
|
from thds.mops.pure import MemoizingPicklingRunner, use_runner
|
|
11
|
+
from thds.termtool.colorize import colorized
|
|
12
12
|
|
|
13
13
|
BROWN = colorized(fg="brown", bg="black")
|
|
14
14
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: thds.mops
|
|
3
|
-
Version: 3.8.
|
|
3
|
+
Version: 3.8.20250619163729
|
|
4
4
|
Summary: ML Ops tools for Trilliant Health
|
|
5
5
|
Author-email: Trilliant Health <info@trillianthealth.com>
|
|
6
6
|
Project-URL: Repository, https://github.com/TrilliantHealth/ds-monorepo
|
|
@@ -2,15 +2,14 @@ thds/mops/__about__.py,sha256=IW_3wy8wEdrVducoBdiVgD7oYOY4J8yO1ezBaPtrc6U,215
|
|
|
2
2
|
thds/mops/__init__.py,sha256=dbujDxVVfHpWP7OyfjEdNVHLtKx99rsNQPYfjTKn5Lg,127
|
|
3
3
|
thds/mops/_compat.py,sha256=fO1YYEu6LF1re-VXl4P_8RXXLeKt4BgI9NTlHTgNpLk,357
|
|
4
4
|
thds/mops/config.py,sha256=T62YskXvzAfxNgpq2jMatHgoIHfRV_z4cvJ8Rl_TZ6E,2015
|
|
5
|
-
thds/mops/parallel.py,sha256=
|
|
5
|
+
thds/mops/parallel.py,sha256=ynzT7uEtF1sfUi7NS9fHg1I5EhQtSs3p5hNzP3xwAWE,931
|
|
6
6
|
thds/mops/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
7
7
|
thds/mops/_utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
thds/mops/_utils/colorize.py,sha256=RmygwyL7L_Ue218AQOBp57p4r97PWqTiA1-M5AFvV6Y,2506
|
|
9
8
|
thds/mops/_utils/config_tree.py,sha256=wMwkw81FDOo2Ld9rEmtobZMW2ZCUmxWSI2Bp_p0pwa8,7151
|
|
10
9
|
thds/mops/_utils/exception.py,sha256=Itj6ceieCdGrKZ2JdW_DIM88Wgvvw104cfbH1RNn6Go,394
|
|
11
10
|
thds/mops/_utils/locked_cache.py,sha256=ROIkwu-_FcXlNyCreWQeE5cyL9XrNW7drWsolTgeajM,2523
|
|
12
11
|
thds/mops/_utils/names.py,sha256=tPPaXCyduUXqmbdvIg3ygevERnKM3YIs868BeaKX5XY,824
|
|
13
|
-
thds/mops/_utils/on_slow.py,sha256=
|
|
12
|
+
thds/mops/_utils/on_slow.py,sha256=jtNvOiG3ICXCkq_hMCrqhL0gyyFnD9bZYzljDYA_yec,825
|
|
14
13
|
thds/mops/_utils/once.py,sha256=_LHkPbMJO4nqp0RIDj8VgIV3JoZYSQYKGdatdnT-19s,946
|
|
15
14
|
thds/mops/_utils/temp.py,sha256=pcHkqIPghPfcZcwAFjCIzLfUWdIgXD3XC8Au1dk5l1k,948
|
|
16
15
|
thds/mops/impure/__init__.py,sha256=VnrHPVgbOYUjkrVnnVicvNV39G6K6ENcWtCuV-BedW4,83
|
|
@@ -23,15 +22,15 @@ thds/mops/k8s/auth.py,sha256=mXFPZvyJYEPASsBatv1r8syB9AoayuHGptHHnNUg8LE,1517
|
|
|
23
22
|
thds/mops/k8s/config.py,sha256=ha8ppDeFnDB2I9tCajiDcfZlamIk73OJe4lzD5buyXU,2993
|
|
24
23
|
thds/mops/k8s/container_registry.py,sha256=qOiGCE4t_tLYgJDGrhKV9KNv48lF_AlwCDHyFgucd2s,539
|
|
25
24
|
thds/mops/k8s/jobs.py,sha256=3u0jc5Fnll2ncnmcdTUHlcxJ_KYNK9s66W7r6ez49As,3271
|
|
26
|
-
thds/mops/k8s/launch.py,sha256=
|
|
27
|
-
thds/mops/k8s/logging.py,sha256=
|
|
25
|
+
thds/mops/k8s/launch.py,sha256=EjLblGExh0paElOZWgevZdVzEZie1_4jQo7fKTrE1N0,10489
|
|
26
|
+
thds/mops/k8s/logging.py,sha256=m4XnhxzLqlZa2zOObFhp_zv3juQfqfwcCughChBqcCo,9773
|
|
28
27
|
thds/mops/k8s/namespace.py,sha256=Z6trVTU9WFashto4PqIhTcxu-foOF93W0TpgqCU7WIA,383
|
|
29
28
|
thds/mops/k8s/node_selection.py,sha256=Gy2Jz8IxZblg2LmtGg8-MtKI4RmXz2AMXqFPP8OQyu0,2065
|
|
30
29
|
thds/mops/k8s/retry.py,sha256=JVfP304kItpLs5nrONHE5UWkVWlrFGlV_oFQqhq3zHg,2846
|
|
31
30
|
thds/mops/k8s/too_old_resource_version.py,sha256=S7ltVA-LrxUpQ8Q__AB0nQmezN8Mmnx5oKK62_baAKI,1500
|
|
32
|
-
thds/mops/k8s/wait_job.py,sha256=
|
|
33
|
-
thds/mops/k8s/warn_image_backoff.py,sha256=
|
|
34
|
-
thds/mops/k8s/watch.py,sha256=
|
|
31
|
+
thds/mops/k8s/wait_job.py,sha256=_X5lSn-3CE4V-_ra0kF1WtxkAiOgqSom8mU1-0hhMio,2445
|
|
32
|
+
thds/mops/k8s/warn_image_backoff.py,sha256=ls_zLSnRbJjO4ICjq1Rk21EXh190l2dT6nKg-PT8Das,1934
|
|
33
|
+
thds/mops/k8s/watch.py,sha256=pLjyJg94QuDYV-CdoEJD7emkrYe5i5kDUTjtUsYSq4w,11425
|
|
35
34
|
thds/mops/k8s/tools/krsync.py,sha256=us7pXX0-bRMwD2oAno7Z6BJcPs6FgaUabHW0STyQJYg,1773
|
|
36
35
|
thds/mops/k8s/tools/krsync.sh,sha256=lskw4COt51Bv1yy2IAYUc8u8uQV-coSyUiOT8rADKkQ,546
|
|
37
36
|
thds/mops/pure/__init__.py,sha256=kbG0lMvXRBS3LGbb2gPPE9-qjYMXrypyb2tJX2__aZc,1533
|
|
@@ -50,7 +49,7 @@ thds/mops/pure/core/file_blob_store.py,sha256=N4m4LLrBZaqTJFR4D_eYl03a-n6yQBRsv0
|
|
|
50
49
|
thds/mops/pure/core/metadata.py,sha256=xAL2iz0pXrcKapmYnNrqSZ8nH2GVakA167NSpAfwiCI,8276
|
|
51
50
|
thds/mops/pure/core/output_naming.py,sha256=ntufOVNJiVPiUM-Azl9mFpDFhIxiB-V2je9dv9AUQhg,2283
|
|
52
51
|
thds/mops/pure/core/partial.py,sha256=aeNQFNHj9epU6lvk6NNTV6hXkNqNHN_czBydt7nkHmg,463
|
|
53
|
-
thds/mops/pure/core/pipeline_id.py,sha256=
|
|
52
|
+
thds/mops/pure/core/pipeline_id.py,sha256=LHGoIg0I3IM9_ZDyWjqOZp48PbfF_olKSzot22RMFI4,2543
|
|
54
53
|
thds/mops/pure/core/pipeline_id_mask.py,sha256=Ll2yyQM5nSgzihx8i7fCrrSNlUUnIsbAOb3m8bq0E2w,2791
|
|
55
54
|
thds/mops/pure/core/script_support.py,sha256=3j9Z1O5ynSSPmWSghtJgAj-Lt4GwYcA8cWcpUIRM7q0,952
|
|
56
55
|
thds/mops/pure/core/serialize_big_objs.py,sha256=YcOS1ccs82ZWO7nTbeumErMzYVe4hgXCTsfvMggYmd8,2332
|
|
@@ -76,20 +75,20 @@ thds/mops/pure/core/memo/calls.py,sha256=kvm6kn-CbOLxZuo86BvzEJw69p7VlEJ8_mCiWd6
|
|
|
76
75
|
thds/mops/pure/core/memo/function_memospace.py,sha256=PlQCs7dZ2Fu3gIjfzJMeOy7R5zPqYQDBp7OuViLqrpc,11644
|
|
77
76
|
thds/mops/pure/core/memo/keyfunc.py,sha256=FAOEDzMcQ-0JvW4j1eaUzixnemo_373V-16kWZl7_i0,2053
|
|
78
77
|
thds/mops/pure/core/memo/overwrite_params.py,sha256=ltuFxhr8gNo2iBoBz2eFPayjSV23gMdBuoLZD42lIAg,2425
|
|
79
|
-
thds/mops/pure/core/memo/results.py,sha256=
|
|
78
|
+
thds/mops/pure/core/memo/results.py,sha256=kaYJj542Ey5CQgiuCXVGVrKE6ZcdV5H9VD2OCSDi_38,3146
|
|
80
79
|
thds/mops/pure/core/memo/unique_name_for_function.py,sha256=NGuBmK9c-UdgQP27I-WLMRlCMWJmPSdMymRm14mT1K0,2331
|
|
81
80
|
thds/mops/pure/joblib/__init__.py,sha256=-3hSs-GsNzE_eNnwrdZBHAR_eaub5Uyl5GPYqBwEEPo,58
|
|
82
81
|
thds/mops/pure/joblib/backend.py,sha256=F__6lrdc1-VcX4n4Pw7Lz1bBgeefShtRy2DQh6Fp-eI,2671
|
|
83
82
|
thds/mops/pure/joblib/batching.py,sha256=tPOATD28-YW7KcWa3IqKm-fhLaILzM792ApvU-_zfnM,2298
|
|
84
83
|
thds/mops/pure/pickling/__init__.py,sha256=WNdG8PdJCk-kYaXkvvPa--hjYGoUlBXG3w2X86yuhGo,156
|
|
85
|
-
thds/mops/pure/pickling/_pickle.py,sha256=
|
|
84
|
+
thds/mops/pure/pickling/_pickle.py,sha256=kZc70_yvEAmIsTjOJuwW8ZpExTL7icAWgGskZF5GSfI,9000
|
|
86
85
|
thds/mops/pure/pickling/memoize_only.py,sha256=oI5CMy6IEJc46Gb_BGWNUuAe3fysS7HxRSTajN0WssI,837
|
|
87
86
|
thds/mops/pure/pickling/mprunner.py,sha256=dVbwQA8hzEL7UiwYXmzoGwN3_jbEtGoHDPMkRmo_UtA,8378
|
|
88
87
|
thds/mops/pure/pickling/pickles.py,sha256=nCg7L7CqReNWDF8FAdEmCcuXVC_kLT5zuyW3V8Vvvs4,4704
|
|
89
88
|
thds/mops/pure/pickling/remote.py,sha256=SynT9gVE3D2G2KO9oROa1iopMXxCXprP6_A3xl2IEJ4,5921
|
|
90
89
|
thds/mops/pure/pickling/sha256_b64.py,sha256=HL0cPixHPZYuZDVDBscxsnI-3a2amWEfw-LseOX-PyY,2916
|
|
91
90
|
thds/mops/pure/runner/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
92
|
-
thds/mops/pure/runner/local.py,sha256=
|
|
91
|
+
thds/mops/pure/runner/local.py,sha256=qdAfQVMS5EtZjjrvHfHjiXAQMoVOCxD2rzWdvc2aNbw,12004
|
|
93
92
|
thds/mops/pure/runner/shim_builder.py,sha256=DkOXbPaOWPj2uUsJhjlWmh8ijG9OQc4ciHqa-vHPfXw,709
|
|
94
93
|
thds/mops/pure/runner/simple_shims.py,sha256=oJ8sC5EVD-JFZx8CYE3_QwaQTuFa5F3IYH5PJ9mdMtY,702
|
|
95
94
|
thds/mops/pure/runner/strings.py,sha256=PYAYMxZ2ehgahKIBXJilENNE6OrdNkueNBel8LPsoh8,26
|
|
@@ -99,14 +98,14 @@ thds/mops/pure/tools/_pickle_dis.py,sha256=EyLgWP_dRzz1HIabGRTEGZFT_LZV5gmn4asJy
|
|
|
99
98
|
thds/mops/pure/tools/history.py,sha256=dB7C2jq-0P3Fnv5Q3nzEkLehXdX0kaZZrGl1U1ns9DU,1048
|
|
100
99
|
thds/mops/pure/tools/inspect.py,sha256=PYXmR9-ATB3UsJUDG5Up8B6mdfenOGx2nktjw3sxMX8,13957
|
|
101
100
|
thds/mops/pure/tools/sha256_b64_addressed.py,sha256=SECAiw3xSqpsrBBZix0MgJRTQrbHiUk2oFHYa7ln3q4,1137
|
|
102
|
-
thds/mops/pure/tools/stress.py,sha256=
|
|
101
|
+
thds/mops/pure/tools/stress.py,sha256=N7C8kLpaGbImeEYlT5jsEl1metvsUu8cnfyQ8vFN0H8,2541
|
|
103
102
|
thds/mops/pure/tools/summarize/__init__.py,sha256=MSmt_5Xg84uHqzTN38JwgseJK8rsJn_11A8WD99VtEo,61
|
|
104
103
|
thds/mops/pure/tools/summarize/cli.py,sha256=7kDtn24ok8oBO3jFjlMmOK3jnZYpMoE_5Y8fmDH8Imc,11524
|
|
105
104
|
thds/mops/pure/tools/summarize/run_summary.py,sha256=LUtvbankAYbss2NCF_XbNl05jkNgxYz_SLyERJlp4sk,5773
|
|
106
105
|
thds/mops/testing/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
107
106
|
thds/mops/testing/deferred_imports.py,sha256=f0ezCgQAtzTqW1yAOb0OWgsB9ZrlztLB894LtpWDaVw,3780
|
|
108
|
-
thds_mops-3.8.
|
|
109
|
-
thds_mops-3.8.
|
|
110
|
-
thds_mops-3.8.
|
|
111
|
-
thds_mops-3.8.
|
|
112
|
-
thds_mops-3.8.
|
|
107
|
+
thds_mops-3.8.20250619163729.dist-info/METADATA,sha256=ZYoZZ_ymu42iPBG97b9WW0Q6wPFhA05MkmQ8VkCwO5I,2225
|
|
108
|
+
thds_mops-3.8.20250619163729.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
109
|
+
thds_mops-3.8.20250619163729.dist-info/entry_points.txt,sha256=qKvCAaB80syXfxVR3xx6x9J0YJdaQWkIbVSw-NwFgMw,322
|
|
110
|
+
thds_mops-3.8.20250619163729.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
|
|
111
|
+
thds_mops-3.8.20250619163729.dist-info/RECORD,,
|
thds/mops/_utils/colorize.py
DELETED
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import itertools
|
|
2
|
-
import random
|
|
3
|
-
import typing as ty
|
|
4
|
-
from functools import partial
|
|
5
|
-
|
|
6
|
-
from colors import color, csscolors
|
|
7
|
-
|
|
8
|
-
pref = "\033["
|
|
9
|
-
reset = f"{pref}0m"
|
|
10
|
-
|
|
11
|
-
_RESERVED_COLORS = [
|
|
12
|
-
"black",
|
|
13
|
-
# Various whitish-looking colors
|
|
14
|
-
"aliceblue",
|
|
15
|
-
"antiquewhite",
|
|
16
|
-
"floralwhite",
|
|
17
|
-
"ghostwhite",
|
|
18
|
-
"ivory",
|
|
19
|
-
"white",
|
|
20
|
-
"whitesmoke",
|
|
21
|
-
"snow",
|
|
22
|
-
"seashell",
|
|
23
|
-
"mintcream",
|
|
24
|
-
"honeydew",
|
|
25
|
-
"azure",
|
|
26
|
-
"beige",
|
|
27
|
-
"cornsilk",
|
|
28
|
-
"floralwhite",
|
|
29
|
-
# These are pretty illegible on a black background
|
|
30
|
-
"darkblue",
|
|
31
|
-
"indigo",
|
|
32
|
-
"mediumblue",
|
|
33
|
-
"navy",
|
|
34
|
-
"purple",
|
|
35
|
-
]
|
|
36
|
-
|
|
37
|
-
_PREFERRED_COLORS = [
|
|
38
|
-
"mediumseagreen",
|
|
39
|
-
"cornflowerblue",
|
|
40
|
-
"gold",
|
|
41
|
-
"salmon",
|
|
42
|
-
"violet",
|
|
43
|
-
"limegreen",
|
|
44
|
-
"dodgerblue",
|
|
45
|
-
"goldenrod",
|
|
46
|
-
"indianred",
|
|
47
|
-
"fuchsia",
|
|
48
|
-
"forestgreen",
|
|
49
|
-
"royalblue",
|
|
50
|
-
"yellow",
|
|
51
|
-
"chocolate",
|
|
52
|
-
"palevioletred",
|
|
53
|
-
"mediumspringgreen",
|
|
54
|
-
"deepskyblue",
|
|
55
|
-
"khaki",
|
|
56
|
-
"red",
|
|
57
|
-
"deeppink",
|
|
58
|
-
"seagreen",
|
|
59
|
-
"cyan",
|
|
60
|
-
"greenyellow",
|
|
61
|
-
"sandybrown",
|
|
62
|
-
"orchid",
|
|
63
|
-
"lightgreen",
|
|
64
|
-
"steelblue",
|
|
65
|
-
"darkgoldenrod",
|
|
66
|
-
"coral",
|
|
67
|
-
"darkorchid",
|
|
68
|
-
]
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
def _start_from(color_list: ty.List[str], index: int) -> ty.List[str]:
|
|
72
|
-
return color_list[index:] + color_list[:index]
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
def _preferred_randgreen_start() -> ty.List[str]:
|
|
76
|
-
return _start_from(_PREFERRED_COLORS, random.randint(0, 6) * 5)
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
def _all_colors() -> ty.List[str]:
|
|
80
|
-
forbidden_colors = {csscolors.css_colors[name] for name in _RESERVED_COLORS}
|
|
81
|
-
used_colors = {csscolors.css_colors[name] for name in _PREFERRED_COLORS}
|
|
82
|
-
assert len(used_colors) == len(_PREFERRED_COLORS) # assert no RGB dupes in the preferred list
|
|
83
|
-
all_colors = list(csscolors.css_colors.items())
|
|
84
|
-
random.shuffle(all_colors)
|
|
85
|
-
return _preferred_randgreen_start() + [
|
|
86
|
-
name
|
|
87
|
-
for name, rgb in all_colors
|
|
88
|
-
if rgb not in used_colors
|
|
89
|
-
and not used_colors.add(rgb) # type: ignore
|
|
90
|
-
and rgb not in forbidden_colors
|
|
91
|
-
]
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
next_color = ty.cast(ty.Callable[[], str], partial(next, itertools.cycle(_all_colors())))
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
def colorized(fg: str, bg: str = "", style: str = "") -> ty.Callable[[str], str]:
|
|
98
|
-
def colorize(s: str) -> str:
|
|
99
|
-
return color(s, fg=fg, bg=bg, style=style)
|
|
100
|
-
|
|
101
|
-
return colorize
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
def make_colorized_out(
|
|
105
|
-
colorized: ty.Callable[[str], str], *, fmt_str: str = "{}", out: ty.Callable[[str], ty.Any] = print
|
|
106
|
-
) -> ty.Callable[[str], None]:
|
|
107
|
-
def _out(s: str) -> None:
|
|
108
|
-
out(colorized(fmt_str.format(s)))
|
|
109
|
-
|
|
110
|
-
return _out
|
|
File without changes
|
{thds_mops-3.8.20250618170440.dist-info → thds_mops-3.8.20250619163729.dist-info}/entry_points.txt
RENAMED
|
File without changes
|
{thds_mops-3.8.20250618170440.dist-info → thds_mops-3.8.20250619163729.dist-info}/top_level.txt
RENAMED
|
File without changes
|