stouputils 1.0.19__tar.gz → 1.0.20__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.0.20/.github/workflows/documentation.yml +29 -0
- stouputils-1.0.20/.python-version +1 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/1_upgrades.py +4 -4
- {stouputils-1.0.19 → stouputils-1.0.20}/2_build.py +4 -4
- {stouputils-1.0.19 → stouputils-1.0.20}/3_upload.py +10 -10
- {stouputils-1.0.19 → stouputils-1.0.20}/PKG-INFO +1 -1
- {stouputils-1.0.19 → stouputils-1.0.20}/all_in_one.py +13 -13
- {stouputils-1.0.19 → stouputils-1.0.20}/build_all_in_one.py +14 -14
- {stouputils-1.0.19 → stouputils-1.0.20}/examples/delta_backup.py +7 -7
- {stouputils-1.0.19 → stouputils-1.0.20}/pyproject.toml +1 -1
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/__init__.py +15 -15
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/continuous_delivery/__init__.py +5 -5
- stouputils-1.0.19/docs/Makefile +0 -14
- stouputils-1.0.19/docs/build/html/.buildinfo +0 -4
- stouputils-1.0.19/docs/build/html/.doctrees/environment.pickle +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/index.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/modules.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.all_doctests.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.archive.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.backup.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.collections.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.continuous_delivery.cd_utils.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.continuous_delivery.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.continuous_delivery.github.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.ctx.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.decorators.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.dont_look.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.dont_look.zip_file_override.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.io.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.parallel.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.print.doctree +0 -0
- stouputils-1.0.19/docs/build/html/.nojekyll +0 -0
- stouputils-1.0.19/docs/build/html/_modules/index.html +0 -111
- stouputils-1.0.19/docs/build/html/_modules/stouputils/all_doctests.html +0 -199
- stouputils-1.0.19/docs/build/html/_modules/stouputils/archive.html +0 -216
- stouputils-1.0.19/docs/build/html/_modules/stouputils/backup.html +0 -433
- stouputils-1.0.19/docs/build/html/_modules/stouputils/collections.html +0 -162
- stouputils-1.0.19/docs/build/html/_modules/stouputils/continuous_delivery/cd_utils.html +0 -187
- stouputils-1.0.19/docs/build/html/_modules/stouputils/continuous_delivery/github.html +0 -605
- stouputils-1.0.19/docs/build/html/_modules/stouputils/ctx.html +0 -211
- stouputils-1.0.19/docs/build/html/_modules/stouputils/decorators.html +0 -459
- stouputils-1.0.19/docs/build/html/_modules/stouputils/dont_look/zip_file_override.html +0 -225
- stouputils-1.0.19/docs/build/html/_modules/stouputils/io.html +0 -312
- stouputils-1.0.19/docs/build/html/_modules/stouputils/parallel.html +0 -294
- stouputils-1.0.19/docs/build/html/_modules/stouputils/print.html +0 -363
- stouputils-1.0.19/docs/build/html/_sources/index.rst.txt +0 -53
- stouputils-1.0.19/docs/build/html/_sources/modules/modules.rst.txt +0 -7
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.all_doctests.rst.txt +0 -8
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.archive.rst.txt +0 -8
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.backup.rst.txt +0 -8
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.collections.rst.txt +0 -8
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.continuous_delivery.cd_utils.rst.txt +0 -8
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.continuous_delivery.github.rst.txt +0 -8
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.continuous_delivery.rst.txt +0 -17
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.ctx.rst.txt +0 -8
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.decorators.rst.txt +0 -8
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.dont_look.rst.txt +0 -12
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.dont_look.zip_file_override.rst.txt +0 -8
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.io.rst.txt +0 -8
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.parallel.rst.txt +0 -8
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.print.rst.txt +0 -8
- stouputils-1.0.19/docs/build/html/_sources/modules/stouputils.rst.txt +0 -33
- stouputils-1.0.19/docs/build/html/_static/_sphinx_javascript_frameworks_compat.js +0 -123
- stouputils-1.0.19/docs/build/html/_static/basic.css +0 -914
- stouputils-1.0.19/docs/build/html/_static/css/badge_only.css +0 -1
- stouputils-1.0.19/docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/Roboto-Slab-Bold.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/Roboto-Slab-Regular.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/fontawesome-webfont.eot +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/fontawesome-webfont.svg +0 -2671
- stouputils-1.0.19/docs/build/html/_static/css/fonts/fontawesome-webfont.ttf +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/fontawesome-webfont.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/fontawesome-webfont.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/lato-bold-italic.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/lato-bold-italic.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/lato-bold.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/lato-bold.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/lato-normal-italic.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/lato-normal-italic.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/lato-normal.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/fonts/lato-normal.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/css/theme.css +0 -4
- stouputils-1.0.19/docs/build/html/_static/doctools.js +0 -149
- stouputils-1.0.19/docs/build/html/_static/documentation_options.js +0 -13
- stouputils-1.0.19/docs/build/html/_static/file.png +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-bold.eot +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-bold.ttf +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-bold.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-bold.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-bolditalic.eot +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-bolditalic.ttf +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-bolditalic.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-italic.eot +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-italic.ttf +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-italic.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-italic.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-regular.eot +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-regular.ttf +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-regular.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/Lato/lato-regular.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.eot +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.ttf +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-bold.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.eot +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.ttf +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff +0 -0
- stouputils-1.0.19/docs/build/html/_static/fonts/RobotoSlab/roboto-slab-v7-regular.woff2 +0 -0
- stouputils-1.0.19/docs/build/html/_static/jquery.js +0 -2
- stouputils-1.0.19/docs/build/html/_static/js/badge_only.js +0 -1
- stouputils-1.0.19/docs/build/html/_static/js/theme.js +0 -1
- stouputils-1.0.19/docs/build/html/_static/js/versions.js +0 -228
- stouputils-1.0.19/docs/build/html/_static/language_data.js +0 -192
- stouputils-1.0.19/docs/build/html/_static/minus.png +0 -0
- stouputils-1.0.19/docs/build/html/_static/plus.png +0 -0
- stouputils-1.0.19/docs/build/html/_static/pygments.css +0 -75
- stouputils-1.0.19/docs/build/html/_static/searchtools.js +0 -632
- stouputils-1.0.19/docs/build/html/_static/sphinx_highlight.js +0 -154
- stouputils-1.0.19/docs/build/html/genindex.html +0 -513
- stouputils-1.0.19/docs/build/html/index.html +0 -271
- stouputils-1.0.19/docs/build/html/modules/modules.html +0 -192
- stouputils-1.0.19/docs/build/html/modules/stouputils.all_doctests.html +0 -163
- stouputils-1.0.19/docs/build/html/modules/stouputils.archive.html +0 -185
- stouputils-1.0.19/docs/build/html/modules/stouputils.backup.html +0 -272
- stouputils-1.0.19/docs/build/html/modules/stouputils.collections.html +0 -171
- stouputils-1.0.19/docs/build/html/modules/stouputils.continuous_delivery.cd_utils.html +0 -172
- stouputils-1.0.19/docs/build/html/modules/stouputils.continuous_delivery.github.html +0 -444
- stouputils-1.0.19/docs/build/html/modules/stouputils.continuous_delivery.html +0 -150
- stouputils-1.0.19/docs/build/html/modules/stouputils.ctx.html +0 -199
- stouputils-1.0.19/docs/build/html/modules/stouputils.decorators.html +0 -327
- stouputils-1.0.19/docs/build/html/modules/stouputils.dont_look.html +0 -129
- stouputils-1.0.19/docs/build/html/modules/stouputils.dont_look.zip_file_override.html +0 -125
- stouputils-1.0.19/docs/build/html/modules/stouputils.html +0 -252
- stouputils-1.0.19/docs/build/html/modules/stouputils.io.html +0 -296
- stouputils-1.0.19/docs/build/html/modules/stouputils.parallel.html +0 -234
- stouputils-1.0.19/docs/build/html/modules/stouputils.print.html +0 -251
- stouputils-1.0.19/docs/build/html/objects.inv +0 -0
- stouputils-1.0.19/docs/build/html/py-modindex.html +0 -190
- stouputils-1.0.19/docs/build/html/search.html +0 -120
- stouputils-1.0.19/docs/build/html/searchindex.js +0 -1
- stouputils-1.0.19/docs/requirements.txt +0 -3
- stouputils-1.0.19/docs/source/conf.py +0 -93
- {stouputils-1.0.19 → stouputils-1.0.20}/.gitignore +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/LICENSE +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/README.md +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/copy_in_local.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/doctests.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/github_release.py +0 -0
- /stouputils-1.0.19/scripts/update_docs.py → /stouputils-1.0.20/scripts/create_docs.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/all_doctests.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/archive.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/backup.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/collections.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/continuous_delivery/cd_utils.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/continuous_delivery/github.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/ctx.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/decorators.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/dont_look/zip_file_override.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/io.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/parallel.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/print.py +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/src/stouputils/py.typed +0 -0
- {stouputils-1.0.19 → stouputils-1.0.20}/upgrade.py +0 -0
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
name: documentation
|
|
2
|
+
|
|
3
|
+
on: [push, pull_request, workflow_dispatch]
|
|
4
|
+
|
|
5
|
+
permissions:
|
|
6
|
+
contents: write
|
|
7
|
+
|
|
8
|
+
jobs:
|
|
9
|
+
docs:
|
|
10
|
+
runs-on: ubuntu-latest
|
|
11
|
+
steps:
|
|
12
|
+
- uses: actions/checkout@v4
|
|
13
|
+
- uses: actions/setup-python@v5
|
|
14
|
+
- name: Install dependencies
|
|
15
|
+
run: |
|
|
16
|
+
pip install hatch stouputils sphinx sphinx_rtd_theme myst_parser
|
|
17
|
+
hatch build
|
|
18
|
+
- name: Sphinx build
|
|
19
|
+
run: |
|
|
20
|
+
python scripts/create_docs.py
|
|
21
|
+
- name: Deploy to GitHub Pages
|
|
22
|
+
uses: peaceiris/actions-gh-pages@v3
|
|
23
|
+
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/main' }}
|
|
24
|
+
with:
|
|
25
|
+
publish_branch: gh-pages
|
|
26
|
+
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
27
|
+
publish_dir: docs/build/html
|
|
28
|
+
force_orphan: true
|
|
29
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
3.10
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import os
|
|
3
|
-
os.system("py -m pip install --upgrade pip setuptools build twine pkginfo")
|
|
4
|
-
|
|
1
|
+
|
|
2
|
+
import os
|
|
3
|
+
os.system("py -m pip install --upgrade pip setuptools build twine pkginfo")
|
|
4
|
+
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import os
|
|
3
|
-
os.system("py -m build")
|
|
4
|
-
|
|
1
|
+
|
|
2
|
+
import os
|
|
3
|
+
os.system("py -m build")
|
|
4
|
+
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import os
|
|
3
|
-
LAST_FILES: int = 1
|
|
4
|
-
for root, _, files in os.walk("dist"):
|
|
5
|
-
files = sorted(files, key=lambda x: os.path.getmtime(f"dist/{x}"), reverse=True)
|
|
6
|
-
lasts = files[:LAST_FILES * 2] # x2 because we have the .tar.gz and the .whl
|
|
7
|
-
for file in lasts:
|
|
8
|
-
if file.endswith(".tar.gz"):
|
|
9
|
-
os.system(f"py -m twine upload --verbose -r stouputils dist/{file}")
|
|
10
|
-
|
|
1
|
+
|
|
2
|
+
import os
|
|
3
|
+
LAST_FILES: int = 1
|
|
4
|
+
for root, _, files in os.walk("dist"):
|
|
5
|
+
files = sorted(files, key=lambda x: os.path.getmtime(f"dist/{x}"), reverse=True)
|
|
6
|
+
lasts = files[:LAST_FILES * 2] # x2 because we have the .tar.gz and the .whl
|
|
7
|
+
for file in lasts:
|
|
8
|
+
if file.endswith(".tar.gz"):
|
|
9
|
+
os.system(f"py -m twine upload --verbose -r stouputils dist/{file}")
|
|
10
|
+
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: stouputils
|
|
3
|
-
Version: 1.0.
|
|
3
|
+
Version: 1.0.20
|
|
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
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
import os
|
|
3
|
-
import sys
|
|
4
|
-
commands = [
|
|
5
|
-
f"{sys.executable} upgrade.py", # Upgrade the version in pyproject.toml
|
|
6
|
-
f"{sys.executable} build_all_in_one.py", # Build the package and upload it
|
|
7
|
-
]
|
|
8
|
-
|
|
9
|
-
for command in commands:
|
|
10
|
-
if os.system(command) != 0:
|
|
11
|
-
print(f"Error while executing '{command}'")
|
|
12
|
-
exit(1)
|
|
13
|
-
|
|
1
|
+
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
commands = [
|
|
5
|
+
f"{sys.executable} upgrade.py", # Upgrade the version in pyproject.toml
|
|
6
|
+
f"{sys.executable} build_all_in_one.py", # Build the package and upload it
|
|
7
|
+
]
|
|
8
|
+
|
|
9
|
+
for command in commands:
|
|
10
|
+
if os.system(command) != 0:
|
|
11
|
+
print(f"Error while executing '{command}'")
|
|
12
|
+
exit(1)
|
|
13
|
+
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
import os
|
|
3
|
-
import sys
|
|
4
|
-
commands = [
|
|
5
|
-
f"{sys.executable} 1_upgrades.py",
|
|
6
|
-
f"{sys.executable} 2_build.py",
|
|
7
|
-
f"{sys.executable} 3_upload.py",
|
|
8
|
-
]
|
|
9
|
-
|
|
10
|
-
for command in commands:
|
|
11
|
-
if os.system(command) != 0:
|
|
12
|
-
print(f"Error while executing '{command}'")
|
|
13
|
-
exit(1)
|
|
14
|
-
|
|
1
|
+
|
|
2
|
+
import os
|
|
3
|
+
import sys
|
|
4
|
+
commands = [
|
|
5
|
+
f"{sys.executable} 1_upgrades.py",
|
|
6
|
+
f"{sys.executable} 2_build.py",
|
|
7
|
+
f"{sys.executable} 3_upload.py",
|
|
8
|
+
]
|
|
9
|
+
|
|
10
|
+
for command in commands:
|
|
11
|
+
if os.system(command) != 0:
|
|
12
|
+
print(f"Error while executing '{command}'")
|
|
13
|
+
exit(1)
|
|
14
|
+
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
# Example of use:
|
|
3
|
-
# py .\delta_backup.py delta "src" "backup" -x "*pycache*"
|
|
4
|
-
|
|
5
|
-
import stouputils as stp
|
|
6
|
-
stp.backup_cli()
|
|
7
|
-
|
|
1
|
+
|
|
2
|
+
# Example of use:
|
|
3
|
+
# py .\delta_backup.py delta "src" "backup" -x "*pycache*"
|
|
4
|
+
|
|
5
|
+
import stouputils as stp
|
|
6
|
+
stp.backup_cli()
|
|
7
|
+
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
# Imports
|
|
3
|
-
from .print import *
|
|
4
|
-
from .archive import *
|
|
5
|
-
from .io import *
|
|
6
|
-
from .decorators import *
|
|
7
|
-
from .ctx import *
|
|
8
|
-
from .parallel import *
|
|
9
|
-
from .all_doctests import *
|
|
10
|
-
from .collections import *
|
|
11
|
-
from .backup import *
|
|
12
|
-
|
|
13
|
-
# Folders
|
|
14
|
-
from .continuous_delivery import *
|
|
15
|
-
|
|
1
|
+
|
|
2
|
+
# Imports
|
|
3
|
+
from .print import *
|
|
4
|
+
from .archive import *
|
|
5
|
+
from .io import *
|
|
6
|
+
from .decorators import *
|
|
7
|
+
from .ctx import *
|
|
8
|
+
from .parallel import *
|
|
9
|
+
from .all_doctests import *
|
|
10
|
+
from .collections import *
|
|
11
|
+
from .backup import *
|
|
12
|
+
|
|
13
|
+
# Folders
|
|
14
|
+
from .continuous_delivery import *
|
|
15
|
+
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
# Imports
|
|
3
|
-
from .cd_utils import *
|
|
4
|
-
from .github import *
|
|
5
|
-
|
|
1
|
+
|
|
2
|
+
# Imports
|
|
3
|
+
from .cd_utils import *
|
|
4
|
+
from .github import *
|
|
5
|
+
|
stouputils-1.0.19/docs/Makefile
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
# Minimal makefile for Sphinx documentation
|
|
2
|
-
|
|
3
|
-
SPHINXOPTS ?=
|
|
4
|
-
SPHINXBUILD ?= sphinx-build
|
|
5
|
-
SOURCEDIR = source
|
|
6
|
-
BUILDDIR = build
|
|
7
|
-
|
|
8
|
-
help:
|
|
9
|
-
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
10
|
-
|
|
11
|
-
.PHONY: help Makefile
|
|
12
|
-
|
|
13
|
-
%: Makefile
|
|
14
|
-
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.continuous_delivery.cd_utils.doctree
DELETED
|
Binary file
|
|
Binary file
|
stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.continuous_delivery.github.doctree
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
stouputils-1.0.19/docs/build/html/.doctrees/modules/stouputils.dont_look.zip_file_override.doctree
DELETED
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<!DOCTYPE html>
|
|
4
|
-
<html class="writer-html5" lang="en" data-content_root="../">
|
|
5
|
-
<head>
|
|
6
|
-
<meta charset="utf-8" />
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
-
<title>Overview: module code — stouputils 1.0.18 documentation</title>
|
|
9
|
-
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
|
|
10
|
-
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=e59714d7" />
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<script src="../_static/jquery.js?v=5d32c60e"></script>
|
|
14
|
-
<script src="../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
|
15
|
-
<script src="../_static/documentation_options.js?v=14ed45bf"></script>
|
|
16
|
-
<script src="../_static/doctools.js?v=9bcbadda"></script>
|
|
17
|
-
<script src="../_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
18
|
-
<script src="../_static/js/theme.js"></script>
|
|
19
|
-
<link rel="index" title="Index" href="../genindex.html" />
|
|
20
|
-
<link rel="search" title="Search" href="../search.html" />
|
|
21
|
-
</head>
|
|
22
|
-
|
|
23
|
-
<body class="wy-body-for-nav">
|
|
24
|
-
<div class="wy-grid-for-nav">
|
|
25
|
-
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
26
|
-
<div class="wy-side-scroll">
|
|
27
|
-
<div class="wy-side-nav-search" >
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<a href="../index.html" class="icon icon-home">
|
|
32
|
-
stouputils
|
|
33
|
-
</a>
|
|
34
|
-
<div role="search">
|
|
35
|
-
<form id="rtd-search-form" class="wy-form" action="../search.html" method="get">
|
|
36
|
-
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
|
37
|
-
<input type="hidden" name="check_keywords" value="yes" />
|
|
38
|
-
<input type="hidden" name="area" value="default" />
|
|
39
|
-
</form>
|
|
40
|
-
</div>
|
|
41
|
-
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
|
42
|
-
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
|
43
|
-
<ul>
|
|
44
|
-
<li class="toctree-l1"><a class="reference internal" href="../modules/stouputils.html">stouputils package</a></li>
|
|
45
|
-
</ul>
|
|
46
|
-
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</nav>
|
|
50
|
-
|
|
51
|
-
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
|
52
|
-
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
53
|
-
<a href="../index.html">stouputils</a>
|
|
54
|
-
</nav>
|
|
55
|
-
|
|
56
|
-
<div class="wy-nav-content">
|
|
57
|
-
<div class="rst-content style-external-links">
|
|
58
|
-
<div role="navigation" aria-label="Page navigation">
|
|
59
|
-
<ul class="wy-breadcrumbs">
|
|
60
|
-
<li><a href="../index.html" class="icon icon-home" aria-label="Home"></a></li>
|
|
61
|
-
<li class="breadcrumb-item active">Overview: module code</li>
|
|
62
|
-
<li class="wy-breadcrumbs-aside">
|
|
63
|
-
</li>
|
|
64
|
-
</ul>
|
|
65
|
-
<hr/>
|
|
66
|
-
</div>
|
|
67
|
-
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
68
|
-
<div itemprop="articleBody">
|
|
69
|
-
|
|
70
|
-
<h1>All modules for which code is available</h1>
|
|
71
|
-
<ul><li><a href="stouputils/all_doctests.html">stouputils.all_doctests</a></li>
|
|
72
|
-
<li><a href="stouputils/archive.html">stouputils.archive</a></li>
|
|
73
|
-
<li><a href="stouputils/backup.html">stouputils.backup</a></li>
|
|
74
|
-
<li><a href="stouputils/collections.html">stouputils.collections</a></li>
|
|
75
|
-
<li><a href="stouputils/continuous_delivery/cd_utils.html">stouputils.continuous_delivery.cd_utils</a></li>
|
|
76
|
-
<li><a href="stouputils/continuous_delivery/github.html">stouputils.continuous_delivery.github</a></li>
|
|
77
|
-
<li><a href="stouputils/ctx.html">stouputils.ctx</a></li>
|
|
78
|
-
<li><a href="stouputils/decorators.html">stouputils.decorators</a></li>
|
|
79
|
-
<li><a href="stouputils/io.html">stouputils.io</a></li>
|
|
80
|
-
<li><a href="stouputils/parallel.html">stouputils.parallel</a></li>
|
|
81
|
-
<li><a href="stouputils/print.html">stouputils.print</a></li>
|
|
82
|
-
</ul>
|
|
83
|
-
|
|
84
|
-
</div>
|
|
85
|
-
</div>
|
|
86
|
-
<footer>
|
|
87
|
-
|
|
88
|
-
<hr/>
|
|
89
|
-
|
|
90
|
-
<div role="contentinfo">
|
|
91
|
-
<p>© Copyright 2024, Stoupy.</p>
|
|
92
|
-
</div>
|
|
93
|
-
|
|
94
|
-
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
95
|
-
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
96
|
-
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
</footer>
|
|
100
|
-
</div>
|
|
101
|
-
</div>
|
|
102
|
-
</section>
|
|
103
|
-
</div>
|
|
104
|
-
<script>
|
|
105
|
-
jQuery(function () {
|
|
106
|
-
SphinxRtdTheme.Navigation.enable(true);
|
|
107
|
-
});
|
|
108
|
-
</script>
|
|
109
|
-
|
|
110
|
-
</body>
|
|
111
|
-
</html>
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
<!DOCTYPE html>
|
|
4
|
-
<html class="writer-html5" lang="en" data-content_root="../../">
|
|
5
|
-
<head>
|
|
6
|
-
<meta charset="utf-8" />
|
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
8
|
-
<title>stouputils.all_doctests — stouputils 1.0.0 documentation</title>
|
|
9
|
-
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=80d5e7a1" />
|
|
10
|
-
<link rel="stylesheet" type="text/css" href="../../_static/css/theme.css?v=e59714d7" />
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
<script src="../../_static/jquery.js?v=5d32c60e"></script>
|
|
14
|
-
<script src="../../_static/_sphinx_javascript_frameworks_compat.js?v=2cd50e6c"></script>
|
|
15
|
-
<script src="../../_static/documentation_options.js?v=8d563738"></script>
|
|
16
|
-
<script src="../../_static/doctools.js?v=9bcbadda"></script>
|
|
17
|
-
<script src="../../_static/sphinx_highlight.js?v=dc90522c"></script>
|
|
18
|
-
<script src="../../_static/js/theme.js"></script>
|
|
19
|
-
<link rel="index" title="Index" href="../../genindex.html" />
|
|
20
|
-
<link rel="search" title="Search" href="../../search.html" />
|
|
21
|
-
</head>
|
|
22
|
-
|
|
23
|
-
<body class="wy-body-for-nav">
|
|
24
|
-
<div class="wy-grid-for-nav">
|
|
25
|
-
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
|
|
26
|
-
<div class="wy-side-scroll">
|
|
27
|
-
<div class="wy-side-nav-search" >
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<a href="../../index.html" class="icon icon-home">
|
|
32
|
-
stouputils
|
|
33
|
-
</a>
|
|
34
|
-
<div role="search">
|
|
35
|
-
<form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
|
|
36
|
-
<input type="text" name="q" placeholder="Search docs" aria-label="Search docs" />
|
|
37
|
-
<input type="hidden" name="check_keywords" value="yes" />
|
|
38
|
-
<input type="hidden" name="area" value="default" />
|
|
39
|
-
</form>
|
|
40
|
-
</div>
|
|
41
|
-
</div><div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="Navigation menu">
|
|
42
|
-
<p class="caption" role="heading"><span class="caption-text">Contents:</span></p>
|
|
43
|
-
<ul>
|
|
44
|
-
<li class="toctree-l1"><a class="reference internal" href="../../modules/stouputils.html">stouputils package</a></li>
|
|
45
|
-
</ul>
|
|
46
|
-
|
|
47
|
-
</div>
|
|
48
|
-
</div>
|
|
49
|
-
</nav>
|
|
50
|
-
|
|
51
|
-
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap"><nav class="wy-nav-top" aria-label="Mobile navigation menu" >
|
|
52
|
-
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
|
|
53
|
-
<a href="../../index.html">stouputils</a>
|
|
54
|
-
</nav>
|
|
55
|
-
|
|
56
|
-
<div class="wy-nav-content">
|
|
57
|
-
<div class="rst-content style-external-links">
|
|
58
|
-
<div role="navigation" aria-label="Page navigation">
|
|
59
|
-
<ul class="wy-breadcrumbs">
|
|
60
|
-
<li><a href="../../index.html" class="icon icon-home" aria-label="Home"></a></li>
|
|
61
|
-
<li class="breadcrumb-item"><a href="../index.html">Module code</a></li>
|
|
62
|
-
<li class="breadcrumb-item active">stouputils.all_doctests</li>
|
|
63
|
-
<li class="wy-breadcrumbs-aside">
|
|
64
|
-
</li>
|
|
65
|
-
</ul>
|
|
66
|
-
<hr/>
|
|
67
|
-
</div>
|
|
68
|
-
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
|
|
69
|
-
<div itemprop="articleBody">
|
|
70
|
-
|
|
71
|
-
<h1>Source code for stouputils.all_doctests</h1><div class="highlight"><pre>
|
|
72
|
-
<span></span><span class="sd">"""</span>
|
|
73
|
-
<span class="sd">This module is used to run all the doctests for all the modules in a given directory.</span>
|
|
74
|
-
<span class="sd">"""</span>
|
|
75
|
-
|
|
76
|
-
<span class="c1"># Imports</span>
|
|
77
|
-
<span class="kn">import</span> <span class="nn">os</span>
|
|
78
|
-
<span class="kn">import</span> <span class="nn">sys</span>
|
|
79
|
-
<span class="kn">from</span> <span class="nn">.print</span> <span class="kn">import</span> <span class="o">*</span>
|
|
80
|
-
<span class="kn">from</span> <span class="nn">.decorators</span> <span class="kn">import</span> <span class="n">measure_time</span><span class="p">,</span> <span class="n">handle_error</span><span class="p">,</span> <span class="n">LogLevels</span><span class="p">,</span> <span class="n">force_raise_exception</span>
|
|
81
|
-
<span class="kn">from</span> <span class="nn">doctest</span> <span class="kn">import</span> <span class="n">TestResults</span><span class="p">,</span> <span class="n">testmod</span>
|
|
82
|
-
<span class="kn">from</span> <span class="nn">types</span> <span class="kn">import</span> <span class="n">ModuleType</span>
|
|
83
|
-
<span class="kn">import</span> <span class="nn">importlib</span>
|
|
84
|
-
<span class="kn">import</span> <span class="nn">pkgutil</span>
|
|
85
|
-
|
|
86
|
-
<span class="k">def</span> <span class="nf">test_module_with_progress</span><span class="p">(</span><span class="n">module</span><span class="p">:</span> <span class="n">ModuleType</span><span class="p">,</span> <span class="n">separator</span><span class="p">:</span> <span class="nb">str</span><span class="p">)</span> <span class="o">-></span> <span class="n">TestResults</span><span class="p">:</span>
|
|
87
|
-
<span class="nd">@measure_time</span><span class="p">(</span><span class="n">progress</span><span class="p">,</span> <span class="n">message</span><span class="o">=</span><span class="sa">f</span><span class="s2">"Testing module '</span><span class="si">{</span><span class="n">module</span><span class="o">.</span><span class="vm">__name__</span><span class="si">}</span><span class="s2">' </span><span class="si">{</span><span class="n">separator</span><span class="si">}</span><span class="s2">took"</span><span class="p">)</span>
|
|
88
|
-
<span class="k">def</span> <span class="nf">internal</span><span class="p">()</span> <span class="o">-></span> <span class="n">TestResults</span><span class="p">:</span>
|
|
89
|
-
<span class="k">return</span> <span class="n">testmod</span><span class="p">(</span><span class="n">m</span><span class="o">=</span><span class="n">module</span><span class="p">)</span>
|
|
90
|
-
<span class="k">return</span> <span class="n">internal</span><span class="p">()</span>
|
|
91
|
-
|
|
92
|
-
<span class="c1"># Main program</span>
|
|
93
|
-
<div class="viewcode-block" id="launch_tests">
|
|
94
|
-
<a class="viewcode-back" href="../../modules/stouputils.all_doctests.html#stouputils.all_doctests.launch_tests">[docs]</a>
|
|
95
|
-
<span class="k">def</span> <span class="nf">launch_tests</span><span class="p">(</span><span class="n">root_dir</span><span class="p">:</span> <span class="nb">str</span><span class="p">,</span> <span class="n">importing_errors</span><span class="p">:</span> <span class="n">LogLevels</span> <span class="o">=</span> <span class="n">LogLevels</span><span class="o">.</span><span class="n">WARNING_TRACEBACK</span><span class="p">,</span> <span class="n">strict</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="kc">True</span><span class="p">)</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
|
96
|
-
<span class="w"> </span><span class="sd">""" Main function to launch tests for all modules in the given directory.</span>
|
|
97
|
-
|
|
98
|
-
<span class="sd"> Args:</span>
|
|
99
|
-
<span class="sd"> root_dir (str): Root directory to search for modules</span>
|
|
100
|
-
<span class="sd"> importing_errors (LogLevels): Log level for the errors when importing modules</span>
|
|
101
|
-
<span class="sd"> strict (bool): Modify the force_raise_exception variable to True in the decorators module</span>
|
|
102
|
-
<span class="sd"> </span>
|
|
103
|
-
<span class="sd"> Examples:</span>
|
|
104
|
-
<span class="sd"> >>> launch_tests("unknown_dir")</span>
|
|
105
|
-
<span class="sd"> Traceback (most recent call last):</span>
|
|
106
|
-
<span class="sd"> ...</span>
|
|
107
|
-
<span class="sd"> ValueError: No modules found in 'unknown_dir'</span>
|
|
108
|
-
|
|
109
|
-
<span class="sd"> .. code-block:: python</span>
|
|
110
|
-
|
|
111
|
-
<span class="sd"> > launch_tests("/path/to/source")</span>
|
|
112
|
-
<span class="sd"> [PROGRESS HH:MM:SS] Importing module 'module1' took 0.001s</span>
|
|
113
|
-
<span class="sd"> [PROGRESS HH:MM:SS] Importing module 'module2' took 0.002s</span>
|
|
114
|
-
<span class="sd"> [PROGRESS HH:MM:SS] Importing module 'module3' took 0.003s</span>
|
|
115
|
-
<span class="sd"> [PROGRESS HH:MM:SS] Importing module 'module4' took 0.004s</span>
|
|
116
|
-
<span class="sd"> [INFO HH:MM:SS] Testing 4 modules...</span>
|
|
117
|
-
<span class="sd"> [PROGRESS HH:MM:SS] Testing module 'module1' took 0.005s</span>
|
|
118
|
-
<span class="sd"> [PROGRESS HH:MM:SS] Testing module 'module2' took 0.006s</span>
|
|
119
|
-
<span class="sd"> [PROGRESS HH:MM:SS] Testing module 'module3' took 0.007s</span>
|
|
120
|
-
<span class="sd"> [PROGRESS HH:MM:SS] Testing module 'module4' took 0.008s</span>
|
|
121
|
-
<span class="sd"> """</span>
|
|
122
|
-
<span class="k">global</span> <span class="n">force_raise_exception</span>
|
|
123
|
-
<span class="k">if</span> <span class="n">strict</span><span class="p">:</span>
|
|
124
|
-
<span class="n">old_value</span><span class="p">:</span> <span class="nb">bool</span> <span class="o">=</span> <span class="n">strict</span>
|
|
125
|
-
<span class="n">force_raise_exception</span> <span class="o">=</span> <span class="kc">True</span>
|
|
126
|
-
<span class="n">strict</span> <span class="o">=</span> <span class="n">old_value</span>
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
<span class="c1"># Get all modules from folder</span>
|
|
130
|
-
<span class="n">sys</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">insert</span><span class="p">(</span><span class="mi">0</span><span class="p">,</span> <span class="n">root_dir</span><span class="p">)</span>
|
|
131
|
-
<span class="n">modules_file_paths</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span>
|
|
132
|
-
<span class="k">for</span> <span class="n">directory_path</span><span class="p">,</span> <span class="n">_</span><span class="p">,</span> <span class="n">_</span> <span class="ow">in</span> <span class="n">os</span><span class="o">.</span><span class="n">walk</span><span class="p">(</span><span class="n">root_dir</span><span class="p">):</span>
|
|
133
|
-
<span class="k">for</span> <span class="n">module_info</span> <span class="ow">in</span> <span class="n">pkgutil</span><span class="o">.</span><span class="n">walk_packages</span><span class="p">([</span><span class="n">directory_path</span><span class="p">]):</span>
|
|
134
|
-
<span class="n">absolute_module_path</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">os</span><span class="o">.</span><span class="n">path</span><span class="o">.</span><span class="n">join</span><span class="p">(</span><span class="n">directory_path</span><span class="p">,</span> <span class="n">module_info</span><span class="o">.</span><span class="n">name</span><span class="p">)</span>
|
|
135
|
-
<span class="n">path</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="n">absolute_module_path</span><span class="o">.</span><span class="n">split</span><span class="p">(</span><span class="n">root_dir</span><span class="p">,</span> <span class="mi">1</span><span class="p">)[</span><span class="mi">1</span><span class="p">]</span><span class="o">.</span><span class="n">replace</span><span class="p">(</span><span class="n">os</span><span class="o">.</span><span class="n">sep</span><span class="p">,</span> <span class="s2">"."</span><span class="p">)[</span><span class="mi">1</span><span class="p">:]</span>
|
|
136
|
-
<span class="k">if</span> <span class="n">path</span> <span class="ow">not</span> <span class="ow">in</span> <span class="n">modules_file_paths</span><span class="p">:</span>
|
|
137
|
-
<span class="n">modules_file_paths</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">path</span><span class="p">)</span>
|
|
138
|
-
<span class="k">if</span> <span class="ow">not</span> <span class="n">modules_file_paths</span><span class="p">:</span>
|
|
139
|
-
<span class="k">raise</span> <span class="ne">ValueError</span><span class="p">(</span><span class="sa">f</span><span class="s2">"No modules found in '</span><span class="si">{</span><span class="n">root_dir</span><span class="si">}</span><span class="s2">'"</span><span class="p">)</span>
|
|
140
|
-
|
|
141
|
-
<span class="c1"># Find longest module path for alignment</span>
|
|
142
|
-
<span class="n">max_length</span><span class="p">:</span> <span class="nb">int</span> <span class="o">=</span> <span class="nb">max</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="n">path</span><span class="p">)</span> <span class="k">for</span> <span class="n">path</span> <span class="ow">in</span> <span class="n">modules_file_paths</span><span class="p">)</span>
|
|
143
|
-
|
|
144
|
-
<span class="c1"># Dynamically import all modules from iacob package recursively using pkgutil and importlib</span>
|
|
145
|
-
<span class="n">modules</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="n">ModuleType</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span>
|
|
146
|
-
<span class="n">separators</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="nb">str</span><span class="p">]</span> <span class="o">=</span> <span class="p">[]</span>
|
|
147
|
-
<span class="k">for</span> <span class="n">module_path</span> <span class="ow">in</span> <span class="n">modules_file_paths</span><span class="p">:</span>
|
|
148
|
-
<span class="n">separator</span><span class="p">:</span> <span class="nb">str</span> <span class="o">=</span> <span class="s2">" "</span> <span class="o">*</span> <span class="p">(</span><span class="n">max_length</span> <span class="o">-</span> <span class="nb">len</span><span class="p">(</span><span class="n">module_path</span><span class="p">))</span>
|
|
149
|
-
<span class="nd">@handle_error</span><span class="p">(</span><span class="n">error_log</span><span class="o">=</span><span class="n">importing_errors</span><span class="p">)</span>
|
|
150
|
-
<span class="nd">@measure_time</span><span class="p">(</span><span class="n">progress</span><span class="p">,</span> <span class="n">message</span><span class="o">=</span><span class="sa">f</span><span class="s2">"Importing module '</span><span class="si">{</span><span class="n">module_path</span><span class="si">}</span><span class="s2">' </span><span class="si">{</span><span class="n">separator</span><span class="si">}</span><span class="s2">took"</span><span class="p">)</span>
|
|
151
|
-
<span class="k">def</span> <span class="nf">internal</span><span class="p">()</span> <span class="o">-></span> <span class="kc">None</span><span class="p">:</span>
|
|
152
|
-
<span class="n">modules</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">importlib</span><span class="o">.</span><span class="n">import_module</span><span class="p">(</span><span class="n">module_path</span><span class="p">))</span>
|
|
153
|
-
<span class="n">separators</span><span class="o">.</span><span class="n">append</span><span class="p">(</span><span class="n">separator</span><span class="p">)</span>
|
|
154
|
-
<span class="n">internal</span><span class="p">()</span>
|
|
155
|
-
|
|
156
|
-
<span class="c1"># Run tests for each module</span>
|
|
157
|
-
<span class="n">info</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Testing </span><span class="si">{</span><span class="nb">len</span><span class="p">(</span><span class="n">modules</span><span class="p">)</span><span class="si">}</span><span class="s2"> modules..."</span><span class="p">)</span>
|
|
158
|
-
<span class="n">separators</span> <span class="o">=</span> <span class="p">[</span><span class="n">s</span> <span class="o">+</span> <span class="s2">" "</span><span class="o">*</span><span class="p">(</span><span class="nb">len</span><span class="p">(</span><span class="s2">"Importing"</span><span class="p">)</span> <span class="o">-</span> <span class="nb">len</span><span class="p">(</span><span class="s2">"Testing"</span><span class="p">))</span> <span class="k">for</span> <span class="n">s</span> <span class="ow">in</span> <span class="n">separators</span><span class="p">]</span>
|
|
159
|
-
<span class="n">results</span><span class="p">:</span> <span class="nb">list</span><span class="p">[</span><span class="n">TestResults</span><span class="p">]</span> <span class="o">=</span> <span class="p">[</span><span class="n">test_module_with_progress</span><span class="p">(</span><span class="n">module</span><span class="p">,</span> <span class="n">separator</span><span class="p">)</span> <span class="k">for</span> <span class="n">module</span><span class="p">,</span> <span class="n">separator</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">modules</span><span class="p">,</span> <span class="n">separators</span><span class="p">)]</span>
|
|
160
|
-
|
|
161
|
-
<span class="c1"># Display any error lines for each module at the end of the script</span>
|
|
162
|
-
<span class="k">for</span> <span class="n">module</span><span class="p">,</span> <span class="n">result</span> <span class="ow">in</span> <span class="nb">zip</span><span class="p">(</span><span class="n">modules</span><span class="p">,</span> <span class="n">results</span><span class="p">):</span>
|
|
163
|
-
<span class="k">if</span> <span class="n">result</span><span class="o">.</span><span class="n">failed</span> <span class="o">></span> <span class="mi">0</span><span class="p">:</span>
|
|
164
|
-
<span class="n">error</span><span class="p">(</span><span class="sa">f</span><span class="s2">"Errors in module </span><span class="si">{</span><span class="n">module</span><span class="o">.</span><span class="vm">__name__</span><span class="si">}</span><span class="s2">"</span><span class="p">,</span> <span class="n">exit</span><span class="o">=</span><span class="kc">False</span><span class="p">)</span>
|
|
165
|
-
|
|
166
|
-
<span class="c1"># Reset force_raise_exception back</span>
|
|
167
|
-
<span class="n">force_raise_exception</span> <span class="o">=</span> <span class="n">strict</span></div>
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
</pre></div>
|
|
171
|
-
|
|
172
|
-
</div>
|
|
173
|
-
</div>
|
|
174
|
-
<footer>
|
|
175
|
-
|
|
176
|
-
<hr/>
|
|
177
|
-
|
|
178
|
-
<div role="contentinfo">
|
|
179
|
-
<p>© Copyright 2024, Stoupy.</p>
|
|
180
|
-
</div>
|
|
181
|
-
|
|
182
|
-
Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
|
|
183
|
-
<a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
|
|
184
|
-
provided by <a href="https://readthedocs.org">Read the Docs</a>.
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
</footer>
|
|
188
|
-
</div>
|
|
189
|
-
</div>
|
|
190
|
-
</section>
|
|
191
|
-
</div>
|
|
192
|
-
<script>
|
|
193
|
-
jQuery(function () {
|
|
194
|
-
SphinxRtdTheme.Navigation.enable(true);
|
|
195
|
-
});
|
|
196
|
-
</script>
|
|
197
|
-
|
|
198
|
-
</body>
|
|
199
|
-
</html>
|