stouputils 1.13.3__py3-none-any.whl → 1.14.1__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.
- stouputils/applications/automatic_docs.py +3 -0
- stouputils/parallel.py +13 -10
- stouputils/stouputils/parallel.pyi +4 -4
- {stouputils-1.13.3.dist-info → stouputils-1.14.1.dist-info}/METADATA +1 -1
- {stouputils-1.13.3.dist-info → stouputils-1.14.1.dist-info}/RECORD +7 -7
- {stouputils-1.13.3.dist-info → stouputils-1.14.1.dist-info}/WHEEL +0 -0
- {stouputils-1.13.3.dist-info → stouputils-1.14.1.dist-info}/entry_points.txt +0 -0
|
@@ -286,6 +286,7 @@ def get_versions_from_github(github_user: str, github_repo: str, recent_minor_ve
|
|
|
286
286
|
if d["type"] == "dir" and d["name"].startswith("v")
|
|
287
287
|
], key=version_to_float, reverse=True
|
|
288
288
|
)
|
|
289
|
+
info(f"Found versions from GitHub: {all_versions}")
|
|
289
290
|
|
|
290
291
|
# Group versions by major.minor
|
|
291
292
|
from collections import defaultdict
|
|
@@ -295,9 +296,11 @@ def get_versions_from_github(github_user: str, github_repo: str, recent_minor_ve
|
|
|
295
296
|
if len(parts) >= 2:
|
|
296
297
|
minor_key = f"{parts[0]}.{parts[1]}"
|
|
297
298
|
minor_versions[minor_key].append(version)
|
|
299
|
+
info(f"Grouped minor versions: {dict(minor_versions)}")
|
|
298
300
|
|
|
299
301
|
# Get the sorted minor version keys
|
|
300
302
|
sorted_minors = sorted(minor_versions.keys(), key=version_to_float, reverse=True)
|
|
303
|
+
info(f"Sorted minor versions: {sorted_minors}")
|
|
301
304
|
|
|
302
305
|
# Build final version list
|
|
303
306
|
final_versions: list[str] = []
|
stouputils/parallel.py
CHANGED
|
@@ -335,8 +335,8 @@ def run_in_subprocess[R](
|
|
|
335
335
|
import multiprocessing as mp
|
|
336
336
|
from multiprocessing import Queue
|
|
337
337
|
|
|
338
|
-
# Create a queue to get the result from the subprocess
|
|
339
|
-
result_queue: Queue[R | Exception] = Queue()
|
|
338
|
+
# Create a queue to get the result from the subprocess (only if we need to wait)
|
|
339
|
+
result_queue: Queue[R | Exception] | None = None if no_join else Queue()
|
|
340
340
|
|
|
341
341
|
# Create and start the subprocess using the module-level wrapper
|
|
342
342
|
process: mp.Process = mp.Process(
|
|
@@ -345,8 +345,9 @@ def run_in_subprocess[R](
|
|
|
345
345
|
)
|
|
346
346
|
process.start()
|
|
347
347
|
|
|
348
|
-
#
|
|
349
|
-
if
|
|
348
|
+
# Detach process if no_join (fire-and-forget)
|
|
349
|
+
if result_queue is None:
|
|
350
|
+
process.close() # Detach the process
|
|
350
351
|
return None # type: ignore
|
|
351
352
|
process.join(timeout=timeout)
|
|
352
353
|
|
|
@@ -394,16 +395,18 @@ def _subprocess_wrapper[R](
|
|
|
394
395
|
Must be at module level to be pickable on Windows (spawn context).
|
|
395
396
|
|
|
396
397
|
Args:
|
|
397
|
-
result_queue (multiprocessing.Queue): Queue to store the result or exception.
|
|
398
|
-
func (Callable):
|
|
399
|
-
args (tuple):
|
|
400
|
-
kwargs (dict):
|
|
398
|
+
result_queue (multiprocessing.Queue | None): Queue to store the result or exception (None if detached).
|
|
399
|
+
func (Callable): The target function to execute.
|
|
400
|
+
args (tuple): Positional arguments for the function.
|
|
401
|
+
kwargs (dict): Keyword arguments for the function.
|
|
401
402
|
"""
|
|
402
403
|
try:
|
|
403
404
|
result: R = func(*args, **kwargs)
|
|
404
|
-
result_queue
|
|
405
|
+
if result_queue is not None:
|
|
406
|
+
result_queue.put(result)
|
|
405
407
|
except Exception as e:
|
|
406
|
-
result_queue
|
|
408
|
+
if result_queue is not None:
|
|
409
|
+
result_queue.put(e)
|
|
407
410
|
|
|
408
411
|
# "Private" function to use starmap
|
|
409
412
|
def _starmap[T, R](args: tuple[Callable[[T], R], list[T]]) -> R:
|
|
@@ -175,10 +175,10 @@ def _subprocess_wrapper[R](result_queue: Any, func: Callable[..., R], args: tupl
|
|
|
175
175
|
\tMust be at module level to be pickable on Windows (spawn context).
|
|
176
176
|
|
|
177
177
|
\tArgs:
|
|
178
|
-
\t\tresult_queue (multiprocessing.Queue): Queue to store the result or exception.
|
|
179
|
-
\t\tfunc (Callable):
|
|
180
|
-
\t\targs (tuple):
|
|
181
|
-
\t\tkwargs (dict):
|
|
178
|
+
\t\tresult_queue (multiprocessing.Queue | None): Queue to store the result or exception (None if detached).
|
|
179
|
+
\t\tfunc (Callable): The target function to execute.
|
|
180
|
+
\t\targs (tuple): Positional arguments for the function.
|
|
181
|
+
\t\tkwargs (dict): Keyword arguments for the function.
|
|
182
182
|
\t"""
|
|
183
183
|
def _starmap[T, R](args: tuple[Callable[[T], R], list[T]]) -> R:
|
|
184
184
|
""" Private function to use starmap using args[0](\\*args[1])
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: stouputils
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.14.1
|
|
4
4
|
Summary: Stouputils is a collection of utility modules designed to simplify and enhance the development process. It includes a range of tools for tasks such as execution of doctests, display utilities, decorators, as well as context managers, and many more.
|
|
5
5
|
Keywords: utilities,tools,helpers,development,python
|
|
6
6
|
Author: Stoupy51
|
|
@@ -7,7 +7,7 @@ stouputils/all_doctests.py,sha256=1bGGUg80nvLBY3wrPkFrkcuQRjFTWmTpHZtai9X-vnY,58
|
|
|
7
7
|
stouputils/all_doctests.pyi,sha256=8JD8qn7neYuR0PolabWxX6id1dNEvQDrvOhMS2aYhTM,1907
|
|
8
8
|
stouputils/applications/__init__.py,sha256=dbjwZt8PZF043KoJSItqCpH32FtRxN5sgV-8Q2b1l10,457
|
|
9
9
|
stouputils/applications/__init__.pyi,sha256=DTYq2Uqq1uLzCMkFByjRqdtREA-9SaQnp4QpgmCEPFg,56
|
|
10
|
-
stouputils/applications/automatic_docs.py,sha256=
|
|
10
|
+
stouputils/applications/automatic_docs.py,sha256=_6XbCuVi2EiSdkiPZ7XHr5mUGh2ZORev8Vd0tJDb0ug,20561
|
|
11
11
|
stouputils/applications/automatic_docs.pyi,sha256=sfFXpVE5y5Z907HEjKzpZ_9zM34d-jKNDQCdMx7E-9s,6189
|
|
12
12
|
stouputils/applications/upscaler/__init__.py,sha256=8vrca93OYu5GQJrZO1GvnAbptzyhu_L0DnP3M9unlA0,1142
|
|
13
13
|
stouputils/applications/upscaler/__init__.pyi,sha256=VSp6Tq09ATCTdfnjhbDnu7lblaLLGbCNi-E22jYxa88,67
|
|
@@ -127,7 +127,7 @@ stouputils/installer/windows.py,sha256=WJcsRvEj00uAlJVAWgePhR7Hq0chYE0_n2QUZG901
|
|
|
127
127
|
stouputils/installer/windows.pyi,sha256=tHogIFhPVDQS0I10liLkAxnpaFFAvmFtEVMpPIae5LU,1616
|
|
128
128
|
stouputils/io.py,sha256=yQ4jGWoI81cP-ZWxgYwqXmuD6s_IbpkKkZf5jjqqIAE,16841
|
|
129
129
|
stouputils/io.pyi,sha256=TCBTVEWUkI3dO_jWI9oPMF9SbnT1yLzFChE551JPbSY,9076
|
|
130
|
-
stouputils/parallel.py,sha256=
|
|
130
|
+
stouputils/parallel.py,sha256=Zsj0yxylCapmlLsga2uTW2GzT7tE-s9xSy6MUFj3-qc,19102
|
|
131
131
|
stouputils/parallel.pyi,sha256=cvNMT0FyjOmehaVghurwVKABqvTO3BUbPF8f8ISp8Bw,10855
|
|
132
132
|
stouputils/print.py,sha256=BGPGu8SfIWhIjFRoUI2VaSCVGFhbBumYq9U2g1K-5uQ,16627
|
|
133
133
|
stouputils/print.pyi,sha256=-uYWZ-hlPhkeu8E0gSoQqY0u-4UhkJAtPUioQb3Xujo,6674
|
|
@@ -160,12 +160,12 @@ stouputils/stouputils/installer/linux.pyi,sha256=V-EbY7seOFnC6LL844bqWRNvQ7rHmMh
|
|
|
160
160
|
stouputils/stouputils/installer/main.pyi,sha256=r3j4GoMBpU06MpOqjSwoDTiSMOmbA3WWUA87970b6KE,3134
|
|
161
161
|
stouputils/stouputils/installer/windows.pyi,sha256=tHogIFhPVDQS0I10liLkAxnpaFFAvmFtEVMpPIae5LU,1616
|
|
162
162
|
stouputils/stouputils/io.pyi,sha256=TCBTVEWUkI3dO_jWI9oPMF9SbnT1yLzFChE551JPbSY,9076
|
|
163
|
-
stouputils/stouputils/parallel.pyi,sha256=
|
|
163
|
+
stouputils/stouputils/parallel.pyi,sha256=ug9I-Ni2q9cwwByXERQuxW-UM3rqw3dCiurnJjOWUpI,11576
|
|
164
164
|
stouputils/stouputils/print.pyi,sha256=TtP-OuK22uwsP0Wcruy0FxG_zD3fFwHUpxNp34HgCUU,6745
|
|
165
165
|
stouputils/stouputils/version_pkg.pyi,sha256=QPvqp1U3QA-9C_CC1dT9Vahv1hXEhstbM7x5uzMZSsQ,755
|
|
166
166
|
stouputils/version_pkg.py,sha256=Jsp-s03L14DkiZ94vQgrlQmaxApfn9DC8M_nzT1SJLk,7014
|
|
167
167
|
stouputils/version_pkg.pyi,sha256=QPvqp1U3QA-9C_CC1dT9Vahv1hXEhstbM7x5uzMZSsQ,755
|
|
168
|
-
stouputils-1.
|
|
169
|
-
stouputils-1.
|
|
170
|
-
stouputils-1.
|
|
171
|
-
stouputils-1.
|
|
168
|
+
stouputils-1.14.1.dist-info/WHEEL,sha256=RRVLqVugUmFOqBedBFAmA4bsgFcROUBiSUKlERi0Hcg,79
|
|
169
|
+
stouputils-1.14.1.dist-info/entry_points.txt,sha256=tx0z9VOnE-sfkmbFbA93zaBMzV3XSsKEJa_BWIqUzxw,57
|
|
170
|
+
stouputils-1.14.1.dist-info/METADATA,sha256=o52mpaZinag57bTZyZ2KMq2gv8EXvxLYFKQlpb4mpYY,13615
|
|
171
|
+
stouputils-1.14.1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|