thread-order 1.2.4__tar.gz → 1.3.0__tar.gz
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.
- {thread_order-1.2.4/thread_order.egg-info → thread_order-1.3.0}/PKG-INFO +26 -2
- {thread_order-1.2.4 → thread_order-1.3.0}/README.md +24 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/pyproject.toml +1 -1
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order/__init__.py +1 -1
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order/cli/app.py +6 -10
- {thread_order-1.2.4 → thread_order-1.3.0/thread_order.egg-info}/PKG-INFO +26 -2
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order.egg-info/requires.txt +1 -1
- {thread_order-1.2.4 → thread_order-1.3.0}/LICENSE +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/setup.cfg +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/tests/test_graph.py +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/tests/test_init.py +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/tests/test_scheduler.py +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order/cli/__init__.py +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order/graph.py +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order/graph_summary.py +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order/logger.py +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order/scheduler.py +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order/timer.py +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order/ui/__init__.py +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order/ui/app.py +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order.egg-info/SOURCES.txt +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order.egg-info/dependency_links.txt +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order.egg-info/entry_points.txt +0 -0
- {thread_order-1.2.4 → thread_order-1.3.0}/thread_order.egg-info/top_level.txt +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: thread-order
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: A lightweight framework for running functions concurrently across multiple threads while maintaining a defined execution order.
|
|
5
5
|
Author-email: Emilio Reyes <soda480@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -34,7 +34,7 @@ Requires-Dist: mock; extra == "dev"
|
|
|
34
34
|
Requires-Dist: radon; extra == "dev"
|
|
35
35
|
Requires-Dist: bandit; extra == "dev"
|
|
36
36
|
Requires-Dist: coverage; extra == "dev"
|
|
37
|
-
Requires-Dist: coverage
|
|
37
|
+
Requires-Dist: genbadge[coverage]; extra == "dev"
|
|
38
38
|
Requires-Dist: twine; extra == "dev"
|
|
39
39
|
Provides-Extra: ui
|
|
40
40
|
Requires-Dist: ttkbootstrap>=1.20.1; extra == "ui"
|
|
@@ -218,6 +218,30 @@ These appear in `initial_state` and can be processed in your module’s `setup_s
|
|
|
218
218
|
|
|
219
219
|
This allows your module to compute initial state based on CLI parameters.
|
|
220
220
|
|
|
221
|
+
## Custom Logging
|
|
222
|
+
|
|
223
|
+
If a module defines a `setup_logging()` function, `tdrun` will automatically detect and invoke it during module initialization. This allows the module to configure its own logging behavior in a consistent and structured way while remaining compatible with the execution model.
|
|
224
|
+
|
|
225
|
+
```Python
|
|
226
|
+
def setup_logging(
|
|
227
|
+
workers, # Effective worker count resolved by CLI
|
|
228
|
+
verbose=False, # Enable verbose (debug-level) logging
|
|
229
|
+
add_stream_handler=False, # Attach console handler (disabled when progress/viewer active)
|
|
230
|
+
add_file_handler=False # Attach file handler when --log is enabled
|
|
231
|
+
):
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
At runtime, `tdrun` will invoke it as:
|
|
235
|
+
|
|
236
|
+
```Python
|
|
237
|
+
setup_logging(
|
|
238
|
+
args.workers, # effective workers
|
|
239
|
+
verbose=args.verbose,
|
|
240
|
+
add_stream_handler=not args.progress and not args.viewer,
|
|
241
|
+
add_file_handler=args.log,
|
|
242
|
+
)
|
|
243
|
+
```
|
|
244
|
+
|
|
221
245
|
### DAG Inspection
|
|
222
246
|
|
|
223
247
|
Use graph-only mode to inspect dependency structure:
|
|
@@ -176,6 +176,30 @@ These appear in `initial_state` and can be processed in your module’s `setup_s
|
|
|
176
176
|
|
|
177
177
|
This allows your module to compute initial state based on CLI parameters.
|
|
178
178
|
|
|
179
|
+
## Custom Logging
|
|
180
|
+
|
|
181
|
+
If a module defines a `setup_logging()` function, `tdrun` will automatically detect and invoke it during module initialization. This allows the module to configure its own logging behavior in a consistent and structured way while remaining compatible with the execution model.
|
|
182
|
+
|
|
183
|
+
```Python
|
|
184
|
+
def setup_logging(
|
|
185
|
+
workers, # Effective worker count resolved by CLI
|
|
186
|
+
verbose=False, # Enable verbose (debug-level) logging
|
|
187
|
+
add_stream_handler=False, # Attach console handler (disabled when progress/viewer active)
|
|
188
|
+
add_file_handler=False # Attach file handler when --log is enabled
|
|
189
|
+
):
|
|
190
|
+
```
|
|
191
|
+
|
|
192
|
+
At runtime, `tdrun` will invoke it as:
|
|
193
|
+
|
|
194
|
+
```Python
|
|
195
|
+
setup_logging(
|
|
196
|
+
args.workers, # effective workers
|
|
197
|
+
verbose=args.verbose,
|
|
198
|
+
add_stream_handler=not args.progress and not args.viewer,
|
|
199
|
+
add_file_handler=args.log,
|
|
200
|
+
)
|
|
201
|
+
```
|
|
202
|
+
|
|
179
203
|
### DAG Inspection
|
|
180
204
|
|
|
181
205
|
Use graph-only mode to inspect dependency structure:
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import re
|
|
2
1
|
import sys
|
|
3
2
|
import argparse
|
|
4
3
|
import json
|
|
@@ -147,20 +146,13 @@ def _setup_output(scheduler, args):
|
|
|
147
146
|
def on_task_done(name, thread_name, status, count, total):
|
|
148
147
|
_percent = int((count / total) * 100)
|
|
149
148
|
percent = f'{status.value} [{_percent:3d}% ]'
|
|
150
|
-
base = f'[{
|
|
151
|
-
if thread_name else name
|
|
149
|
+
base = f'[{thread_name}] {name}' if thread_name else name
|
|
152
150
|
dots = '.' * max(0, 75 - len(base) - len(percent))
|
|
153
151
|
logger.info(f'{base} {dots} {percent}')
|
|
154
152
|
|
|
155
153
|
scheduler.on_task_done(on_task_done, total)
|
|
156
154
|
return nullcontext()
|
|
157
155
|
|
|
158
|
-
def _pad_thread_name(name, workers):
|
|
159
|
-
""" pad thread name numbers with leading zeros for consistent width
|
|
160
|
-
"""
|
|
161
|
-
width = len(str(workers - 1))
|
|
162
|
-
return re.sub(r'(\d+)$', lambda m: m.group(1).zfill(width), name)
|
|
163
|
-
|
|
164
156
|
def _parse_tags_filter(tags):
|
|
165
157
|
""" parse comma-separated tag list into a normalized filter list
|
|
166
158
|
"""
|
|
@@ -187,7 +179,11 @@ def _build_scheduler_kwargs(args, initial_state, clear_results_on_start, module)
|
|
|
187
179
|
# prefer module-provided logging hook if available
|
|
188
180
|
setup_logging_function = getattr(module, 'setup_logging', None)
|
|
189
181
|
if callable(setup_logging_function):
|
|
190
|
-
setup_logging_function(
|
|
182
|
+
setup_logging_function(
|
|
183
|
+
args.effective_workers,
|
|
184
|
+
verbose=args.verbose,
|
|
185
|
+
add_stream_handler=not args.progress and not args.viewer,
|
|
186
|
+
add_file_handler=args.log)
|
|
191
187
|
else:
|
|
192
188
|
scheduler_kwargs['setup_logging'] = True
|
|
193
189
|
scheduler_kwargs['verbose'] = args.verbose
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: thread-order
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.3.0
|
|
4
4
|
Summary: A lightweight framework for running functions concurrently across multiple threads while maintaining a defined execution order.
|
|
5
5
|
Author-email: Emilio Reyes <soda480@gmail.com>
|
|
6
6
|
License-Expression: Apache-2.0
|
|
@@ -34,7 +34,7 @@ Requires-Dist: mock; extra == "dev"
|
|
|
34
34
|
Requires-Dist: radon; extra == "dev"
|
|
35
35
|
Requires-Dist: bandit; extra == "dev"
|
|
36
36
|
Requires-Dist: coverage; extra == "dev"
|
|
37
|
-
Requires-Dist: coverage
|
|
37
|
+
Requires-Dist: genbadge[coverage]; extra == "dev"
|
|
38
38
|
Requires-Dist: twine; extra == "dev"
|
|
39
39
|
Provides-Extra: ui
|
|
40
40
|
Requires-Dist: ttkbootstrap>=1.20.1; extra == "ui"
|
|
@@ -218,6 +218,30 @@ These appear in `initial_state` and can be processed in your module’s `setup_s
|
|
|
218
218
|
|
|
219
219
|
This allows your module to compute initial state based on CLI parameters.
|
|
220
220
|
|
|
221
|
+
## Custom Logging
|
|
222
|
+
|
|
223
|
+
If a module defines a `setup_logging()` function, `tdrun` will automatically detect and invoke it during module initialization. This allows the module to configure its own logging behavior in a consistent and structured way while remaining compatible with the execution model.
|
|
224
|
+
|
|
225
|
+
```Python
|
|
226
|
+
def setup_logging(
|
|
227
|
+
workers, # Effective worker count resolved by CLI
|
|
228
|
+
verbose=False, # Enable verbose (debug-level) logging
|
|
229
|
+
add_stream_handler=False, # Attach console handler (disabled when progress/viewer active)
|
|
230
|
+
add_file_handler=False # Attach file handler when --log is enabled
|
|
231
|
+
):
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
At runtime, `tdrun` will invoke it as:
|
|
235
|
+
|
|
236
|
+
```Python
|
|
237
|
+
setup_logging(
|
|
238
|
+
args.workers, # effective workers
|
|
239
|
+
verbose=args.verbose,
|
|
240
|
+
add_stream_handler=not args.progress and not args.viewer,
|
|
241
|
+
add_file_handler=args.log,
|
|
242
|
+
)
|
|
243
|
+
```
|
|
244
|
+
|
|
221
245
|
### DAG Inspection
|
|
222
246
|
|
|
223
247
|
Use graph-only mode to inspect dependency structure:
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|