ScriptCollection 4.2.130__py3-none-any.whl → 4.2.131__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.
- ScriptCollection/AnionBuildPlatform.py +9 -9
- ScriptCollection/GeneralUtilities.py +4 -4
- ScriptCollection/OCIImages/OCIImageManager.py +216 -216
- ScriptCollection/ProcessesRunner.py +2 -2
- ScriptCollection/ProgramRunnerSudo.py +110 -110
- ScriptCollection/SCLog.py +6 -6
- ScriptCollection/ScriptCollectionCore.py +3706 -3706
- ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py +2 -2
- ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py +3 -3
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py +8 -8
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py +352 -352
- ScriptCollection/TFCPS/TFCPS_CreateRelease.py +18 -18
- ScriptCollection/TFCPS/TFCPS_Generic.py +44 -44
- ScriptCollection/TFCPS/TFCPS_MergeToMain.py +128 -128
- ScriptCollection/TFCPS/TFCPS_MergeToStable.py +355 -355
- ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py +6 -6
- ScriptCollection/TFCPS/TFCPS_Tools_General.py +1 -1
- ScriptCollection/UnassignedVariablesCheck.py +94 -0
- {scriptcollection-4.2.130.dist-info → scriptcollection-4.2.131.dist-info}/METADATA +1 -1
- {scriptcollection-4.2.130.dist-info → scriptcollection-4.2.131.dist-info}/RECORD +23 -22
- {scriptcollection-4.2.130.dist-info → scriptcollection-4.2.131.dist-info}/WHEEL +0 -0
- {scriptcollection-4.2.130.dist-info → scriptcollection-4.2.131.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.2.130.dist-info → scriptcollection-4.2.131.dist-info}/top_level.txt +0 -0
|
@@ -5,13 +5,13 @@ from ..ScriptCollectionCore import ScriptCollectionCore
|
|
|
5
5
|
from .TFCPS_Tools_General import TFCPS_Tools_General
|
|
6
6
|
|
|
7
7
|
class TFCPS_PreBuildCodeunitsScriptConfiguration:
|
|
8
|
-
targetenvironmenttype:str
|
|
9
|
-
additionalargumentsfile:str
|
|
10
|
-
verbosity:LogLevel
|
|
11
|
-
use_cache:str
|
|
8
|
+
targetenvironmenttype:str = None
|
|
9
|
+
additionalargumentsfile:str = None
|
|
10
|
+
verbosity:LogLevel = None
|
|
11
|
+
use_cache:str = None
|
|
12
12
|
repository_folder:str=None
|
|
13
13
|
sc:ScriptCollectionCore=None
|
|
14
|
-
tfcps_Tools_General:TFCPS_Tools_General
|
|
14
|
+
tfcps_Tools_General:TFCPS_Tools_General = None
|
|
15
15
|
|
|
16
16
|
def __init__(self,script_file:str,targetenvironmenttype:str,additionalargumentsfile:str,verbosity:LogLevel,use_cache:bool):
|
|
17
17
|
self.targetenvironmenttype=targetenvironmenttype
|
|
@@ -24,7 +24,7 @@ class TFCPS_PreBuildCodeunitsScriptConfiguration:
|
|
|
24
24
|
self.tfcps_Tools_General=TFCPS_Tools_General(self.sc)
|
|
25
25
|
|
|
26
26
|
class TFCPS_PreBuildCodeunitsScript:
|
|
27
|
-
configuration:TFCPS_PreBuildCodeunitsScriptConfiguration
|
|
27
|
+
configuration:TFCPS_PreBuildCodeunitsScriptConfiguration = None
|
|
28
28
|
|
|
29
29
|
def __init__(self,configuration:TFCPS_PreBuildCodeunitsScriptConfiguration):
|
|
30
30
|
self.configuration=configuration
|
|
@@ -176,7 +176,7 @@ class TFCPS_Tools_General:
|
|
|
176
176
|
percent = downloaded / total_size * 100
|
|
177
177
|
sys.stdout.write(f"\rDownload: {percent:.2f}%")
|
|
178
178
|
sys.stdout.flush()
|
|
179
|
-
self.__sc.log.log(f"Downloaded \"{
|
|
179
|
+
self.__sc.log.log(f"Downloaded \"{link}\".", LogLevel.Debug)
|
|
180
180
|
if not GeneralUtilities.current_system_is_windows():
|
|
181
181
|
# Downloaded binaries (e.g. cyclonedx-linux-x64) are written without the
|
|
182
182
|
# executable bit; make them runnable so they can be executed directly.
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import ast
|
|
2
|
+
import os
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from .GeneralUtilities import GeneralUtilities
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class UnassignedVariablesCheck:
|
|
8
|
+
"""Detects bare PEP 526 annotation occurrences (`name: Type` without `= ...`) at
|
|
9
|
+
any scope in Python source files.
|
|
10
|
+
|
|
11
|
+
Bare annotations produce inconsistent coverage between Python 3.13 (eager
|
|
12
|
+
evaluation) and 3.14+ (PEP 749 deferred evaluation). Adding an explicit default
|
|
13
|
+
(often `= None`) makes coverage deterministic across versions.
|
|
14
|
+
|
|
15
|
+
Skips class bodies of @dataclass / TypedDict / NamedTuple / BaseModel / Protocol
|
|
16
|
+
(where bare annotations have a defined field-semantic), and skips multi-line
|
|
17
|
+
annotation statements."""
|
|
18
|
+
|
|
19
|
+
@staticmethod
|
|
20
|
+
@GeneralUtilities.check_arguments
|
|
21
|
+
def find(folder: str) -> list[tuple[str, int, str]]:
|
|
22
|
+
"""Recursively walks every *.py file under `folder` and returns all bare
|
|
23
|
+
annotation occurrences. Each tuple is (file_path, line_number, variable_name)."""
|
|
24
|
+
special_decorators = {"dataclass", "attrs", "define", "frozen"}
|
|
25
|
+
special_bases = {"TypedDict", "NamedTuple", "BaseModel", "Protocol"}
|
|
26
|
+
results: list[tuple[str, int, str]] = []
|
|
27
|
+
|
|
28
|
+
def get_name(node):
|
|
29
|
+
if isinstance(node, ast.Name):
|
|
30
|
+
return node.id
|
|
31
|
+
if isinstance(node, ast.Attribute):
|
|
32
|
+
return node.attr
|
|
33
|
+
if isinstance(node, ast.Call):
|
|
34
|
+
return get_name(node.func)
|
|
35
|
+
return None
|
|
36
|
+
|
|
37
|
+
def is_special_class(cls_node) -> bool:
|
|
38
|
+
for decorator in cls_node.decorator_list:
|
|
39
|
+
if get_name(decorator) in special_decorators:
|
|
40
|
+
return True
|
|
41
|
+
for base in cls_node.bases:
|
|
42
|
+
if get_name(base) in special_bases:
|
|
43
|
+
return True
|
|
44
|
+
return False
|
|
45
|
+
|
|
46
|
+
def walk(node, inside_special_class_body: bool, file_path_str: str):
|
|
47
|
+
if isinstance(node, ast.AnnAssign):
|
|
48
|
+
if not inside_special_class_body:
|
|
49
|
+
if node.value is None and isinstance(node.target, ast.Name):
|
|
50
|
+
if getattr(node, "end_lineno", node.lineno) == node.lineno:
|
|
51
|
+
results.append((file_path_str, node.lineno, node.target.id))
|
|
52
|
+
return
|
|
53
|
+
if isinstance(node, ast.ClassDef):
|
|
54
|
+
is_special = is_special_class(node)
|
|
55
|
+
for child in node.body:
|
|
56
|
+
if isinstance(child, (ast.FunctionDef, ast.AsyncFunctionDef, ast.ClassDef)):
|
|
57
|
+
walk(child, False, file_path_str)
|
|
58
|
+
else:
|
|
59
|
+
walk(child, is_special, file_path_str)
|
|
60
|
+
return
|
|
61
|
+
for child in ast.iter_child_nodes(node):
|
|
62
|
+
walk(child, False, file_path_str)
|
|
63
|
+
|
|
64
|
+
for file_path in Path(folder).rglob("*.py"):
|
|
65
|
+
if "__pycache__" in file_path.parts:
|
|
66
|
+
continue
|
|
67
|
+
try:
|
|
68
|
+
source = file_path.read_text(encoding="utf-8")
|
|
69
|
+
except (UnicodeDecodeError, OSError):
|
|
70
|
+
continue
|
|
71
|
+
try:
|
|
72
|
+
tree = ast.parse(source)
|
|
73
|
+
except SyntaxError:
|
|
74
|
+
continue
|
|
75
|
+
walk(tree, False, str(file_path))
|
|
76
|
+
|
|
77
|
+
return results
|
|
78
|
+
|
|
79
|
+
@staticmethod
|
|
80
|
+
@GeneralUtilities.check_arguments
|
|
81
|
+
def assert_no_unassigned_variables_in_codeunit(codeunit_folder: str) -> None:
|
|
82
|
+
"""Convenience helper for testcases. Scans the codeunit's source package
|
|
83
|
+
(`<codeunit_folder>/<codeunit_name>/`) and test package (`<codeunit_folder>/<codeunit_name>Tests/`)
|
|
84
|
+
for bare PEP 526 annotations and raises AssertionError listing all violations
|
|
85
|
+
if any are found."""
|
|
86
|
+
codeunit_name = os.path.basename(codeunit_folder)
|
|
87
|
+
violations: list[str] = []
|
|
88
|
+
for package_name in (codeunit_name, f"{codeunit_name}Tests"):
|
|
89
|
+
package_folder = os.path.join(codeunit_folder, package_name)
|
|
90
|
+
GeneralUtilities.assert_folder_exists(package_folder)
|
|
91
|
+
for file_path, lineno, name in UnassignedVariablesCheck.find(package_folder):
|
|
92
|
+
violations.append(f"{file_path}:{lineno} bare annotation '{name}: Type' - add '= None' (or a real default)")
|
|
93
|
+
if violations:
|
|
94
|
+
raise AssertionError(f"Found {len(violations)} bare annotation(s) in the codebase:\n - " + "\n - ".join(violations))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scriptcollection
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.131
|
|
4
4
|
Summary: The ScriptCollection is the place for reusable scripts.
|
|
5
5
|
Author-email: Marius Göcke <marius.goecke@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/anionDev/ScriptCollection
|
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
ScriptCollection/AnionBuildPlatform.py,sha256=
|
|
1
|
+
ScriptCollection/AnionBuildPlatform.py,sha256=vg1lZ6D1nqq_mO7iYTDSktSImXd34scfPaXiIrbvrg0,11848
|
|
2
2
|
ScriptCollection/CertificateUpdater.py,sha256=dR5JpJDlZdjD4_pgMz7zCrt1IM7VfatmK6pULSczxQw,9693
|
|
3
3
|
ScriptCollection/Executables.py,sha256=zWI6RxMnJ1n8K76hkauBlnSbhd3vKBwJrwNAXx6sqGQ,50087
|
|
4
|
-
ScriptCollection/GeneralUtilities.py,sha256=
|
|
4
|
+
ScriptCollection/GeneralUtilities.py,sha256=lO5fk57tzrUkk9653eWTYP8mROZ6KAJgk7jcyov-Jvw,67700
|
|
5
5
|
ScriptCollection/HTTPMaintenanceOverheadHelper.py,sha256=TToNtyO1XzsMbBsTBf3o0xgOK0v4Jf03qw2Z0xb2nCk,2007
|
|
6
|
-
ScriptCollection/ProcessesRunner.py,sha256=
|
|
6
|
+
ScriptCollection/ProcessesRunner.py,sha256=yYaC95h40uszuZPggn2kK3qXIN2ZjGMCavo-NQ53ElQ,1537
|
|
7
7
|
ScriptCollection/ProgramRunnerBase.py,sha256=eZenpiIFW1dhvSVCG7cfBs5hO4_KLlOxR7oXoSxUDmk,2286
|
|
8
8
|
ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrRjAPIwT5Y,37
|
|
9
9
|
ScriptCollection/ProgramRunnerPopen.py,sha256=8tP0xWKeRYoGlaNB3iUh4o61O-tKtcxrS7IUqtU85C4,4091
|
|
10
|
-
ScriptCollection/ProgramRunnerSudo.py,sha256=
|
|
11
|
-
ScriptCollection/SCLog.py,sha256=
|
|
12
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
10
|
+
ScriptCollection/ProgramRunnerSudo.py,sha256=RXsiceQ8W6a8YDk_2BPscVbIAmDIpIxqe9WHBy2r4CM,5233
|
|
11
|
+
ScriptCollection/SCLog.py,sha256=3zsTioEvoIjHUcaDuKkYbiHV8jnRxPvCGIAc1wWdSro,4812
|
|
12
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=53zwyIDWyGic3eOEnlR8II_MI4BSJG5cM-mReIalFoo,210348
|
|
13
|
+
ScriptCollection/UnassignedVariablesCheck.py,sha256=v59qLQ5RRvx31ouuCW7NWZj3McWENvGBPkV5ZGBmqJE,4344
|
|
13
14
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
15
|
ScriptCollection/OCIImages/AbstractImageHandler.py,sha256=o129UYDtLymCRjMZBP9Puaj19ueMHoNt6UTLspfnaRc,1758
|
|
15
|
-
ScriptCollection/OCIImages/OCIImageManager.py,sha256
|
|
16
|
+
ScriptCollection/OCIImages/OCIImageManager.py,sha256=-xanWakEZBEWbgrA1IKzY1hYBWo2j_Juk2hDJPTvwiE,12674
|
|
16
17
|
ScriptCollection/OCIImages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
18
|
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebian.py,sha256=rty9SnftreYWLIwvdUn4LhiHqCTevb_tWuYWoOnRJuo,732
|
|
18
19
|
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebianSlim.py,sha256=M-4qxKWBZRtKdYQ-uXgfrxRBoZTXEjgqCxFXyFxTyzc,736
|
|
@@ -24,22 +25,22 @@ ScriptCollection/OCIImages/ConcreteImageHandlers/__init__.py,sha256=47DEQpj8HBSa
|
|
|
24
25
|
ScriptCollection/Resources/CultureChooser/CultureChooser.js,sha256=5-4pwGDq5j1UnpTZy850ZMoxlM9tYPeu781QpZBtCWM,951
|
|
25
26
|
ScriptCollection/Resources/CultureChooser/index.html,sha256=gxQzbrSp4WU52TqN-gcBEtz2gJXmmM14OwTSFtFVRvw,276
|
|
26
27
|
ScriptCollection/Resources/MaintenanceSite/MaintenanceSite.html,sha256=CX9S1bdOz6xU2aGfr03tJRGczQrlpn-IeODc15d5kc0,232
|
|
27
|
-
ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=
|
|
28
|
-
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=
|
|
29
|
-
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=
|
|
30
|
-
ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=
|
|
31
|
-
ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=
|
|
32
|
-
ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=
|
|
33
|
-
ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=
|
|
34
|
-
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=
|
|
35
|
-
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=
|
|
28
|
+
ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=sWnTspNrdwWFuPNX0dCZYFv7U0ggtUL_-iYqToaYSV4,28896
|
|
29
|
+
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=QFNqmnixlfzMFSCstZUK27PzOWevFvnK9EhIDozRKLE,9273
|
|
30
|
+
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=AVHQCgIQfDSkjvTW5lFQ0V9RAwiLIbaAsBxG9CL_8v4,20147
|
|
31
|
+
ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=X2NgZgbOkJsdZ6wMHB_RuS_rQCuz5oQCqzYrxyXBN9Q,6680
|
|
32
|
+
ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=5vCFfDiU8bvfcnoKNs2ATS8nsl6mYXcIuX7XfYE0tvg,2116
|
|
33
|
+
ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=BsSV4a-NZY86MZ20d-_rYxNVAI4UzAfmEwXlRZ8qWQc,7685
|
|
34
|
+
ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=QRm8n1qH8H_XbJhGCbzwdNr9KSEy0WkbG7ulpc4Md3U,22696
|
|
35
|
+
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=JYiDqDsfVJQWS9xWMi_UzfXnXsJRnPRxAzFr82bUEvI,2370
|
|
36
|
+
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=PsvFjsvsHJ6wRJld2MHUh2F4hLKk91yBj7XeDBYspAA,111129
|
|
36
37
|
ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
38
|
ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=wS2yzYUmJ4m0cf6cBYVTHsiXSXfYhHoLFFy8x6yEQvY,19573
|
|
38
39
|
ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
39
40
|
ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationBase.py,sha256=bT6Gd5pQpZCw4OQz6HWkPCSn5z__eUUEisABLDSxd0o,200
|
|
40
41
|
ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationGenerate.py,sha256=QyjOfMY22JWCvKjMelHiDWbJiWqotOfebpJpgDUaoO4,237
|
|
41
42
|
ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationNoGenerate.py,sha256=i0zEGehj0sttxjjZtoq2KFSKp_ulxVyWp_ZgAhIY_So,241
|
|
42
|
-
ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=
|
|
43
|
+
ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=Smh1IAoNIkUey8d-BnIOS43dL1ijK7-CxbT_JYM1bhE,40778
|
|
43
44
|
ScriptCollection/TFCPS/DotNet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
44
45
|
ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py,sha256=KAjyFyEjpkghsVPskfsHD68k4Z92gRCT_q6BXfikRwE,7660
|
|
45
46
|
ScriptCollection/TFCPS/Flutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -53,8 +54,8 @@ ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=fqGhXNx8tK
|
|
|
53
54
|
ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
54
55
|
ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=WhOsMpJxNGqnQGA3nJ99ruyqymxBeJxCcpK98zJduTo,1680
|
|
55
56
|
ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
|
-
scriptcollection-4.2.
|
|
57
|
-
scriptcollection-4.2.
|
|
58
|
-
scriptcollection-4.2.
|
|
59
|
-
scriptcollection-4.2.
|
|
60
|
-
scriptcollection-4.2.
|
|
57
|
+
scriptcollection-4.2.131.dist-info/METADATA,sha256=ipp1-KPfoSU0bs2yliWUnJmjg141sLsB2zL7PPyhSM8,7697
|
|
58
|
+
scriptcollection-4.2.131.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
59
|
+
scriptcollection-4.2.131.dist-info/entry_points.txt,sha256=ySZ09rptnBxyfpU-K62zmoUFH-0xWZUxzoPScoXubrg,5045
|
|
60
|
+
scriptcollection-4.2.131.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
61
|
+
scriptcollection-4.2.131.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|