fmtr.tools 1.3.9__py3-none-any.whl → 1.3.10__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/__init__.py +19 -18
- fmtr/tools/api_tools.py +2 -2
- fmtr/tools/constants.py +4 -0
- fmtr/tools/environment_tools.py +1 -1
- fmtr/tools/logging_tools.py +12 -8
- fmtr/tools/version +1 -1
- fmtr/tools/version_tools/__init__.py +12 -0
- fmtr/tools/version_tools/version_tools.py +51 -0
- fmtr/tools/yaml_tools.py +1 -1
- {fmtr_tools-1.3.9.dist-info → fmtr_tools-1.3.10.dist-info}/METADATA +45 -50
- {fmtr_tools-1.3.9.dist-info → fmtr_tools-1.3.10.dist-info}/RECORD +15 -14
- fmtr/tools/version_tools.py +0 -62
- {fmtr_tools-1.3.9.dist-info → fmtr_tools-1.3.10.dist-info}/WHEEL +0 -0
- {fmtr_tools-1.3.9.dist-info → fmtr_tools-1.3.10.dist-info}/entry_points.txt +0 -0
- {fmtr_tools-1.3.9.dist-info → fmtr_tools-1.3.10.dist-info}/licenses/LICENSE +0 -0
- {fmtr_tools-1.3.9.dist-info → fmtr_tools-1.3.10.dist-info}/top_level.txt +0 -0
fmtr/tools/__init__.py
CHANGED
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
__version__ = version.read()
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import fmtr.tools.async_tools as asyncio
|
|
6
2
|
import fmtr.tools.dataclass_tools as dataclass
|
|
7
3
|
import fmtr.tools.datatype_tools as datatype
|
|
8
4
|
import fmtr.tools.environment_tools as env
|
|
@@ -12,26 +8,22 @@ import fmtr.tools.hash_tools as hash
|
|
|
12
8
|
import fmtr.tools.import_tools as import_
|
|
13
9
|
import fmtr.tools.iterator_tools as iterator
|
|
14
10
|
import fmtr.tools.json_tools as json
|
|
11
|
+
import fmtr.tools.logging_tools as logging
|
|
12
|
+
import fmtr.tools.name_tools as name
|
|
13
|
+
import fmtr.tools.packaging_tools as packaging
|
|
15
14
|
import fmtr.tools.path_tools as path
|
|
16
15
|
import fmtr.tools.platform_tools as platform
|
|
17
16
|
import fmtr.tools.random_tools as random
|
|
17
|
+
import fmtr.tools.setup_tools as setup
|
|
18
18
|
import fmtr.tools.string_tools as string
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
import fmtr.tools.packaging_tools as packaging
|
|
23
|
-
from fmtr.tools.logging_tools import logger
|
|
24
|
-
|
|
25
|
-
from fmtr.tools.import_tools import MissingExtraMockModule
|
|
26
|
-
|
|
19
|
+
from fmtr.tools import ai_tools as ai
|
|
20
|
+
from fmtr.tools import dns_tools as dns
|
|
21
|
+
from fmtr.tools import version_tools as version
|
|
27
22
|
from fmtr.tools.constants import Constants
|
|
28
|
-
|
|
23
|
+
from fmtr.tools.import_tools import MissingExtraMockModule
|
|
24
|
+
from fmtr.tools.logging_tools import logger
|
|
29
25
|
# Submodules
|
|
30
26
|
from fmtr.tools.path_tools import Path, PackagePaths, AppPaths
|
|
31
|
-
from fmtr.tools import ai_tools as ai
|
|
32
|
-
from fmtr.tools import dns_tools as dns
|
|
33
|
-
|
|
34
|
-
import fmtr.tools.setup_tools as setup
|
|
35
27
|
from fmtr.tools.setup_tools import Setup, SetupPaths, Dependencies, Tools
|
|
36
28
|
|
|
37
29
|
try:
|
|
@@ -178,3 +170,12 @@ try:
|
|
|
178
170
|
from fmtr.tools.http_tools import Client
|
|
179
171
|
except ImportError as exception:
|
|
180
172
|
http = Client = MissingExtraMockModule('http', exception)
|
|
173
|
+
|
|
174
|
+
|
|
175
|
+
def get_version():
|
|
176
|
+
"""
|
|
177
|
+
|
|
178
|
+
Defer reading version
|
|
179
|
+
|
|
180
|
+
"""
|
|
181
|
+
return version.read()
|
fmtr/tools/api_tools.py
CHANGED
|
@@ -3,7 +3,7 @@ from dataclasses import dataclass
|
|
|
3
3
|
from fastapi import FastAPI, Request
|
|
4
4
|
from typing import Callable, List, Optional, Union
|
|
5
5
|
|
|
6
|
-
from fmtr.tools
|
|
6
|
+
from fmtr.tools import environment_tools
|
|
7
7
|
from fmtr.tools.iterator_tools import enlist
|
|
8
8
|
from fmtr.tools.logging_tools import logger
|
|
9
9
|
|
|
@@ -57,7 +57,7 @@ class ApiBase:
|
|
|
57
57
|
for endpoint in self.get_endpoints():
|
|
58
58
|
self.add_endpoint(endpoint)
|
|
59
59
|
|
|
60
|
-
if
|
|
60
|
+
if environment_tools.IS_DEV:
|
|
61
61
|
self.app.exception_handler(Exception)(self.handle_exception)
|
|
62
62
|
|
|
63
63
|
def get_endpoints(self) -> List[Endpoint]:
|
fmtr/tools/constants.py
CHANGED
|
@@ -17,6 +17,7 @@ class Constants:
|
|
|
17
17
|
ARROW = '→'
|
|
18
18
|
ARROW_SEP = f' {ARROW} '
|
|
19
19
|
|
|
20
|
+
FMTR_DEV_KEY = 'FMTR_DEV'
|
|
20
21
|
FMTR_LOG_LEVEL_KEY = 'FMTR_LOG_LEVEL'
|
|
21
22
|
FMTR_OBS_API_KEY_KEY = 'FMTR_OBS_API_KEY'
|
|
22
23
|
FMTR_OBS_HOST = 'obs.sv.fmtr.dev'
|
|
@@ -43,3 +44,6 @@ class Constants:
|
|
|
43
44
|
ENTRYPOINTS_DIR = 'entrypoints'
|
|
44
45
|
PACKAGE_EXCLUDE_DIRS = {'data', 'build', 'dist', '.*', '*egg-info*'}
|
|
45
46
|
INIT_FILENAME = '__init__.py'
|
|
47
|
+
|
|
48
|
+
DEVELOPMENT = "development"
|
|
49
|
+
PRODUCTION = "production"
|
fmtr/tools/environment_tools.py
CHANGED
|
@@ -76,4 +76,4 @@ get_date = get_getter(date.fromisoformat)
|
|
|
76
76
|
get_datetime = get_getter(datetime.fromisoformat)
|
|
77
77
|
get_path = get_getter(Path)
|
|
78
78
|
|
|
79
|
-
|
|
79
|
+
IS_DEV = get_bool(Constants.FMTR_DEV_KEY, default=False)
|
fmtr/tools/logging_tools.py
CHANGED
|
@@ -4,23 +4,26 @@ import os
|
|
|
4
4
|
from fmtr.tools import environment_tools
|
|
5
5
|
from fmtr.tools.constants import Constants
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
if environment_tools.IS_DEV:
|
|
8
|
+
STREAM_DEFAULT = ENVIRONMENT_DEFAULT = Constants.DEVELOPMENT
|
|
9
|
+
else:
|
|
10
|
+
STREAM_DEFAULT = None
|
|
11
|
+
ENVIRONMENT_DEFAULT = Constants.PRODUCTION
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
IS_DEBUG = environment_tools.get(Constants.FMTR_LOG_LEVEL_KEY, None, converter=str.upper) == 'DEBUG'
|
|
14
|
+
LEVEL_DEFAULT = logging.DEBUG if IS_DEBUG else logging.INFO
|
|
13
15
|
|
|
14
16
|
|
|
15
17
|
def get_logger(name, version=None, host=Constants.FMTR_OBS_HOST, key=None, org=Constants.ORG_NAME,
|
|
16
|
-
stream=STREAM_DEFAULT,
|
|
17
|
-
environment=ENVIRONMENT_DEFAULT, level=LEVEL_DEFAULT):
|
|
18
|
+
stream=STREAM_DEFAULT, environment=ENVIRONMENT_DEFAULT, level=LEVEL_DEFAULT):
|
|
18
19
|
"""
|
|
19
20
|
|
|
20
21
|
Get a pre-configured logfire logger, if dependency is present, otherwise default to native logger.
|
|
21
22
|
|
|
22
23
|
"""
|
|
23
24
|
|
|
25
|
+
stream = stream or name
|
|
26
|
+
|
|
24
27
|
try:
|
|
25
28
|
import logfire
|
|
26
29
|
except ImportError:
|
|
@@ -65,7 +68,8 @@ def get_logger(name, version=None, host=Constants.FMTR_OBS_HOST, key=None, org=C
|
|
|
65
68
|
)
|
|
66
69
|
|
|
67
70
|
if key is None:
|
|
68
|
-
|
|
71
|
+
msg = f'Observability dependencies installed, but "{Constants.FMTR_OBS_API_KEY_KEY}" not set. Cloud observability will be disabled.'
|
|
72
|
+
logger.warning(msg)
|
|
69
73
|
|
|
70
74
|
return logger
|
|
71
75
|
|
fmtr/tools/version
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
1.3.
|
|
1
|
+
1.3.10
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
from fmtr.tools.import_tools import MissingExtraMockModule
|
|
2
|
+
|
|
3
|
+
from fmtr.tools.version_tools.version_tools import read, read_path, get
|
|
4
|
+
|
|
5
|
+
try:
|
|
6
|
+
import semver
|
|
7
|
+
|
|
8
|
+
semver = semver
|
|
9
|
+
parse = semver.VersionInfo.parse
|
|
10
|
+
|
|
11
|
+
except ImportError as exception:
|
|
12
|
+
semver = parse = MissingExtraMockModule('version.dev', exception)
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
from fmtr.tools import environment_tools as env
|
|
2
|
+
from fmtr.tools.constants import Constants
|
|
3
|
+
from fmtr.tools.inspection_tools import get_call_path
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
def read() -> str:
|
|
7
|
+
"""
|
|
8
|
+
|
|
9
|
+
Read a generic version file from the calling package path.
|
|
10
|
+
|
|
11
|
+
"""
|
|
12
|
+
|
|
13
|
+
path = get_call_path(offset=2).parent / Constants.FILENAME_VERSION
|
|
14
|
+
return read_path(path)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def read_path(path) -> str:
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
Read in version from specified path
|
|
21
|
+
|
|
22
|
+
"""
|
|
23
|
+
from fmtr.tools.tools import Constants
|
|
24
|
+
text = path.read_text(encoding=Constants.ENCODING).strip()
|
|
25
|
+
|
|
26
|
+
text = get(text)
|
|
27
|
+
return text
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
def get(text) -> str:
|
|
31
|
+
"""
|
|
32
|
+
|
|
33
|
+
Optionally add dev build info to raw version string.
|
|
34
|
+
|
|
35
|
+
"""
|
|
36
|
+
|
|
37
|
+
if not env.IS_DEV:
|
|
38
|
+
return text
|
|
39
|
+
|
|
40
|
+
import datetime
|
|
41
|
+
from fmtr.tools.tools import Constants
|
|
42
|
+
from fmtr.tools.version_tools import parse
|
|
43
|
+
|
|
44
|
+
timestamp = datetime.datetime.now(datetime.timezone.utc).strftime(Constants.DATETIME_SEMVER_BUILD_FORMAT)
|
|
45
|
+
|
|
46
|
+
version = parse(text)
|
|
47
|
+
version = version.bump_patch()
|
|
48
|
+
version = version.replace(prerelease=Constants.DEVELOPMENT, build=timestamp)
|
|
49
|
+
text = str(version)
|
|
50
|
+
|
|
51
|
+
return text
|
fmtr/tools/yaml_tools.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: fmtr.tools
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.10
|
|
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
|
|
@@ -15,7 +15,6 @@ Requires-Dist: yamlscript; extra == "yaml"
|
|
|
15
15
|
Requires-Dist: pyyaml; extra == "yaml"
|
|
16
16
|
Provides-Extra: logging
|
|
17
17
|
Requires-Dist: logfire; extra == "logging"
|
|
18
|
-
Requires-Dist: semver; extra == "logging"
|
|
19
18
|
Provides-Extra: parallel
|
|
20
19
|
Requires-Dist: dask[bag]; extra == "parallel"
|
|
21
20
|
Requires-Dist: distributed; extra == "parallel"
|
|
@@ -27,7 +26,6 @@ Requires-Dist: faker; extra == "augmentation"
|
|
|
27
26
|
Requires-Dist: sre_yield; extra == "augmentation"
|
|
28
27
|
Provides-Extra: process
|
|
29
28
|
Requires-Dist: logfire; extra == "process"
|
|
30
|
-
Requires-Dist: semver; extra == "process"
|
|
31
29
|
Provides-Extra: profiling
|
|
32
30
|
Requires-Dist: contexttimer; extra == "profiling"
|
|
33
31
|
Provides-Extra: docker-api
|
|
@@ -35,7 +33,8 @@ Requires-Dist: docker; extra == "docker-api"
|
|
|
35
33
|
Provides-Extra: unicode
|
|
36
34
|
Requires-Dist: Unidecode; extra == "unicode"
|
|
37
35
|
Provides-Extra: version
|
|
38
|
-
|
|
36
|
+
Provides-Extra: version-dev
|
|
37
|
+
Requires-Dist: semver; extra == "version-dev"
|
|
39
38
|
Provides-Extra: spaces
|
|
40
39
|
Requires-Dist: tinynetrc; extra == "spaces"
|
|
41
40
|
Provides-Extra: netrc
|
|
@@ -48,7 +47,6 @@ Provides-Extra: api
|
|
|
48
47
|
Requires-Dist: fastapi; extra == "api"
|
|
49
48
|
Requires-Dist: uvicorn[standard]; extra == "api"
|
|
50
49
|
Requires-Dist: logfire; extra == "api"
|
|
51
|
-
Requires-Dist: semver; extra == "api"
|
|
52
50
|
Requires-Dist: pydantic; extra == "api"
|
|
53
51
|
Requires-Dist: logfire[fastapi]; extra == "api"
|
|
54
52
|
Provides-Extra: ai
|
|
@@ -63,7 +61,6 @@ Provides-Extra: openai-api
|
|
|
63
61
|
Requires-Dist: openai; extra == "openai-api"
|
|
64
62
|
Provides-Extra: ai-client
|
|
65
63
|
Requires-Dist: logfire; extra == "ai-client"
|
|
66
|
-
Requires-Dist: semver; extra == "ai-client"
|
|
67
64
|
Requires-Dist: pydantic; extra == "ai-client"
|
|
68
65
|
Requires-Dist: openai; extra == "ai-client"
|
|
69
66
|
Requires-Dist: pydantic-ai[logfire,openai]; extra == "ai-client"
|
|
@@ -118,7 +115,6 @@ Requires-Dist: dnspython[doh]; extra == "dns"
|
|
|
118
115
|
Requires-Dist: httpx; extra == "dns"
|
|
119
116
|
Requires-Dist: httpx_retries; extra == "dns"
|
|
120
117
|
Requires-Dist: logfire; extra == "dns"
|
|
121
|
-
Requires-Dist: semver; extra == "dns"
|
|
122
118
|
Requires-Dist: logfire[httpx]; extra == "dns"
|
|
123
119
|
Provides-Extra: patterns
|
|
124
120
|
Requires-Dist: regex; extra == "patterns"
|
|
@@ -126,66 +122,65 @@ Provides-Extra: http
|
|
|
126
122
|
Requires-Dist: httpx; extra == "http"
|
|
127
123
|
Requires-Dist: httpx_retries; extra == "http"
|
|
128
124
|
Requires-Dist: logfire; extra == "http"
|
|
129
|
-
Requires-Dist: semver; extra == "http"
|
|
130
125
|
Requires-Dist: logfire[httpx]; extra == "http"
|
|
131
126
|
Provides-Extra: setup
|
|
132
127
|
Requires-Dist: setuptools; extra == "setup"
|
|
133
128
|
Provides-Extra: all
|
|
129
|
+
Requires-Dist: flet-video; extra == "all"
|
|
130
|
+
Requires-Dist: faker; extra == "all"
|
|
131
|
+
Requires-Dist: fastapi; extra == "all"
|
|
132
|
+
Requires-Dist: torchvision; extra == "all"
|
|
133
|
+
Requires-Dist: bokeh; extra == "all"
|
|
134
134
|
Requires-Dist: regex; extra == "all"
|
|
135
|
-
Requires-Dist:
|
|
136
|
-
Requires-Dist:
|
|
135
|
+
Requires-Dist: logfire; extra == "all"
|
|
136
|
+
Requires-Dist: google-auth; extra == "all"
|
|
137
|
+
Requires-Dist: html2text; extra == "all"
|
|
138
|
+
Requires-Dist: tokenizers; extra == "all"
|
|
139
|
+
Requires-Dist: sentence_transformers; extra == "all"
|
|
140
|
+
Requires-Dist: logfire[fastapi]; extra == "all"
|
|
141
|
+
Requires-Dist: peft; extra == "all"
|
|
142
|
+
Requires-Dist: cachetools; extra == "all"
|
|
137
143
|
Requires-Dist: pydantic-ai[logfire,openai]; extra == "all"
|
|
138
|
-
Requires-Dist:
|
|
139
|
-
Requires-Dist:
|
|
140
|
-
Requires-Dist: pymupdf4llm; extra == "all"
|
|
141
|
-
Requires-Dist: docker; extra == "all"
|
|
144
|
+
Requires-Dist: httpx; extra == "all"
|
|
145
|
+
Requires-Dist: contexttimer; extra == "all"
|
|
142
146
|
Requires-Dist: distributed; extra == "all"
|
|
143
|
-
Requires-Dist:
|
|
147
|
+
Requires-Dist: appdirs; extra == "all"
|
|
148
|
+
Requires-Dist: dask[bag]; extra == "all"
|
|
144
149
|
Requires-Dist: yamlscript; extra == "all"
|
|
145
|
-
Requires-Dist: faker; extra == "all"
|
|
146
150
|
Requires-Dist: uvicorn[standard]; extra == "all"
|
|
147
|
-
Requires-Dist:
|
|
148
|
-
Requires-Dist: tabulate; extra == "all"
|
|
149
|
-
Requires-Dist: cachetools; extra == "all"
|
|
151
|
+
Requires-Dist: openai; extra == "all"
|
|
150
152
|
Requires-Dist: pandas; extra == "all"
|
|
151
|
-
Requires-Dist:
|
|
152
|
-
Requires-Dist: httpx_retries; extra == "all"
|
|
153
|
+
Requires-Dist: pydantic; extra == "all"
|
|
153
154
|
Requires-Dist: deepmerge; extra == "all"
|
|
154
|
-
Requires-Dist:
|
|
155
|
-
Requires-Dist:
|
|
156
|
-
Requires-Dist:
|
|
155
|
+
Requires-Dist: dnspython[doh]; extra == "all"
|
|
156
|
+
Requires-Dist: openpyxl; extra == "all"
|
|
157
|
+
Requires-Dist: huggingface_hub; extra == "all"
|
|
157
158
|
Requires-Dist: flet-webview; extra == "all"
|
|
158
|
-
Requires-Dist:
|
|
159
|
+
Requires-Dist: pydevd-pycharm~=251.25410.159; extra == "all"
|
|
160
|
+
Requires-Dist: sre_yield; extra == "all"
|
|
161
|
+
Requires-Dist: tinynetrc; extra == "all"
|
|
162
|
+
Requires-Dist: pymupdf; extra == "all"
|
|
159
163
|
Requires-Dist: torchaudio; extra == "all"
|
|
160
|
-
Requires-Dist: filetype; extra == "all"
|
|
161
|
-
Requires-Dist: Unidecode; extra == "all"
|
|
162
|
-
Requires-Dist: pytest-cov; extra == "all"
|
|
163
|
-
Requires-Dist: openpyxl; extra == "all"
|
|
164
164
|
Requires-Dist: pydantic-settings; extra == "all"
|
|
165
|
+
Requires-Dist: filetype; extra == "all"
|
|
166
|
+
Requires-Dist: semver; extra == "all"
|
|
167
|
+
Requires-Dist: json_repair; extra == "all"
|
|
168
|
+
Requires-Dist: flet[all]; extra == "all"
|
|
169
|
+
Requires-Dist: diskcache; extra == "all"
|
|
165
170
|
Requires-Dist: logfire[httpx]; extra == "all"
|
|
166
|
-
Requires-Dist:
|
|
167
|
-
Requires-Dist:
|
|
168
|
-
Requires-Dist:
|
|
171
|
+
Requires-Dist: pytest-cov; extra == "all"
|
|
172
|
+
Requires-Dist: pyyaml; extra == "all"
|
|
173
|
+
Requires-Dist: docker; extra == "all"
|
|
174
|
+
Requires-Dist: Unidecode; extra == "all"
|
|
175
|
+
Requires-Dist: tabulate; extra == "all"
|
|
176
|
+
Requires-Dist: transformers[sentencepiece]; extra == "all"
|
|
169
177
|
Requires-Dist: google-api-python-client; extra == "all"
|
|
170
|
-
Requires-Dist:
|
|
171
|
-
Requires-Dist:
|
|
172
|
-
Requires-Dist: fastapi; extra == "all"
|
|
173
|
-
Requires-Dist: sentence_transformers; extra == "all"
|
|
174
|
-
Requires-Dist: sre_yield; extra == "all"
|
|
175
|
-
Requires-Dist: peft; extra == "all"
|
|
176
|
-
Requires-Dist: huggingface_hub; extra == "all"
|
|
177
|
-
Requires-Dist: json_repair; extra == "all"
|
|
178
|
-
Requires-Dist: appdirs; extra == "all"
|
|
179
|
-
Requires-Dist: setuptools; extra == "all"
|
|
180
|
-
Requires-Dist: pydantic; extra == "all"
|
|
181
|
-
Requires-Dist: semver; extra == "all"
|
|
182
|
-
Requires-Dist: pymupdf; extra == "all"
|
|
183
|
-
Requires-Dist: html2text; extra == "all"
|
|
184
|
-
Requires-Dist: tinynetrc; extra == "all"
|
|
185
|
-
Requires-Dist: google-auth; extra == "all"
|
|
178
|
+
Requires-Dist: httpx_retries; extra == "all"
|
|
179
|
+
Requires-Dist: google-auth-oauthlib; extra == "all"
|
|
186
180
|
Requires-Dist: google-auth-httplib2; extra == "all"
|
|
187
|
-
Requires-Dist:
|
|
188
|
-
Requires-Dist:
|
|
181
|
+
Requires-Dist: ollama; extra == "all"
|
|
182
|
+
Requires-Dist: setuptools; extra == "all"
|
|
183
|
+
Requires-Dist: pymupdf4llm; extra == "all"
|
|
189
184
|
Dynamic: author
|
|
190
185
|
Dynamic: author-email
|
|
191
186
|
Dynamic: description
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
fmtr/tools/__init__.py,sha256=
|
|
2
|
-
fmtr/tools/api_tools.py,sha256=
|
|
1
|
+
fmtr/tools/__init__.py,sha256=sjXo4eRDOPp20zlLpJqaB48h7RQXKJd_RwR3fwD6oGk,5731
|
|
2
|
+
fmtr/tools/api_tools.py,sha256=u2uEw-5OGN-eU4bNMC7ef5nmopVZTPyVN5eb_rr8ZS0,2140
|
|
3
3
|
fmtr/tools/async_tools.py,sha256=ewz757WcveQJd-G5SVr2JDOQVbdLGecCgl-tsBGVZz4,284
|
|
4
4
|
fmtr/tools/augmentation_tools.py,sha256=-6ESbO4CDlKqVOV1J1V6qBeoBMzbFIinkDHRHnCBej0,55
|
|
5
5
|
fmtr/tools/caching_tools.py,sha256=74p7m2GLFfeP41LX69wxgfkilxEAoWkMIfFMjKsYpyg,4976
|
|
6
|
-
fmtr/tools/constants.py,sha256=
|
|
6
|
+
fmtr/tools/constants.py,sha256=R6kyJOahQwwjBqmiD-c-4pMMAyGpffxZUSHMffkYmLI,1522
|
|
7
7
|
fmtr/tools/data_modelling_tools.py,sha256=0BFm-F_cYzVTxftWQwORkPd0FM2BTLVh9-s0-rTTFoo,1744
|
|
8
8
|
fmtr/tools/dataclass_tools.py,sha256=0Gt6KeLhtPgubo_2tYkIVqB8oQ91Qzag8OAGZDdjvMU,1209
|
|
9
9
|
fmtr/tools/datatype_tools.py,sha256=3P4AWIFGkJ-UqvXlj0Jc9IvkIIgTOE9jRrOk3NVbpH8,1508
|
|
10
10
|
fmtr/tools/debugging_tools.py,sha256=_xzqS0V5BpL8d06j-jVQjGgI7T020QsqVXKAKMz7Du8,2082
|
|
11
11
|
fmtr/tools/docker_tools.py,sha256=rdaZje2xhlmnfQqZnR7IHgRdWncTLjrJcViUTt5oEwk,617
|
|
12
|
-
fmtr/tools/environment_tools.py,sha256=
|
|
12
|
+
fmtr/tools/environment_tools.py,sha256=jlx6LYFVv9tyNBT_pVD-tDhyR3ccNC7w6ENVlnoxCLM,1823
|
|
13
13
|
fmtr/tools/function_tools.py,sha256=_oW3-HZXMst2pcU-I-U7KTMmzo0g9MIQKmX-c2_NEoE,858
|
|
14
14
|
fmtr/tools/google_api_tools.py,sha256=owWE0GlnJjmVbXus8ENxT2PH7Fnd3m_r-14xyR7lAnA,1107
|
|
15
15
|
fmtr/tools/hash_tools.py,sha256=tr4HXpeT6rRrDk6TvMlRPUSrLRRaov96y128OI2tzsc,729
|
|
@@ -22,7 +22,7 @@ fmtr/tools/interface_tools.py,sha256=JVYUV7wuMr24BORuUtNaBlTeBFt8VDGJ3HPRajd7Y_4
|
|
|
22
22
|
fmtr/tools/iterator_tools.py,sha256=xj5f0c7LgLK53dddRRRJxBoLaBzlZoQS3_GfmpDPMoo,1311
|
|
23
23
|
fmtr/tools/json_fix_tools.py,sha256=vNSlswVQnujPmKEqDjFJcO901mjMyv59q3awsT7mlhs,477
|
|
24
24
|
fmtr/tools/json_tools.py,sha256=WkFc5q7oqMtcFejhN1K5zQFULa9TdLOup83Fr0saDRY,348
|
|
25
|
-
fmtr/tools/logging_tools.py,sha256=
|
|
25
|
+
fmtr/tools/logging_tools.py,sha256=M7I5igs_tX5SIRv4f-jfb75LOODclSdmEg5ziAAMSPE,2503
|
|
26
26
|
fmtr/tools/merging_tools.py,sha256=KDxCEFJEQJEwGw1qGKAgR55uUE2X2S5NWLKcfHRmX_k,227
|
|
27
27
|
fmtr/tools/metric_tools.py,sha256=Lvia5CGFRIfrDFA8s37btIfTU5zHbo04cPJdAMtbndQ,272
|
|
28
28
|
fmtr/tools/name_tools.py,sha256=5CB_phqhHjl66iI8oLxOGPF2odC1apdul-M8Fv2xBhs,5514
|
|
@@ -44,9 +44,8 @@ fmtr/tools/tabular_tools.py,sha256=tpIpZzYku1HcJrHZJL6BC39LmN3WUWVhFbK2N7nDVmE,1
|
|
|
44
44
|
fmtr/tools/tokenization_tools.py,sha256=me-IBzSLyNYejLybwjO9CNB6Mj2NYfKPaOVThXyaGNg,4268
|
|
45
45
|
fmtr/tools/tools.py,sha256=CAsApa1YwVdNE6H66Vjivs_mXYvOas3rh7fPELAnTpk,795
|
|
46
46
|
fmtr/tools/unicode_tools.py,sha256=yS_9wpu8ogNoiIL7s1G_8bETFFO_YQlo4LNPv1NLDeY,52
|
|
47
|
-
fmtr/tools/version,sha256=
|
|
48
|
-
fmtr/tools/
|
|
49
|
-
fmtr/tools/yaml_tools.py,sha256=9kuYChqJelWQIjGlSnK4iDdOWWH06P0gp9jIcRrC3UI,1903
|
|
47
|
+
fmtr/tools/version,sha256=KXp_jTzlhrmPBGoDE8ZyMR8_fR2OLdfF-J8Z6JpyZHk,6
|
|
48
|
+
fmtr/tools/yaml_tools.py,sha256=Bhhyd6GQVKO72Lp8ky7bAUjIB_65Hdh0Q45SKIEe6S8,1901
|
|
50
49
|
fmtr/tools/ai_tools/__init__.py,sha256=JZrLuOFNV1A3wvJgonxOgz_4WS-7MfCuowGWA5uYCjs,372
|
|
51
50
|
fmtr/tools/ai_tools/agentic_tools.py,sha256=acSEPFS-aguDXanWGs3fAAlRyJSYPZW7L-Kb2qDLm-I,4300
|
|
52
51
|
fmtr/tools/ai_tools/inference_tools.py,sha256=2UP2gXEyOJUjyyV6zmFIYmIxUsh1rXkRH0IbFvr2bRs,11908
|
|
@@ -75,9 +74,11 @@ fmtr/tools/tests/test_environment.py,sha256=iHaiMQfECYZPkPKwfuIZV9uHuWe3aE-p_dN_
|
|
|
75
74
|
fmtr/tools/tests/test_json.py,sha256=IeSP4ziPvRcmS8kq7k9tHonC9rN5YYq9GSNT2ul6Msk,287
|
|
76
75
|
fmtr/tools/tests/test_path.py,sha256=AkZQa6_8BQ-VaCyL_J-iKmdf2ZaM-xFYR37Kun3k4_g,2188
|
|
77
76
|
fmtr/tools/tests/test_yaml.py,sha256=jc0TwwKu9eC0LvFGNMERdgBue591xwLxYXFbtsRwXVM,287
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
fmtr_tools-1.3.
|
|
81
|
-
fmtr_tools-1.3.
|
|
82
|
-
fmtr_tools-1.3.
|
|
83
|
-
fmtr_tools-1.3.
|
|
77
|
+
fmtr/tools/version_tools/__init__.py,sha256=pg4iLtmIr5HtyEW_j0fMFoIdzqi_w9xH8-grQaXLB28,318
|
|
78
|
+
fmtr/tools/version_tools/version_tools.py,sha256=Hcc6yferZS1hHbugRTdiHhSNmXEEG0hjCiTTXKna-YY,1127
|
|
79
|
+
fmtr_tools-1.3.10.dist-info/licenses/LICENSE,sha256=FW9aa6vVN5IjRQWLT43hs4_koYSmpcbIovlKeAJ0_cI,10757
|
|
80
|
+
fmtr_tools-1.3.10.dist-info/METADATA,sha256=9m1RZ98vJX10nSFr-cIsA7VaNfePzOTqRjyMj_jDv_o,15938
|
|
81
|
+
fmtr_tools-1.3.10.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
82
|
+
fmtr_tools-1.3.10.dist-info/entry_points.txt,sha256=h-r__Xh5njtFqreMLg6cGuTFS4Qh-QqJPU1HB-_BS-Q,357
|
|
83
|
+
fmtr_tools-1.3.10.dist-info/top_level.txt,sha256=LXem9xCgNOD72tE2gRKESdiQTL902mfFkwWb6-dlwEE,5
|
|
84
|
+
fmtr_tools-1.3.10.dist-info/RECORD,,
|
fmtr/tools/version_tools.py
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
from fmtr.tools.import_tools import MissingExtraMockModule
|
|
2
|
-
from fmtr.tools.inspection_tools import get_call_path
|
|
3
|
-
|
|
4
|
-
try:
|
|
5
|
-
import semver
|
|
6
|
-
|
|
7
|
-
semver = semver
|
|
8
|
-
parse = semver.VersionInfo.parse
|
|
9
|
-
except ImportError as exception:
|
|
10
|
-
# Special case to allow module import.
|
|
11
|
-
# Should be slit out into separate version.dev subpackage
|
|
12
|
-
parse = MissingExtraMockModule('version', exception)
|
|
13
|
-
semver = MissingExtraMockModule('version', exception)
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
def read() -> str:
|
|
17
|
-
"""
|
|
18
|
-
|
|
19
|
-
Read a generic version file from the calling package path.
|
|
20
|
-
|
|
21
|
-
"""
|
|
22
|
-
|
|
23
|
-
path = get_call_path(offset=2).parent / 'version'
|
|
24
|
-
return read_path(path)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
def read_path(path) -> str:
|
|
28
|
-
"""
|
|
29
|
-
|
|
30
|
-
Read in version from specified path
|
|
31
|
-
|
|
32
|
-
"""
|
|
33
|
-
from fmtr.tools.tools import Constants
|
|
34
|
-
text = path.read_text(encoding=Constants.ENCODING).strip()
|
|
35
|
-
|
|
36
|
-
text = get(text)
|
|
37
|
-
return text
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
def get(text) -> str:
|
|
41
|
-
"""
|
|
42
|
-
|
|
43
|
-
Optionally add dev build info to raw version string.
|
|
44
|
-
|
|
45
|
-
"""
|
|
46
|
-
import os
|
|
47
|
-
from fmtr.tools import datatype_tools
|
|
48
|
-
|
|
49
|
-
is_dev = datatype_tools.to_bool(os.getenv('FMTR_DEV', default=False))
|
|
50
|
-
|
|
51
|
-
if is_dev:
|
|
52
|
-
import datetime
|
|
53
|
-
from fmtr.tools.tools import Constants
|
|
54
|
-
|
|
55
|
-
timestamp = datetime.datetime.now(datetime.timezone.utc).strftime(Constants.DATETIME_SEMVER_BUILD_FORMAT)
|
|
56
|
-
|
|
57
|
-
version = parse(text)
|
|
58
|
-
version = version.bump_patch()
|
|
59
|
-
version = version.replace(prerelease='dev', build=timestamp)
|
|
60
|
-
text = str(version)
|
|
61
|
-
|
|
62
|
-
return text
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|