fmtr.tools 1.1.21__py3-none-any.whl → 1.1.22__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 fmtr.tools might be problematic. Click here for more details.

fmtr/tools/setup_tools.py CHANGED
@@ -1,3 +1,4 @@
1
+ import sys
1
2
  from datetime import datetime
2
3
  from fnmatch import fnmatch
3
4
  from functools import cached_property
@@ -14,7 +15,7 @@ from fmtr.tools.path_tools.path_tools import FromCallerMixin
14
15
  class SetupPaths(FromCallerMixin):
15
16
  """
16
17
 
17
- Canonical paths for a package.
18
+ Canonical paths for a repo.
18
19
 
19
20
  """
20
21
 
@@ -89,6 +90,9 @@ class Setup(FromCallerMixin):
89
90
  AUTHOR = 'Frontmatter'
90
91
  AUTHOR_EMAIL = 'innovative.fowler@mask.pro.fmtr.dev'
91
92
 
93
+ REQUIREMENTS_ARG = 'requirements'
94
+
95
+
92
96
  def __init__(self, dependencies, paths=None, console_scripts=None, client=None, do_setup=True, **kwargs):
93
97
 
94
98
  self.kwargs = kwargs
@@ -97,6 +101,12 @@ class Setup(FromCallerMixin):
97
101
  dependencies = Dependencies(**dependencies)
98
102
  self.dependencies = dependencies
99
103
 
104
+ requirements_extras = self.get_requirements_extras()
105
+
106
+ if requirements_extras:
107
+ self.print_requirements()
108
+ return
109
+
100
110
  if not paths:
101
111
  paths = SetupPaths(path=self.from_caller())
102
112
  self.paths = paths
@@ -107,6 +117,25 @@ class Setup(FromCallerMixin):
107
117
  if do_setup:
108
118
  self.setup()
109
119
 
120
+ def get_requirements_extras(self):
121
+ if self.REQUIREMENTS_ARG not in sys.argv:
122
+ return None
123
+
124
+ extras_str = sys.argv[-1]
125
+ extras = extras_str.split(',')
126
+ return extras
127
+
128
+ def print_requirements(self):
129
+ reqs = []
130
+ reqs += self.dependencies.install
131
+
132
+ for extra in sys.argv[-1].split(','):
133
+ reqs += self.dependencies.extras[extra]
134
+ reqs = '\n'.join(reqs)
135
+ print(reqs)
136
+
137
+
138
+
110
139
  def get_entrypoint_path(self, key, value):
111
140
  if value:
112
141
  return f'{self.name}.{value}:{key}'
@@ -226,7 +255,7 @@ class Dependencies:
226
255
 
227
256
  return values_resolved
228
257
 
229
- @property
258
+ @cached_property
230
259
  def extras(self) -> Dict[str, List[str]]:
231
260
  """
232
261
 
@@ -238,7 +267,7 @@ class Dependencies:
238
267
  resolved[self.ALL] = list(set(chain.from_iterable(resolved.values())))
239
268
  return resolved
240
269
 
241
- @property
270
+ @cached_property
242
271
  def install(self):
243
272
  return self.resolve_values(self.INSTALL)
244
273
 
fmtr/tools/version CHANGED
@@ -1 +1 @@
1
- 1.1.21
1
+ 1.1.22
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: fmtr.tools
3
- Version: 1.1.21
3
+ Version: 1.1.22
4
4
  Summary: Collection of high-level tools to simplify everyday development tasks, with a focus on AI/ML
5
5
  Home-page: https://github.com/fmtr/fmtr.tools
6
6
  Author: Frontmatter
@@ -9,59 +9,59 @@ License: Copyright © 2025 Frontmatter. All rights reserved.
9
9
  Description-Content-Type: text/markdown
10
10
  License-File: LICENSE
11
11
  Provides-Extra: test
12
- Requires-Dist: tinynetrc; extra == "test"
13
- Requires-Dist: fastapi; extra == "test"
14
- Requires-Dist: httpx_retries; extra == "test"
15
- Requires-Dist: setuptools; extra == "test"
16
- Requires-Dist: filetype; extra == "test"
17
- Requires-Dist: faker; extra == "test"
18
- Requires-Dist: pydevd-pycharm; extra == "test"
19
- Requires-Dist: pyyaml; extra == "test"
20
- Requires-Dist: logfire[fastapi]; extra == "test"
21
- Requires-Dist: google-auth-httplib2; extra == "test"
22
- Requires-Dist: openai; extra == "test"
23
- Requires-Dist: diskcache; extra == "test"
24
- Requires-Dist: bokeh; extra == "test"
25
- Requires-Dist: sentence_transformers; extra == "test"
26
- Requires-Dist: pymupdf4llm; extra == "test"
27
- Requires-Dist: distributed; extra == "test"
28
- Requires-Dist: huggingface_hub; extra == "test"
29
- Requires-Dist: deepmerge; extra == "test"
30
- Requires-Dist: transformers[sentencepiece]; extra == "test"
31
12
  Requires-Dist: google-auth-oauthlib; extra == "test"
32
- Requires-Dist: logfire[httpx]; extra == "test"
13
+ Requires-Dist: google-auth-httplib2; extra == "test"
14
+ Requires-Dist: json_repair; extra == "test"
33
15
  Requires-Dist: pydantic; extra == "test"
16
+ Requires-Dist: docker; extra == "test"
17
+ Requires-Dist: httpx_retries; extra == "test"
18
+ Requires-Dist: bokeh; extra == "test"
34
19
  Requires-Dist: dask[bag]; extra == "test"
20
+ Requires-Dist: faker; extra == "test"
35
21
  Requires-Dist: Unidecode; extra == "test"
36
- Requires-Dist: docker; extra == "test"
37
- Requires-Dist: google-auth; extra == "test"
38
- Requires-Dist: contexttimer; extra == "test"
22
+ Requires-Dist: tokenizers; extra == "test"
23
+ Requires-Dist: sentence_transformers; extra == "test"
39
24
  Requires-Dist: peft; extra == "test"
40
- Requires-Dist: semver; extra == "test"
41
- Requires-Dist: regex; extra == "test"
42
- Requires-Dist: logfire; extra == "test"
43
- Requires-Dist: pytest-cov; extra == "test"
25
+ Requires-Dist: flet-webview; extra == "test"
44
26
  Requires-Dist: yamlscript; extra == "test"
45
- Requires-Dist: pandas; extra == "test"
27
+ Requires-Dist: dnspython[doh]; extra == "test"
28
+ Requires-Dist: flet[all]; extra == "test"
29
+ Requires-Dist: fastapi; extra == "test"
30
+ Requires-Dist: filetype; extra == "test"
31
+ Requires-Dist: pyyaml; extra == "test"
32
+ Requires-Dist: html2text; extra == "test"
46
33
  Requires-Dist: ollama; extra == "test"
34
+ Requires-Dist: transformers[sentencepiece]; extra == "test"
47
35
  Requires-Dist: openpyxl; extra == "test"
48
- Requires-Dist: appdirs; extra == "test"
49
- Requires-Dist: html2text; extra == "test"
50
- Requires-Dist: flet-video; extra == "test"
51
- Requires-Dist: flet[all]; extra == "test"
52
- Requires-Dist: google-api-python-client; extra == "test"
53
- Requires-Dist: dnspython[doh]; extra == "test"
54
- Requires-Dist: pymupdf; extra == "test"
55
- Requires-Dist: sre_yield; extra == "test"
56
- Requires-Dist: pydantic-settings; extra == "test"
36
+ Requires-Dist: logfire; extra == "test"
37
+ Requires-Dist: distributed; extra == "test"
38
+ Requires-Dist: deepmerge; extra == "test"
39
+ Requires-Dist: pydantic-ai[logfire,openai]; extra == "test"
40
+ Requires-Dist: diskcache; extra == "test"
41
+ Requires-Dist: pymupdf4llm; extra == "test"
42
+ Requires-Dist: pandas; extra == "test"
43
+ Requires-Dist: setuptools; extra == "test"
57
44
  Requires-Dist: tabulate; extra == "test"
58
- Requires-Dist: flet-webview; extra == "test"
45
+ Requires-Dist: pydantic-settings; extra == "test"
46
+ Requires-Dist: contexttimer; extra == "test"
59
47
  Requires-Dist: httpx; extra == "test"
60
- Requires-Dist: tokenizers; extra == "test"
48
+ Requires-Dist: sre_yield; extra == "test"
49
+ Requires-Dist: google-api-python-client; extra == "test"
50
+ Requires-Dist: openai; extra == "test"
51
+ Requires-Dist: appdirs; extra == "test"
52
+ Requires-Dist: logfire[httpx]; extra == "test"
53
+ Requires-Dist: google-auth; extra == "test"
54
+ Requires-Dist: pymupdf; extra == "test"
55
+ Requires-Dist: pydevd-pycharm; extra == "test"
56
+ Requires-Dist: tinynetrc; extra == "test"
57
+ Requires-Dist: logfire[fastapi]; extra == "test"
58
+ Requires-Dist: pytest-cov; extra == "test"
59
+ Requires-Dist: huggingface_hub; extra == "test"
61
60
  Requires-Dist: torchvision; extra == "test"
62
- Requires-Dist: json_repair; extra == "test"
63
- Requires-Dist: pydantic-ai[logfire,openai]; extra == "test"
64
61
  Requires-Dist: torchaudio; extra == "test"
62
+ Requires-Dist: semver; extra == "test"
63
+ Requires-Dist: regex; extra == "test"
64
+ Requires-Dist: flet-video; extra == "test"
65
65
  Requires-Dist: uvicorn[standard]; extra == "test"
66
66
  Provides-Extra: yaml
67
67
  Requires-Dist: yamlscript; extra == "yaml"
@@ -39,14 +39,14 @@ fmtr/tools/profiling_tools.py,sha256=jpXVjaNKPydTasEQVNXvxzGtMhXPit08AnJddkU8uIc
39
39
  fmtr/tools/random_tools.py,sha256=4VlQdk5THbR8ka4pZaLbk_ZO_4yy6PF_lHZes_rgenY,2223
40
40
  fmtr/tools/semantic_tools.py,sha256=cxY9NSAHWj4nEc6Oj4qA1omR3dWbl2OuH7_PkINc6_E,1386
41
41
  fmtr/tools/settings_tools.py,sha256=o11W3T60UZSvCTkh_eEQq1Mx74GycQ6JxUr0plBDbsk,2356
42
- fmtr/tools/setup_tools.py,sha256=uaT8Ejc2yBLATTHR_51vGIoU8yDOBgXLmFnxY5c23V4,7041
42
+ fmtr/tools/setup_tools.py,sha256=_mKoOAv2-vf2Y9HxjUkgblTDUfmWbMTNkOhJeaSN3SE,7712
43
43
  fmtr/tools/spaces_tools.py,sha256=D_he3mve6DruB3OPS6QyzqD05ChHnRTb4buViKPe7To,1099
44
44
  fmtr/tools/string_tools.py,sha256=mjO7NSqhtYMtnX7fKb8eXZ7MO2lXWGMl0kXxnZznupM,3764
45
45
  fmtr/tools/tabular_tools.py,sha256=tpIpZzYku1HcJrHZJL6BC39LmN3WUWVhFbK2N7nDVmE,120
46
46
  fmtr/tools/tokenization_tools.py,sha256=me-IBzSLyNYejLybwjO9CNB6Mj2NYfKPaOVThXyaGNg,4268
47
47
  fmtr/tools/tools.py,sha256=CAsApa1YwVdNE6H66Vjivs_mXYvOas3rh7fPELAnTpk,795
48
48
  fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
49
- fmtr/tools/version,sha256=Q9bVQ4J5J33dityoULiym-dEvZSY9uBJ10Hd83OP8yY,6
49
+ fmtr/tools/version,sha256=5sJzGyhKAQgHkvJs_DynT9WCkII9EsWuLE-qBuMX-s8,6
50
50
  fmtr/tools/version_tools.py,sha256=yNs_CGqWpqE4jbK9wsPIi14peJVXYbhIcMqHAFOw3yE,1480
51
51
  fmtr/tools/yaml_tools.py,sha256=9kuYChqJelWQIjGlSnK4iDdOWWH06P0gp9jIcRrC3UI,1903
52
52
  fmtr/tools/ai_tools/__init__.py,sha256=JZrLuOFNV1A3wvJgonxOgz_4WS-7MfCuowGWA5uYCjs,372
@@ -64,9 +64,9 @@ fmtr/tools/tests/test_environment.py,sha256=iHaiMQfECYZPkPKwfuIZV9uHuWe3aE-p_dN_
64
64
  fmtr/tools/tests/test_json.py,sha256=IeSP4ziPvRcmS8kq7k9tHonC9rN5YYq9GSNT2ul6Msk,287
65
65
  fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g,2188
66
66
  fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
67
- fmtr_tools-1.1.21.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
68
- fmtr_tools-1.1.21.dist-info/METADATA,sha256=-dnzZwvyXt4n6SBqztBZt1MAO_qWBXrbBvU6EMxUZ3s,15735
69
- fmtr_tools-1.1.21.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
- fmtr_tools-1.1.21.dist-info/entry_points.txt,sha256=e-eOW1Ml13tbxHC6Er1MnVOEDePeWw7DKwlE-l-gCY0,205
71
- fmtr_tools-1.1.21.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
72
- fmtr_tools-1.1.21.dist-info/RECORD,,
67
+ fmtr_tools-1.1.22.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
68
+ fmtr_tools-1.1.22.dist-info/METADATA,sha256=UPj-c1mI7NPzMe11YWIMkoXU8sR-7XaKKjnIY76Zjeg,15735
69
+ fmtr_tools-1.1.22.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
70
+ fmtr_tools-1.1.22.dist-info/entry_points.txt,sha256=e-eOW1Ml13tbxHC6Er1MnVOEDePeWw7DKwlE-l-gCY0,205
71
+ fmtr_tools-1.1.22.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
72
+ fmtr_tools-1.1.22.dist-info/RECORD,,