thds.core 1.41.20250702194312__py3-none-any.whl → 1.41.20250703020848__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.

@@ -0,0 +1,26 @@
1
+ from pathlib import Path
2
+
3
+
4
+ def _find_project_root(start: Path, anchor_file_name) -> Path:
5
+ """Try to find the project root path by traversing back from the starting path and finding the anchor file"""
6
+ project_root = start.resolve()
7
+
8
+ if not project_root.is_dir():
9
+ project_root = project_root.parent
10
+ while not (project_root / anchor_file_name).exists():
11
+ project_root = project_root.parent
12
+ if project_root == Path("/"):
13
+ raise ValueError("Unable to find project root")
14
+
15
+ return project_root
16
+
17
+
18
+ def find_project_root(start: Path, anchor_file_name: str = "pyproject.toml") -> Path:
19
+ """
20
+ Try to find the project root, identified as the first ancestor dir containing an "anchor" file.
21
+ If not found, return '/'.
22
+ """
23
+ try:
24
+ return _find_project_root(start, anchor_file_name)
25
+ except ValueError:
26
+ return Path("/")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: thds.core
3
- Version: 1.41.20250702194312
3
+ Version: 1.41.20250703020848
4
4
  Summary: Core utilities.
5
5
  Author-email: Trilliant Health <info@trillianthealth.com>
6
6
  License: MIT
@@ -31,6 +31,7 @@ thds/core/parallel.py,sha256=HXAn9aIYqNE5rnRN5ypxR6CUucdfzE5T5rJ_MUv-pFk,7590
31
31
  thds/core/pickle_visit.py,sha256=QNMWIi5buvk2zsvx1-D-FKL7tkrFUFDs387vxgGebgU,833
32
32
  thds/core/prof.py,sha256=5ViolfPsAPwUTHuhAe-bon7IArPGXydpGoB5uZmObDk,8264
33
33
  thds/core/progress.py,sha256=4YGbxliDl1i-k-88w4s86uy1E69eQ6xJySGPSkpH1QM,3358
34
+ thds/core/project_root.py,sha256=K18U3MLthZnzmdrWmKKtHLd6iu7am9b2vNAThqknpfo,891
34
35
  thds/core/protocols.py,sha256=4na2EeWUDWfLn5-SxfMmKegDSndJ5z-vwMhDavhCpEM,409
35
36
  thds/core/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
37
  thds/core/scaling.py,sha256=f7CtdgK0sN6nroTq5hLAkG8xwbWhbCZUULstSKjoxO0,1615
@@ -69,8 +70,8 @@ thds/core/sqlite/structured.py,sha256=SvZ67KcVcVdmpR52JSd52vMTW2ALUXmlHEeD-VrzWV
69
70
  thds/core/sqlite/types.py,sha256=oUkfoKRYNGDPZRk29s09rc9ha3SCk2SKr_K6WKebBFs,1308
70
71
  thds/core/sqlite/upsert.py,sha256=BmKK6fsGVedt43iY-Lp7dnAu8aJ1e9CYlPVEQR2pMj4,5827
71
72
  thds/core/sqlite/write.py,sha256=z0219vDkQDCnsV0WLvsj94keItr7H4j7Y_evbcoBrWU,3458
72
- thds_core-1.41.20250702194312.dist-info/METADATA,sha256=8IWkjAfNxxRdJ0UlQirpotjr7BxPU_MY7ArfrpJ3Jt8,2216
73
- thds_core-1.41.20250702194312.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
74
- thds_core-1.41.20250702194312.dist-info/entry_points.txt,sha256=bOCOVhKZv7azF3FvaWX6uxE6yrjK6FcjqhtxXvLiFY8,161
75
- thds_core-1.41.20250702194312.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
76
- thds_core-1.41.20250702194312.dist-info/RECORD,,
73
+ thds_core-1.41.20250703020848.dist-info/METADATA,sha256=eLsbync6teB85Tv_BzFaBOz8rEZxCZdCqr9nf1gpNLU,2216
74
+ thds_core-1.41.20250703020848.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
75
+ thds_core-1.41.20250703020848.dist-info/entry_points.txt,sha256=bOCOVhKZv7azF3FvaWX6uxE6yrjK6FcjqhtxXvLiFY8,161
76
+ thds_core-1.41.20250703020848.dist-info/top_level.txt,sha256=LTZaE5SkWJwv9bwOlMbIhiS-JWQEEIcjVYnJrt-CriY,5
77
+ thds_core-1.41.20250703020848.dist-info/RECORD,,