stouputils 1.8.0__tar.gz → 1.9.1__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.
- {stouputils-1.8.0 → stouputils-1.9.1}/PKG-INFO +29 -1
- {stouputils-1.8.0 → stouputils-1.9.1}/README.md +27 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/pyproject.toml +2 -2
- stouputils-1.9.1/stouputils/__main__.py +67 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/all_doctests.py +2 -2
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/applications/automatic_docs.py +9 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/continuous_delivery/github.py +11 -2
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/metric_utils.py +847 -847
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/base_keras.py +765 -765
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/model_interface.py +939 -939
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/scripts/augment_dataset.py +77 -77
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/scripts/exhaustive_process.py +133 -133
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/scripts/preprocess_dataset.py +70 -70
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/scripts/routine.py +168 -168
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/decorators.py +15 -9
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/decorators.pyi +6 -5
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/parallel.py +127 -14
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/parallel.pyi +70 -13
- stouputils-1.8.0/stouputils/__main__.py +0 -58
- {stouputils-1.8.0 → stouputils-1.9.1}/.gitignore +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/LICENSE +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/__init__.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/__init__.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/_deprecated.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/_deprecated.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/all_doctests.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/applications/__init__.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/applications/__init__.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/applications/automatic_docs.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/applications/upscaler/__init__.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/applications/upscaler/__init__.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/applications/upscaler/config.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/applications/upscaler/config.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/applications/upscaler/image.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/applications/upscaler/image.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/applications/upscaler/video.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/applications/upscaler/video.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/archive.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/archive.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/backup.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/backup.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/collections.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/collections.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/continuous_delivery/__init__.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/continuous_delivery/__init__.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/continuous_delivery/cd_utils.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/continuous_delivery/cd_utils.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/continuous_delivery/github.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/continuous_delivery/pypi.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/continuous_delivery/pypi.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/continuous_delivery/pyproject.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/continuous_delivery/pyproject.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/continuous_delivery/stubs.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/continuous_delivery/stubs.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/ctx.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/ctx.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/config/get.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/config/set.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/__init__.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/auto_contrast.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/axis_flip.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/bias_field_correction.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/binary_threshold.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/blur.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/brightness.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/canny.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/clahe.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/common.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/contrast.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/curvature_flow_filter.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/denoise.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/histogram_equalization.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/invert.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/laplacian.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/median_blur.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/noise.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/normalize.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/random_erase.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/resize.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/rotation.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/salt_pepper.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/sharpening.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/shearing.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/threshold.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/translation.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image/zoom.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image_augmentation.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/image_preprocess.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/prosthesis_detection.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/data_processing/technique.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/dataset/__init__.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/dataset/dataset.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/dataset/dataset_loader.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/dataset/grouping_strategy.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/dataset/image_loader.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/dataset/xy_tuple.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/metric_dictionnary.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/mlflow_utils.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/abstract_model.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/all.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras/all.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras/convnext.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras/densenet.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras/efficientnet.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras/mobilenet.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras/resnet.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras/squeezenet.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras/vgg.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras/xception.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras_utils/callbacks/__init__.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras_utils/callbacks/colored_progress_bar.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras_utils/callbacks/learning_rate_finder.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras_utils/callbacks/model_checkpoint_v2.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras_utils/callbacks/progressive_unfreezing.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras_utils/callbacks/warmup_scheduler.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras_utils/losses/__init__.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras_utils/losses/next_generation_loss.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/keras_utils/visualizations.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/models/sandbox.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/range_tuple.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/data_science/utils.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/image.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/image.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/installer/__init__.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/installer/__init__.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/installer/common.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/installer/common.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/installer/downloader.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/installer/downloader.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/installer/linux.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/installer/linux.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/installer/main.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/installer/main.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/installer/windows.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/installer/windows.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/io.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/io.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/print.py +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/print.pyi +0 -0
- {stouputils-1.8.0 → stouputils-1.9.1}/stouputils/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: stouputils
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9.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
|
Project-URL: Homepage, https://github.com/Stoupy51/stouputils
|
|
6
6
|
Project-URL: Issues, https://github.com/Stoupy51/stouputils/issues
|
|
@@ -10,6 +10,7 @@ Classifier: License :: OSI Approved :: MIT License
|
|
|
10
10
|
Classifier: Operating System :: OS Independent
|
|
11
11
|
Classifier: Programming Language :: Python :: 3
|
|
12
12
|
Requires-Python: >=3.10
|
|
13
|
+
Requires-Dist: argcomplete>=3.0.0
|
|
13
14
|
Requires-Dist: mypy>=1.18.2
|
|
14
15
|
Requires-Dist: numpy
|
|
15
16
|
Requires-Dist: opencv-python>=4.0.0
|
|
@@ -50,6 +51,33 @@ Description-Content-Type: text/markdown
|
|
|
50
51
|
Stouputils is a collection of utility modules designed to simplify and enhance the development process.<br>
|
|
51
52
|
It includes a range of tools for tasks such as execution of doctests, display utilities, decorators, as well as context managers.
|
|
52
53
|
|
|
54
|
+
## 🔧 Installation
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
pip install stouputils
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### ✨ Enable Tab Completion on Linux (Optional)
|
|
61
|
+
|
|
62
|
+
For a better CLI experience, enable bash tab completion:
|
|
63
|
+
|
|
64
|
+
```bash
|
|
65
|
+
# Option 1: Using argcomplete's global activation
|
|
66
|
+
activate-global-python-argcomplete --user
|
|
67
|
+
|
|
68
|
+
# Option 2: Manual setup for bash
|
|
69
|
+
register-python-argcomplete stouputils >> ~/.bashrc
|
|
70
|
+
source ~/.bashrc
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
After enabling completion, you can use `<TAB>` to autocomplete commands:
|
|
74
|
+
```bash
|
|
75
|
+
stouputils <TAB> # Shows: --version, -v, all_doctests, backup
|
|
76
|
+
stouputils all_<TAB> # Completes to: all_doctests
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
**Note:** Tab completion works best in bash, zsh, Git Bash, or WSL on Windows.
|
|
80
|
+
|
|
53
81
|
|
|
54
82
|
# 🚀 Project File Tree
|
|
55
83
|
<html>
|
|
@@ -9,6 +9,33 @@
|
|
|
9
9
|
Stouputils is a collection of utility modules designed to simplify and enhance the development process.<br>
|
|
10
10
|
It includes a range of tools for tasks such as execution of doctests, display utilities, decorators, as well as context managers.
|
|
11
11
|
|
|
12
|
+
## 🔧 Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pip install stouputils
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### ✨ Enable Tab Completion on Linux (Optional)
|
|
19
|
+
|
|
20
|
+
For a better CLI experience, enable bash tab completion:
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# Option 1: Using argcomplete's global activation
|
|
24
|
+
activate-global-python-argcomplete --user
|
|
25
|
+
|
|
26
|
+
# Option 2: Manual setup for bash
|
|
27
|
+
register-python-argcomplete stouputils >> ~/.bashrc
|
|
28
|
+
source ~/.bashrc
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
After enabling completion, you can use `<TAB>` to autocomplete commands:
|
|
32
|
+
```bash
|
|
33
|
+
stouputils <TAB> # Shows: --version, -v, all_doctests, backup
|
|
34
|
+
stouputils all_<TAB> # Completes to: all_doctests
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
**Note:** Tab completion works best in bash, zsh, Git Bash, or WSL on Windows.
|
|
38
|
+
|
|
12
39
|
|
|
13
40
|
# 🚀 Project File Tree
|
|
14
41
|
<html>
|
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "stouputils"
|
|
8
|
-
version = "1.
|
|
8
|
+
version = "1.9.1"
|
|
9
9
|
description = "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."
|
|
10
10
|
readme = "README.md"
|
|
11
11
|
requires-python = ">=3.10"
|
|
@@ -14,7 +14,7 @@ classifiers = [
|
|
|
14
14
|
"License :: OSI Approved :: MIT License",
|
|
15
15
|
"Operating System :: OS Independent",
|
|
16
16
|
]
|
|
17
|
-
dependencies = [ "tqdm>=4.0.0", "requests>=2.20.0", "pyyaml>=6.0.0", "toml>=0.10.0", "pillow>=10.0.0", "numpy", "opencv-python>=4.0.0", "orjson>=3.0.0", "pyfastcopy>=1.0.0", "python-box[all]>=7.0.0", "zarr>=2.18.3", "mypy>=1.18.2",]
|
|
17
|
+
dependencies = [ "tqdm>=4.0.0", "requests>=2.20.0", "pyyaml>=6.0.0", "toml>=0.10.0", "pillow>=10.0.0", "numpy", "opencv-python>=4.0.0", "orjson>=3.0.0", "pyfastcopy>=1.0.0", "python-box[all]>=7.0.0", "zarr>=2.18.3", "mypy>=1.18.2", "argcomplete>=3.0.0",]
|
|
18
18
|
[[project.authors]]
|
|
19
19
|
name = "Stoupy51"
|
|
20
20
|
email = "stoupy51@gmail.com"
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
# PYTHON_ARGCOMPLETE_OK
|
|
4
|
+
# Imports
|
|
5
|
+
import argparse
|
|
6
|
+
import sys
|
|
7
|
+
|
|
8
|
+
import argcomplete
|
|
9
|
+
|
|
10
|
+
from .all_doctests import launch_tests
|
|
11
|
+
from .backup import backup_cli
|
|
12
|
+
from .decorators import handle_error
|
|
13
|
+
from .print import CYAN, GREEN, RESET, show_version
|
|
14
|
+
|
|
15
|
+
# Argument Parser Setup for Auto-Completion
|
|
16
|
+
parser = argparse.ArgumentParser(prog="stouputils", add_help=False)
|
|
17
|
+
parser.add_argument("command", nargs="?", choices=["--version", "-v", "all_doctests", "backup"])
|
|
18
|
+
parser.add_argument("args", nargs="*")
|
|
19
|
+
argcomplete.autocomplete(parser)
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
@handle_error(message="Error while running 'stouputils'")
|
|
23
|
+
def main() -> None:
|
|
24
|
+
second_arg: str = sys.argv[1].lower() if len(sys.argv) >= 2 else ""
|
|
25
|
+
|
|
26
|
+
# Print the version of stouputils and its dependencies
|
|
27
|
+
if second_arg in ("--version","-v"):
|
|
28
|
+
return show_version()
|
|
29
|
+
|
|
30
|
+
# Handle "all_doctests" command
|
|
31
|
+
if second_arg == "all_doctests":
|
|
32
|
+
if launch_tests("." if len(sys.argv) == 2 else sys.argv[2]) > 0:
|
|
33
|
+
sys.exit(1)
|
|
34
|
+
return
|
|
35
|
+
|
|
36
|
+
# Handle "backup" command
|
|
37
|
+
if second_arg == "backup":
|
|
38
|
+
sys.argv.pop(1) # Remove "backup" from argv so backup_cli gets clean arguments
|
|
39
|
+
return backup_cli()
|
|
40
|
+
|
|
41
|
+
# Check if the command is any package name
|
|
42
|
+
if second_arg in (): # type: ignore
|
|
43
|
+
return
|
|
44
|
+
|
|
45
|
+
# Get version
|
|
46
|
+
from importlib.metadata import version
|
|
47
|
+
try:
|
|
48
|
+
pkg_version = version("stouputils")
|
|
49
|
+
except Exception:
|
|
50
|
+
pkg_version = "unknown"
|
|
51
|
+
|
|
52
|
+
# Print help with nice formatting
|
|
53
|
+
separator: str = "─" * 60
|
|
54
|
+
print(f"{CYAN}{separator}{RESET}")
|
|
55
|
+
print(f"{CYAN}stouputils {GREEN}CLI {CYAN}v{pkg_version}{RESET}")
|
|
56
|
+
print(f"{CYAN}{separator}{RESET}")
|
|
57
|
+
print(f"\n{CYAN}Usage:{RESET} stouputils <command> [options]")
|
|
58
|
+
print(f"\n{CYAN}Available commands:{RESET}")
|
|
59
|
+
print(f" {GREEN}--version, -v{RESET} Show version information")
|
|
60
|
+
print(f" {GREEN}all_doctests{RESET} [dir] Run all doctests in the specified directory")
|
|
61
|
+
print(f" {GREEN}backup{RESET} --help Backup utilities (delta, consolidate, limit)")
|
|
62
|
+
print(f"{CYAN}{separator}{RESET}")
|
|
63
|
+
return
|
|
64
|
+
|
|
65
|
+
if __name__ == "__main__":
|
|
66
|
+
main()
|
|
67
|
+
|
|
@@ -103,7 +103,7 @@ def launch_tests(root_dir: str, strict: bool = True) -> int:
|
|
|
103
103
|
for module_path in modules_file_paths:
|
|
104
104
|
separator: str = " " * (max_length - len(module_path))
|
|
105
105
|
|
|
106
|
-
@measure_time(
|
|
106
|
+
@measure_time(message=f"Importing module '{module_path}' {separator}took")
|
|
107
107
|
def internal(a: str = module_path, b: str = separator) -> None:
|
|
108
108
|
modules.append(importlib.import_module(a))
|
|
109
109
|
separators.append(b)
|
|
@@ -153,7 +153,7 @@ def test_module_with_progress(module: ModuleType, separator: str) -> "TestResult
|
|
|
153
153
|
TestResults: The results of the tests
|
|
154
154
|
"""
|
|
155
155
|
from doctest import TestResults, testmod
|
|
156
|
-
@measure_time(
|
|
156
|
+
@measure_time(message=f"Testing module '{module.__name__}' {separator}took")
|
|
157
157
|
def internal() -> TestResults:
|
|
158
158
|
return testmod(m=module)
|
|
159
159
|
return internal()
|
|
@@ -235,6 +235,15 @@ autodoc_default_options: dict[str, bool | str] = {{
|
|
|
235
235
|
autodoc_mock_imports = []
|
|
236
236
|
always_document_param_types = True
|
|
237
237
|
add_module_names = False
|
|
238
|
+
|
|
239
|
+
# Prevent social media cards and images from being used
|
|
240
|
+
html_meta = globals().get("html_meta", {{}})
|
|
241
|
+
html_meta.pop("image", None)
|
|
242
|
+
html_context = globals().get("html_context", {{}})
|
|
243
|
+
html_context.pop("image", None)
|
|
244
|
+
html_context.pop("social_card", None)
|
|
245
|
+
ogp_social_cards = {{"enable": False}}
|
|
246
|
+
ogp_site_url = ""
|
|
238
247
|
"""
|
|
239
248
|
|
|
240
249
|
if skip_undocumented:
|
|
@@ -286,6 +286,12 @@ def generate_changelog(
|
|
|
286
286
|
if ":" in message:
|
|
287
287
|
commit_type_part, desc = message.split(":", 1)
|
|
288
288
|
|
|
289
|
+
# Check for breaking change indicator (!)
|
|
290
|
+
is_breaking: bool = False
|
|
291
|
+
if "!" in commit_type_part:
|
|
292
|
+
is_breaking = True
|
|
293
|
+
commit_type_part = commit_type_part.replace("!", "")
|
|
294
|
+
|
|
289
295
|
# Extract sub-category if present (e.g., 'feat(Project)' -> 'feat', 'Project')
|
|
290
296
|
sub_category: str|None = None
|
|
291
297
|
if "(" in commit_type_part and ")" in commit_type_part:
|
|
@@ -301,10 +307,13 @@ def generate_changelog(
|
|
|
301
307
|
commit_type = "".join(c for c in commit_type.lower().strip() if c in "abcdefghijklmnopqrstuvwxyz")
|
|
302
308
|
commit_type = COMMIT_TYPES.get(commit_type, commit_type.title())
|
|
303
309
|
|
|
310
|
+
# Prepend emoji if breaking change
|
|
311
|
+
formatted_desc = f"🚨 {desc.strip()}" if is_breaking else desc.strip()
|
|
312
|
+
|
|
304
313
|
# Add the commit to the commit groups
|
|
305
314
|
if commit_type not in commit_groups:
|
|
306
315
|
commit_groups[commit_type] = []
|
|
307
|
-
commit_groups[commit_type].append((
|
|
316
|
+
commit_groups[commit_type].append((formatted_desc, sha, sub_category))
|
|
308
317
|
|
|
309
318
|
# Initialize the changelog
|
|
310
319
|
changelog: str = "## Changelog\n\n"
|
|
@@ -460,7 +469,7 @@ def upload_assets(
|
|
|
460
469
|
handle_response(response, f"Failed to upload {file}")
|
|
461
470
|
progress(f"Uploaded {file}")
|
|
462
471
|
|
|
463
|
-
@measure_time(
|
|
472
|
+
@measure_time(message="Uploading to GitHub took")
|
|
464
473
|
@handle_error()
|
|
465
474
|
def upload_to_github(credentials: dict[str, Any], github_config: dict[str, Any]) -> str:
|
|
466
475
|
""" Upload the project to GitHub using the credentials and the configuration
|