ScriptCollection 4.4.23__py3-none-any.whl → 4.4.25__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/Executables.py +0 -2
- ScriptCollection/OCIImages/OCIImageManager.py +39 -1
- ScriptCollection/ScriptCollectionCore.py +40 -1
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py +11 -0
- ScriptCollection/TFCPS/TFCPS_Tools_General.py +7 -2
- {scriptcollection-4.4.23.dist-info → scriptcollection-4.4.25.dist-info}/METADATA +169 -169
- {scriptcollection-4.4.23.dist-info → scriptcollection-4.4.25.dist-info}/RECORD +10 -10
- {scriptcollection-4.4.23.dist-info → scriptcollection-4.4.25.dist-info}/WHEEL +0 -0
- {scriptcollection-4.4.23.dist-info → scriptcollection-4.4.25.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.4.23.dist-info → scriptcollection-4.4.25.dist-info}/top_level.txt +0 -0
ScriptCollection/Executables.py
CHANGED
|
@@ -1214,7 +1214,6 @@ def ReclaimSpaceFromDocker()->int:
|
|
|
1214
1214
|
|
|
1215
1215
|
|
|
1216
1216
|
def AddImageToCustomRegistry()->int:
|
|
1217
|
-
sc = ScriptCollectionCore()
|
|
1218
1217
|
parser = argparse.ArgumentParser()
|
|
1219
1218
|
parser.add_argument('-r', '--remotehub', required=True)
|
|
1220
1219
|
parser.add_argument('-i', '--imagenameonremotehub', required=True)
|
|
@@ -1225,7 +1224,6 @@ def AddImageToCustomRegistry()->int:
|
|
|
1225
1224
|
parser.add_argument('-p', '--password', required=False,default=None)
|
|
1226
1225
|
verbosity_values = ", ".join(f"{lvl.value}={lvl.name}" for lvl in LogLevel)
|
|
1227
1226
|
parser.add_argument('-v', '--verbosity', required=False, default=3, help=f"Sets the loglevel. Possible values: {verbosity_values}")
|
|
1228
|
-
parser.add_argument('-r', '--removeimagelocally', action='store_true', default=False)
|
|
1229
1227
|
args = parser.parse_args()
|
|
1230
1228
|
sc:ScriptCollectionCore=ScriptCollectionCore()
|
|
1231
1229
|
verbosity=int(args.verbosity)
|
|
@@ -17,11 +17,15 @@ class OCIImageManager:
|
|
|
17
17
|
|
|
18
18
|
__sc:ScriptCollectionCore=None
|
|
19
19
|
image_handler:list[AbstractImageHandler] = None
|
|
20
|
+
#image-names for which it was already logged that the fallback-registry is used. The lookup happens for every image of
|
|
21
|
+
#the repository and often several times per build, so without this the same hint would flood the log.
|
|
22
|
+
__images_with_reported_fallback_registry:set[str] = None
|
|
20
23
|
|
|
21
24
|
def __init__(self,sc:ScriptCollectionCore):
|
|
22
25
|
if sc is None:
|
|
23
26
|
sc=ScriptCollectionCore()
|
|
24
27
|
self.__sc=sc
|
|
28
|
+
self.__images_with_reported_fallback_registry=set()
|
|
25
29
|
self.image_handler=[
|
|
26
30
|
ImageHandlerDebian(),
|
|
27
31
|
ImageHandlerDebianSlim(),
|
|
@@ -44,7 +48,18 @@ class OCIImageManager:
|
|
|
44
48
|
return os.path.join(repository,".ScriptCollection","OCIImages","ImageDefinition.csv")
|
|
45
49
|
|
|
46
50
|
@GeneralUtilities.check_arguments
|
|
47
|
-
def
|
|
51
|
+
def get_image_registries_file_in_container(self)->str:
|
|
52
|
+
"""Returns the file inside a build-container to which the host mounts its image-registries-file (see
|
|
53
|
+
TFCPS_CodeUnit_BuildCodeUnits.__run_scriptcollection_executable_in_container). It is an own path (and not the
|
|
54
|
+
configuration-folder of the container-user) because the home-folder inside the container depends on the user the
|
|
55
|
+
image runs as, while this path is defined by the mount and is therefore identical for both sides."""
|
|
56
|
+
return "/Workspace/ScriptCollectionConfiguration/OCIImages/ImageRegistries.csv"
|
|
57
|
+
|
|
58
|
+
@GeneralUtilities.check_arguments
|
|
59
|
+
def get_image_registries_file_in_configuration_folder(self)->str:
|
|
60
|
+
"""Returns the image-registries-file in the configuration-folder of the current user, and creates it if it does not exist yet.
|
|
61
|
+
This is the file of the machine on which a command was started, so it is also the file which is mounted into a build-container
|
|
62
|
+
(in contrast to get_global_docker_image_registries_file, which inside a container resolves to that mount instead)."""
|
|
48
63
|
folder=os.path.join(self.__sc.get_global_cache_folder(),"OCIImages")
|
|
49
64
|
GeneralUtilities.ensure_directory_exists(folder)
|
|
50
65
|
result=os.path.join(folder,"ImageRegistries.csv")
|
|
@@ -52,6 +67,17 @@ class OCIImageManager:
|
|
|
52
67
|
GeneralUtilities.ensure_file_exists(result)
|
|
53
68
|
GeneralUtilities.write_lines_to_file(result,["ImageName;RegistryAddress"])
|
|
54
69
|
return result
|
|
70
|
+
|
|
71
|
+
@GeneralUtilities.check_arguments
|
|
72
|
+
def get_global_docker_image_registries_file(self)->str:
|
|
73
|
+
"""Returns the machine-wide file which maps an image-name to the custom registry-address the image should be taken from.
|
|
74
|
+
The file which the host mounted into a build-container has precedence over the file in the configuration-folder of the
|
|
75
|
+
current user: in a container that configuration-folder belongs to the container-user and therefore never contains the
|
|
76
|
+
configuration of the machine on which the build was started."""
|
|
77
|
+
mounted_file=self.get_image_registries_file_in_container()
|
|
78
|
+
if os.path.isfile(mounted_file):
|
|
79
|
+
return mounted_file
|
|
80
|
+
return self.get_image_registries_file_in_configuration_folder()
|
|
55
81
|
|
|
56
82
|
@GeneralUtilities.check_arguments
|
|
57
83
|
def get_used_images_in_repository(self,repository:str)->list[str]:
|
|
@@ -93,9 +119,21 @@ class OCIImageManager:
|
|
|
93
119
|
repository_image_definition_file=self.get_repository_image_definition_file(repository)
|
|
94
120
|
for line in [f.split(";") for f in GeneralUtilities.read_nonempty_lines_from_file(repository_image_definition_file)[1:]]:
|
|
95
121
|
if image_name==line[0]:
|
|
122
|
+
self.__report_usage_of_fallback_registry(image_name,line[1])
|
|
96
123
|
return line[1]
|
|
97
124
|
raise ValueError(f"No registry defined for image \"{image_name}\".")
|
|
98
125
|
|
|
126
|
+
@GeneralUtilities.check_arguments
|
|
127
|
+
def __report_usage_of_fallback_registry(self,image_name:str,fallback_registry_address:str)->None:
|
|
128
|
+
"""Logs that the image is taken from the upstream-registry defined in the repository because no custom registry is defined for it.
|
|
129
|
+
The fallback exists so that a freshly cloned product is buildable without further setup, but an upstream-registry is typically
|
|
130
|
+
rate-limited, so using it is worth a hint."""
|
|
131
|
+
if image_name in self.__images_with_reported_fallback_registry:
|
|
132
|
+
return
|
|
133
|
+
self.__images_with_reported_fallback_registry.add(image_name)
|
|
134
|
+
registries_file=self.get_global_docker_image_registries_file()
|
|
135
|
+
self.__sc.log.log(f"No custom registry is defined for image \"{image_name}\" in \"{registries_file}\", so the fallback-registry \"{fallback_registry_address}\" is used.",LogLevel.Warning)
|
|
136
|
+
|
|
99
137
|
@GeneralUtilities.check_arguments
|
|
100
138
|
def get_registry_address_for_image_with_default_tag(self,repository:str,image_name:str)->str:
|
|
101
139
|
return f"{self.get_registry_address_for_image(repository,image_name)}:{self.get_tag_for_image(repository,image_name)}"
|
|
@@ -40,7 +40,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
|
|
|
40
40
|
from .ProgramRunnerPopen import ProgramRunnerPopen
|
|
41
41
|
from .SCLog import SCLog, LogLevel
|
|
42
42
|
|
|
43
|
-
version = "4.4.
|
|
43
|
+
version = "4.4.25"
|
|
44
44
|
__version__ = version
|
|
45
45
|
|
|
46
46
|
class VSCodeWorkspaceShellTask:
|
|
@@ -2136,6 +2136,45 @@ resolving a name requires fontconfig, which does not exist on every system ffmpe
|
|
|
2136
2136
|
sorted_versions = sorted(versions, key=cmp_to_key(my_comparer))
|
|
2137
2137
|
return sorted_versions[-1]
|
|
2138
2138
|
|
|
2139
|
+
@GeneralUtilities.check_arguments
|
|
2140
|
+
def get_latest_apk_package_version_in_alpine(self, image: str, package: str) -> str:
|
|
2141
|
+
# docker run --rm <image> sh -c "apk update && apk policy <package>"
|
|
2142
|
+
# "apk policy" prints one block per package: a headline "<package> policy:", then for each available version
|
|
2143
|
+
# a line "<version>:" followed by the repositories which provide that version.
|
|
2144
|
+
image_address, image_tag = ScriptCollectionCore.split_image_address_and_tag(image)
|
|
2145
|
+
self.docker_pull(image_address, image_tag)
|
|
2146
|
+
output = self.run_with_epew("docker", f"run --rm {image} sh -c \"apk update && apk policy {package}\"", os.getcwd(), encode_argument_in_base64=True)
|
|
2147
|
+
stdout = output[1]
|
|
2148
|
+
lines = GeneralUtilities.string_to_lines(stdout)
|
|
2149
|
+
headline = f"{package} policy:"
|
|
2150
|
+
GeneralUtilities.assert_condition(headline in lines, f"No policy for package '{package}' found in image '{image}'.")
|
|
2151
|
+
# After the headline of the package each available version is one line "<version>:" followed by one line per
|
|
2152
|
+
# repository which provides that version. Only the version-lines end with a colon and contain no whitespace.
|
|
2153
|
+
lines_of_package = lines[lines.index(headline)+1:]
|
|
2154
|
+
version_matches = [re.fullmatch(r"(\S+):", line) for line in lines_of_package]
|
|
2155
|
+
versions = [version_match.group(1) for version_match in version_matches if version_match is not None]
|
|
2156
|
+
GeneralUtilities.assert_condition(0 < len(versions), f"No version found for package '{package}' in image '{image}'.")
|
|
2157
|
+
|
|
2158
|
+
def my_comparer(a: str, b: str) -> int:
|
|
2159
|
+
# return:
|
|
2160
|
+
# -1 → a < b
|
|
2161
|
+
# 0 → a = b
|
|
2162
|
+
# 1 → a > b
|
|
2163
|
+
# apk version -t <a> <b> → prints the relation of a to b as "<", "=" or ">"
|
|
2164
|
+
result = self.run_program_argsasarray("docker", ["run", "--rm", image, "apk", "version", "-t", a, b])
|
|
2165
|
+
relation = result[1].strip()
|
|
2166
|
+
if relation == "<":
|
|
2167
|
+
return -1
|
|
2168
|
+
elif relation == ">":
|
|
2169
|
+
return 1
|
|
2170
|
+
elif relation == "=":
|
|
2171
|
+
return 0
|
|
2172
|
+
else:
|
|
2173
|
+
raise ValueError(f"Unexpected output of \"apk version -t {a} {b}\": \"{relation}\"")
|
|
2174
|
+
|
|
2175
|
+
sorted_versions = sorted(versions, key=cmp_to_key(my_comparer))
|
|
2176
|
+
return sorted_versions[-1]
|
|
2177
|
+
|
|
2139
2178
|
@GeneralUtilities.check_arguments
|
|
2140
2179
|
def run_testcases_for_python_project(self, repository_folder: str):
|
|
2141
2180
|
self.assert_is_git_repository(repository_folder)
|
|
@@ -402,6 +402,17 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
402
402
|
if os.path.isdir(custom_scripts_folder_for_inside_the_container):
|
|
403
403
|
mount_arguments += ["-v", f"{custom_scripts_folder_for_inside_the_container}:{self.tfcps_tools_general.get_folder_of_custom_scripts_in_container()}"]
|
|
404
404
|
|
|
405
|
+
#mount the machine-wide image-registries-file of this host (if it exists), so the build inside the container takes the images from the same
|
|
406
|
+
#custom registries as a build on the host. Without the mount the build in the container would find no mapping at all - the
|
|
407
|
+
#configuration-folder inside the container belongs to the container-user and is empty - and would therefore fall back to the
|
|
408
|
+
#upstream-registries defined in the repository, which are rate-limited. The mount is read-only because a build never changes the file.
|
|
409
|
+
#Only this file is mounted and not the whole configuration-folder, so nothing else of it (in particular not EnvironmentVariables.csv or
|
|
410
|
+
#RegistryCredentials.csv, which contain credentials) is exposed to the container.
|
|
411
|
+
oci_image_manager = self.tfcps_tools_general.oci_image_manager
|
|
412
|
+
image_registries_file: str = oci_image_manager.get_image_registries_file_in_configuration_folder()
|
|
413
|
+
if os.path.isfile(image_registries_file):
|
|
414
|
+
mount_arguments += ["-v", f"{image_registries_file}:{oci_image_manager.get_image_registries_file_in_container()}:ro"]
|
|
415
|
+
|
|
405
416
|
#pass the environment-variables which are declared as required in <repository>/.ScriptCollection/ProductInformation.xml into the container
|
|
406
417
|
#so they do not have to be specified explicitly on every call. Their values are resolved from the user-specific
|
|
407
418
|
#configuration-file (see TFCPS_Tools_General.get_environment_variables_configuration_file), which only exists on the host.
|
|
@@ -1808,13 +1808,18 @@ class TFCPS_Tools_General:
|
|
|
1808
1808
|
changed on purpose therefore needs this - it says "this is the new state" - and the changed lock-files belong to
|
|
1809
1809
|
the commit of that change.
|
|
1810
1810
|
No runtime is named, so the restore resolves the runtimes which the projects state and writes one lock-file per
|
|
1811
|
-
project which covers all of them.
|
|
1811
|
+
project which covers all of them.
|
|
1812
|
+
"--force" is required because a restore whose inputs did not change since the last restore is skipped entirely
|
|
1813
|
+
(no-op restore) and then writes no lock-file at all. "--force-evaluate" is required because without it an existing
|
|
1814
|
+
lock-file is taken as it is instead of being resolved again."""
|
|
1812
1815
|
codeunit_name: str = os.path.basename(codeunit_folder)
|
|
1813
1816
|
sln_file: str = os.path.join(codeunit_folder, f"{codeunit_name}.sln")
|
|
1814
1817
|
if not os.path.isfile(sln_file):
|
|
1815
1818
|
raise ValueError(f"The codeunit-folder \"{codeunit_folder}\" does not contain the solution \"{codeunit_name}.sln\", so it is no dotnet-codeunit whose lock-files could be updated.")
|
|
1816
1819
|
self.__sc.log.log(f"Update the lock-files of codeunit \"{codeunit_name}\"...")
|
|
1817
|
-
|
|
1820
|
+
GeneralUtilities.ensure_file_exists(os.path.join(codeunit_folder, codeunit_name,"packages.lock.json"))
|
|
1821
|
+
GeneralUtilities.ensure_file_exists(os.path.join(codeunit_folder, codeunit_name+"Tests","packages.lock.json"))
|
|
1822
|
+
self.__sc.run_program_argsasarray("dotnet", ["restore", sln_file, "--force", "--force-evaluate"], codeunit_folder)
|
|
1818
1823
|
|
|
1819
1824
|
@GeneralUtilities.check_arguments
|
|
1820
1825
|
def get_dependency_version_in_resources_folder(self, resources_folder:str, dependency_name: str) ->str:
|
|
@@ -1,169 +1,169 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: scriptcollection
|
|
3
|
-
Version: 4.4.
|
|
4
|
-
Summary: The ScriptCollection is the place for reusable scripts.
|
|
5
|
-
Author-email: Marius Göcke <marius.goecke@gmail.com>
|
|
6
|
-
Project-URL: Homepage, https://github.com/anionDev/ScriptCollection
|
|
7
|
-
Project-URL: Documentation, https://aniondev.github.io/ScriptCollectionReference/index.html
|
|
8
|
-
Project-URL: Changelog, https://github.com/anionDev/ScriptCollection/tree/main/Other/Resources/Changelog
|
|
9
|
-
Keywords: package,release,build,management
|
|
10
|
-
Classifier: Intended Audience :: Developers
|
|
11
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
-
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
14
|
-
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
-
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
|
|
16
|
-
Classifier: Topic :: System :: Logging
|
|
17
|
-
Classifier: Topic :: System :: Monitoring
|
|
18
|
-
Classifier: Topic :: System :: Archiving :: Packaging
|
|
19
|
-
Classifier: Topic :: System :: Systems Administration
|
|
20
|
-
Classifier: Topic :: Terminals
|
|
21
|
-
Classifier: Topic :: Utilities
|
|
22
|
-
Requires-Python: >=3.11
|
|
23
|
-
Description-Content-Type: text/markdown
|
|
24
|
-
Requires-Dist: build>=1.5.0
|
|
25
|
-
Requires-Dist: CountryInformation>=1.0.12
|
|
26
|
-
Requires-Dist: coverage>=7.15.2
|
|
27
|
-
Requires-Dist: cyclonedx-bom>=7.1.0
|
|
28
|
-
Requires-Dist: defusedxml>=0.7.1
|
|
29
|
-
Requires-Dist: keyboard>=0.13.5
|
|
30
|
-
Requires-Dist: lcov-cobertura>=2.1.1
|
|
31
|
-
Requires-Dist: lxml>=6.0.1
|
|
32
|
-
Requires-Dist: ntplib>=0.4.0
|
|
33
|
-
Requires-Dist: Pillow>=11.3.0
|
|
34
|
-
Requires-Dist: psutil>=7.2.2
|
|
35
|
-
Requires-Dist: pycdlib>=1.16.0
|
|
36
|
-
Requires-Dist: Pygments>=2.20.0
|
|
37
|
-
Requires-Dist: pylint>=4.0.6
|
|
38
|
-
Requires-Dist: pyOpenSSL>=25.3.0
|
|
39
|
-
Requires-Dist: PyPDF>=6.14.2
|
|
40
|
-
Requires-Dist: pytest>=8.4.2
|
|
41
|
-
Requires-Dist: PyYAML>=6.0.3
|
|
42
|
-
Requires-Dist: qrcode>=8.2.0
|
|
43
|
-
Requires-Dist: send2trash>=1.8.3
|
|
44
|
-
Requires-Dist: twine>=6.2.0
|
|
45
|
-
Requires-Dist: xmlschema>=4.3.2
|
|
46
|
-
|
|
47
|
-
# ScriptCollection
|
|
48
|
-
|
|
49
|
-
## General
|
|
50
|
-
|
|
51
|
-
[](https://pypi.org/project/ScriptCollection/)
|
|
52
|
-

|
|
53
|
-

|
|
54
|
-
|
|
55
|
-
[](https://www.codefactor.io/repository/github/anionDevevlopment/scriptcollection/overview/main)
|
|
56
|
-
[](https://pepy.tech/project/scriptcollection)
|
|
57
|
-

|
|
58
|
-
|
|
59
|
-
The ScriptCollection is the place for reusable scripts.
|
|
60
|
-
|
|
61
|
-
## Reference
|
|
62
|
-
|
|
63
|
-
The reference can be found [here](https://aniondev.github.io/ScriptCollectionReference/index.html).
|
|
64
|
-
|
|
65
|
-
## Hints
|
|
66
|
-
|
|
67
|
-
Most of the scripts are written in [python](https://www.python.org) 3.
|
|
68
|
-
|
|
69
|
-
Caution: Before executing **any** script of this repository read the sourcecode of the script (and the sourcecode of all functions called by this function directly or transitively) carefully and verify that the script does exactly what you want to do and nothing else.
|
|
70
|
-
|
|
71
|
-
Some functions are not entirely available on windows or require common third-party tools. See the [Runtime dependencies](#runtime-dependencies)-section for more information.
|
|
72
|
-
|
|
73
|
-
When using ScriptCollection it is not required but recommended for better usability to have [epew](https://github.com/anionDev/Epew) installed.
|
|
74
|
-
|
|
75
|
-
## Get ScriptCollection
|
|
76
|
-
|
|
77
|
-
### Installation via pip
|
|
78
|
-
|
|
79
|
-
`pip3 install ScriptCollection`
|
|
80
|
-
|
|
81
|
-
See the [PyPI-site for ScriptCollection](https://pypi.org/project/ScriptCollection)
|
|
82
|
-
|
|
83
|
-
### Download sourcecode using git
|
|
84
|
-
|
|
85
|
-
You can simply git-clone the ScriptCollection and then use the scripts under the provided license.
|
|
86
|
-
|
|
87
|
-
`git clone https://github.com/anionDevevlopment/ScriptCollection.git`
|
|
88
|
-
|
|
89
|
-
It may be more easy to pip-install the ScriptCollection but technically pip is not required. Actually you need to git-clone (or download as zip-file from [GitHub](https://github.com/anionDevevlopment/ScriptCollection) the ScriptCollection to use the scripts in this repository which are not written in python.
|
|
90
|
-
|
|
91
|
-
## Troubleshooting
|
|
92
|
-
|
|
93
|
-
It is recommended to always use only the newest version of the ScriptCollection. If you have an older version: Update it (e. g. using `pip3 install ScriptCollection --upgrade` if you installed the ScriptCollection via pip). If you still have problems, then feel free to create an [issue](https://github.com/anionDevevlopment/ScriptCollection/issues).
|
|
94
|
-
|
|
95
|
-
If you have installed the ScriptCollection as pip-package you can simply check the version using Python with the following commands:
|
|
96
|
-
|
|
97
|
-
```lang-bash
|
|
98
|
-
from ScriptCollection.ScriptCollectionCore import ScriptCollectionCore
|
|
99
|
-
ScriptCollectionCore.get_scriptcollection_version()
|
|
100
|
-
```
|
|
101
|
-
|
|
102
|
-
Or you can simply run `pip3 freeze` folder to get information about (all) currently installed pip-packages.
|
|
103
|
-
|
|
104
|
-
## Development
|
|
105
|
-
|
|
106
|
-
### Branching-system
|
|
107
|
-
|
|
108
|
-
This repository applies the [GitFlowSimplified](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/BranchingSystem/GitFlowSimplified/GitFlowSimplified.md)-branching-system.
|
|
109
|
-
|
|
110
|
-
### Repository-structure
|
|
111
|
-
|
|
112
|
-
This repository applies the [CommonProjectStructure](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/RepositoryStructure/CommonProjectStructure/CommonProjectStructure.md)-branching-system.
|
|
113
|
-
|
|
114
|
-
### Install dependencies
|
|
115
|
-
|
|
116
|
-
ScriptCollection requires [Python](https://www.python.org) 3.10.
|
|
117
|
-
|
|
118
|
-
To develop ScriptCollection it is obviously required that the following commandline-commands are available on your system:
|
|
119
|
-
|
|
120
|
-
- `python` (on some systems `python3`)
|
|
121
|
-
- `pip3`
|
|
122
|
-
|
|
123
|
-
The pip-packages which are required for developing on this project are defined in `requirements.txt`.
|
|
124
|
-
|
|
125
|
-
### IDE
|
|
126
|
-
|
|
127
|
-
The recommended IDE for developing ScriptCollection is Visual Studio Code.
|
|
128
|
-
The recommended addons for developing ScriptCollection with Visual Studio Code are:
|
|
129
|
-
|
|
130
|
-
- [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance)
|
|
131
|
-
- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
|
|
132
|
-
- [Spell Right](https://marketplace.visualstudio.com/items?itemName=ban.spellright)
|
|
133
|
-
- [docs-markdown](https://marketplace.visualstudio.com/items?itemName=docsmsft.docs-markdown)
|
|
134
|
-
|
|
135
|
-
### Build
|
|
136
|
-
|
|
137
|
-
To create and install an ScriptCollection locally simply do the following commands:
|
|
138
|
-
|
|
139
|
-
```bash
|
|
140
|
-
python ./ScriptCollection/Other/Build/Build.py
|
|
141
|
-
pip3 install --force-reinstall ./ScriptCollection/Other/Artifacts/Wheel/ScriptCollection-x.x.x-py3-none-any.whl
|
|
142
|
-
```
|
|
143
|
-
|
|
144
|
-
(Note: `x.x.x` must be replaced by the appropriate version-number.)
|
|
145
|
-
|
|
146
|
-
### Coding style
|
|
147
|
-
|
|
148
|
-
In this repository [pylint](https://pylint.org/) will be used to report linting-issues.
|
|
149
|
-
If you change code in this repository please ensure pylint does not find any issues before creating a pull-request.
|
|
150
|
-
|
|
151
|
-
If linting-issues exist in the current code-base can be checked by running `python ./ScriptCollection/Other/QualityCheck/Linting.py`.
|
|
152
|
-
|
|
153
|
-
## Runtime dependencies
|
|
154
|
-
|
|
155
|
-
ScriptCollection requires [Python](https://www.python.org) 3.10.
|
|
156
|
-
|
|
157
|
-
The usual Python-dependencies will be installed automagically by `pip`.
|
|
158
|
-
|
|
159
|
-
For functions to to read or change the permissions or the owner of a file the ScriptCollection relies on the functionality of the following tools:
|
|
160
|
-
|
|
161
|
-
- chmod
|
|
162
|
-
- chown
|
|
163
|
-
- ls
|
|
164
|
-
|
|
165
|
-
This tools must be available on the system where the functions should be executed. Meanwhile this tools are also available on Windows but may have a slightly limited functionality.
|
|
166
|
-
|
|
167
|
-
## License
|
|
168
|
-
|
|
169
|
-
See [License.txt](https://raw.githubusercontent.com/anionDevevlopment/ScriptCollection/main/License.txt) for license-information.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: scriptcollection
|
|
3
|
+
Version: 4.4.25
|
|
4
|
+
Summary: The ScriptCollection is the place for reusable scripts.
|
|
5
|
+
Author-email: Marius Göcke <marius.goecke@gmail.com>
|
|
6
|
+
Project-URL: Homepage, https://github.com/anionDev/ScriptCollection
|
|
7
|
+
Project-URL: Documentation, https://aniondev.github.io/ScriptCollectionReference/index.html
|
|
8
|
+
Project-URL: Changelog, https://github.com/anionDev/ScriptCollection/tree/main/Other/Resources/Changelog
|
|
9
|
+
Keywords: package,release,build,management
|
|
10
|
+
Classifier: Intended Audience :: Developers
|
|
11
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
12
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
13
|
+
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
|
|
14
|
+
Classifier: Operating System :: POSIX :: Linux
|
|
15
|
+
Classifier: Operating System :: Microsoft :: Windows :: Windows 10
|
|
16
|
+
Classifier: Topic :: System :: Logging
|
|
17
|
+
Classifier: Topic :: System :: Monitoring
|
|
18
|
+
Classifier: Topic :: System :: Archiving :: Packaging
|
|
19
|
+
Classifier: Topic :: System :: Systems Administration
|
|
20
|
+
Classifier: Topic :: Terminals
|
|
21
|
+
Classifier: Topic :: Utilities
|
|
22
|
+
Requires-Python: >=3.11
|
|
23
|
+
Description-Content-Type: text/markdown
|
|
24
|
+
Requires-Dist: build>=1.5.0
|
|
25
|
+
Requires-Dist: CountryInformation>=1.0.12
|
|
26
|
+
Requires-Dist: coverage>=7.15.2
|
|
27
|
+
Requires-Dist: cyclonedx-bom>=7.1.0
|
|
28
|
+
Requires-Dist: defusedxml>=0.7.1
|
|
29
|
+
Requires-Dist: keyboard>=0.13.5
|
|
30
|
+
Requires-Dist: lcov-cobertura>=2.1.1
|
|
31
|
+
Requires-Dist: lxml>=6.0.1
|
|
32
|
+
Requires-Dist: ntplib>=0.4.0
|
|
33
|
+
Requires-Dist: Pillow>=11.3.0
|
|
34
|
+
Requires-Dist: psutil>=7.2.2
|
|
35
|
+
Requires-Dist: pycdlib>=1.16.0
|
|
36
|
+
Requires-Dist: Pygments>=2.20.0
|
|
37
|
+
Requires-Dist: pylint>=4.0.6
|
|
38
|
+
Requires-Dist: pyOpenSSL>=25.3.0
|
|
39
|
+
Requires-Dist: PyPDF>=6.14.2
|
|
40
|
+
Requires-Dist: pytest>=8.4.2
|
|
41
|
+
Requires-Dist: PyYAML>=6.0.3
|
|
42
|
+
Requires-Dist: qrcode>=8.2.0
|
|
43
|
+
Requires-Dist: send2trash>=1.8.3
|
|
44
|
+
Requires-Dist: twine>=6.2.0
|
|
45
|
+
Requires-Dist: xmlschema>=4.3.2
|
|
46
|
+
|
|
47
|
+
# ScriptCollection
|
|
48
|
+
|
|
49
|
+
## General
|
|
50
|
+
|
|
51
|
+
[](https://pypi.org/project/ScriptCollection/)
|
|
52
|
+

|
|
53
|
+

|
|
54
|
+
|
|
55
|
+
[](https://www.codefactor.io/repository/github/anionDevevlopment/scriptcollection/overview/main)
|
|
56
|
+
[](https://pepy.tech/project/scriptcollection)
|
|
57
|
+

|
|
58
|
+
|
|
59
|
+
The ScriptCollection is the place for reusable scripts.
|
|
60
|
+
|
|
61
|
+
## Reference
|
|
62
|
+
|
|
63
|
+
The reference can be found [here](https://aniondev.github.io/ScriptCollectionReference/index.html).
|
|
64
|
+
|
|
65
|
+
## Hints
|
|
66
|
+
|
|
67
|
+
Most of the scripts are written in [python](https://www.python.org) 3.
|
|
68
|
+
|
|
69
|
+
Caution: Before executing **any** script of this repository read the sourcecode of the script (and the sourcecode of all functions called by this function directly or transitively) carefully and verify that the script does exactly what you want to do and nothing else.
|
|
70
|
+
|
|
71
|
+
Some functions are not entirely available on windows or require common third-party tools. See the [Runtime dependencies](#runtime-dependencies)-section for more information.
|
|
72
|
+
|
|
73
|
+
When using ScriptCollection it is not required but recommended for better usability to have [epew](https://github.com/anionDev/Epew) installed.
|
|
74
|
+
|
|
75
|
+
## Get ScriptCollection
|
|
76
|
+
|
|
77
|
+
### Installation via pip
|
|
78
|
+
|
|
79
|
+
`pip3 install ScriptCollection`
|
|
80
|
+
|
|
81
|
+
See the [PyPI-site for ScriptCollection](https://pypi.org/project/ScriptCollection)
|
|
82
|
+
|
|
83
|
+
### Download sourcecode using git
|
|
84
|
+
|
|
85
|
+
You can simply git-clone the ScriptCollection and then use the scripts under the provided license.
|
|
86
|
+
|
|
87
|
+
`git clone https://github.com/anionDevevlopment/ScriptCollection.git`
|
|
88
|
+
|
|
89
|
+
It may be more easy to pip-install the ScriptCollection but technically pip is not required. Actually you need to git-clone (or download as zip-file from [GitHub](https://github.com/anionDevevlopment/ScriptCollection) the ScriptCollection to use the scripts in this repository which are not written in python.
|
|
90
|
+
|
|
91
|
+
## Troubleshooting
|
|
92
|
+
|
|
93
|
+
It is recommended to always use only the newest version of the ScriptCollection. If you have an older version: Update it (e. g. using `pip3 install ScriptCollection --upgrade` if you installed the ScriptCollection via pip). If you still have problems, then feel free to create an [issue](https://github.com/anionDevevlopment/ScriptCollection/issues).
|
|
94
|
+
|
|
95
|
+
If you have installed the ScriptCollection as pip-package you can simply check the version using Python with the following commands:
|
|
96
|
+
|
|
97
|
+
```lang-bash
|
|
98
|
+
from ScriptCollection.ScriptCollectionCore import ScriptCollectionCore
|
|
99
|
+
ScriptCollectionCore.get_scriptcollection_version()
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
Or you can simply run `pip3 freeze` folder to get information about (all) currently installed pip-packages.
|
|
103
|
+
|
|
104
|
+
## Development
|
|
105
|
+
|
|
106
|
+
### Branching-system
|
|
107
|
+
|
|
108
|
+
This repository applies the [GitFlowSimplified](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/BranchingSystem/GitFlowSimplified/GitFlowSimplified.md)-branching-system.
|
|
109
|
+
|
|
110
|
+
### Repository-structure
|
|
111
|
+
|
|
112
|
+
This repository applies the [CommonProjectStructure](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/RepositoryStructure/CommonProjectStructure/CommonProjectStructure.md)-branching-system.
|
|
113
|
+
|
|
114
|
+
### Install dependencies
|
|
115
|
+
|
|
116
|
+
ScriptCollection requires [Python](https://www.python.org) 3.10.
|
|
117
|
+
|
|
118
|
+
To develop ScriptCollection it is obviously required that the following commandline-commands are available on your system:
|
|
119
|
+
|
|
120
|
+
- `python` (on some systems `python3`)
|
|
121
|
+
- `pip3`
|
|
122
|
+
|
|
123
|
+
The pip-packages which are required for developing on this project are defined in `requirements.txt`.
|
|
124
|
+
|
|
125
|
+
### IDE
|
|
126
|
+
|
|
127
|
+
The recommended IDE for developing ScriptCollection is Visual Studio Code.
|
|
128
|
+
The recommended addons for developing ScriptCollection with Visual Studio Code are:
|
|
129
|
+
|
|
130
|
+
- [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance)
|
|
131
|
+
- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
|
|
132
|
+
- [Spell Right](https://marketplace.visualstudio.com/items?itemName=ban.spellright)
|
|
133
|
+
- [docs-markdown](https://marketplace.visualstudio.com/items?itemName=docsmsft.docs-markdown)
|
|
134
|
+
|
|
135
|
+
### Build
|
|
136
|
+
|
|
137
|
+
To create and install an ScriptCollection locally simply do the following commands:
|
|
138
|
+
|
|
139
|
+
```bash
|
|
140
|
+
python ./ScriptCollection/Other/Build/Build.py
|
|
141
|
+
pip3 install --force-reinstall ./ScriptCollection/Other/Artifacts/Wheel/ScriptCollection-x.x.x-py3-none-any.whl
|
|
142
|
+
```
|
|
143
|
+
|
|
144
|
+
(Note: `x.x.x` must be replaced by the appropriate version-number.)
|
|
145
|
+
|
|
146
|
+
### Coding style
|
|
147
|
+
|
|
148
|
+
In this repository [pylint](https://pylint.org/) will be used to report linting-issues.
|
|
149
|
+
If you change code in this repository please ensure pylint does not find any issues before creating a pull-request.
|
|
150
|
+
|
|
151
|
+
If linting-issues exist in the current code-base can be checked by running `python ./ScriptCollection/Other/QualityCheck/Linting.py`.
|
|
152
|
+
|
|
153
|
+
## Runtime dependencies
|
|
154
|
+
|
|
155
|
+
ScriptCollection requires [Python](https://www.python.org) 3.10.
|
|
156
|
+
|
|
157
|
+
The usual Python-dependencies will be installed automagically by `pip`.
|
|
158
|
+
|
|
159
|
+
For functions to to read or change the permissions or the owner of a file the ScriptCollection relies on the functionality of the following tools:
|
|
160
|
+
|
|
161
|
+
- chmod
|
|
162
|
+
- chown
|
|
163
|
+
- ls
|
|
164
|
+
|
|
165
|
+
This tools must be available on the system where the functions should be executed. Meanwhile this tools are also available on Windows but may have a slightly limited functionality.
|
|
166
|
+
|
|
167
|
+
## License
|
|
168
|
+
|
|
169
|
+
See [License.txt](https://raw.githubusercontent.com/anionDevevlopment/ScriptCollection/main/License.txt) for license-information.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
ScriptCollection/AnionBuildPlatform.py,sha256=LF9b4f4iqgsjgXZjS0RHiEBw73tQANfu0O1dYGWNjy8,11948
|
|
2
2
|
ScriptCollection/ArbTranslationsOrganizer.py,sha256=FLJcNP6qFTQOkxL7es0Sq3O7kb_TgoRreqH-uogR4xA,12201
|
|
3
3
|
ScriptCollection/CertificateUpdater.py,sha256=bD0VhKQsD2cNRTG1kzMkhgpd0BZw7igbG30goKw5p1A,9749
|
|
4
|
-
ScriptCollection/Executables.py,sha256=
|
|
4
|
+
ScriptCollection/Executables.py,sha256=Ovq6LVhtP6mqCPmBxch9WgTmePBk7F8MLyZUBkQloAE,74171
|
|
5
5
|
ScriptCollection/GeneralUtilities.py,sha256=7iirl-TItW5UDIOC8osY8chb0nFbPz6QQmVBsbgQgIA,72016
|
|
6
6
|
ScriptCollection/HTTPMaintenanceOverheadHelper.py,sha256=TToNtyO1XzsMbBsTBf3o0xgOK0v4Jf03qw2Z0xb2nCk,2007
|
|
7
7
|
ScriptCollection/ProcessesRunner.py,sha256=Va9O-ohWoRfe4pO2gPBzc940gkM5BpP4Txcu1CmLOvg,1494
|
|
@@ -12,12 +12,12 @@ ScriptCollection/ProgramRunnerSudo.py,sha256=ot9Ib-plQ8wejR9M2XXfnx6GR-va9k8SH1g
|
|
|
12
12
|
ScriptCollection/RepositoryDiagramGenerator.py,sha256=K_u2NW_p4ozdWD50irJEkkcDVa70TcUJpZN63TeXSLw,7092
|
|
13
13
|
ScriptCollection/RepositoryHistoryAnalyzer.py,sha256=rD8eC5lMUe5MHmCBHfYft_G-N9IbvtsFGkU7EMwPjrY,5779
|
|
14
14
|
ScriptCollection/SCLog.py,sha256=Fjf8Pdi63cXHGMxL_aI6A0dwGm7QIfrv3czjvpSUlaM,4705
|
|
15
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
15
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=hB-3zF0AM6VIFK2VLCV0zytXTogChBQSzmU-tAheXHs,276146
|
|
16
16
|
ScriptCollection/TestKind.py,sha256=EBTLR8yBz5VmWA2NZIpDTbQNg6tkfv_kAsIzEJ--mCI,1756
|
|
17
17
|
ScriptCollection/UnassignedVariablesCheck.py,sha256=8xNcp1D5HeOLO1a1NEerq2TsnpFhw7yzYPkaay-oisY,3804
|
|
18
18
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
19
19
|
ScriptCollection/OCIImages/AbstractImageHandler.py,sha256=WO2M28c2tUwsXFNa2L9zqMhdlyObWm3qpPE0LdIs7SE,2315
|
|
20
|
-
ScriptCollection/OCIImages/OCIImageManager.py,sha256=
|
|
20
|
+
ScriptCollection/OCIImages/OCIImageManager.py,sha256=Xfp8ZawYC04_isfeSLm97xW83OhQtdo7j1wyRvmDOqE,20302
|
|
21
21
|
ScriptCollection/OCIImages/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
22
22
|
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebian.py,sha256=rty9SnftreYWLIwvdUn4LhiHqCTevb_tWuYWoOnRJuo,732
|
|
23
23
|
ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebianSlim.py,sha256=M-4qxKWBZRtKdYQ-uXgfrxRBoZTXEjgqCxFXyFxTyzc,736
|
|
@@ -37,7 +37,7 @@ ScriptCollection/TFCPS/SCTaskRunnerServer.py,sha256=tub8_1QBu0nWAaGnBWp2nErOW-SO
|
|
|
37
37
|
ScriptCollection/TFCPS/TFCPS_BuildCodeUnitsHook.py,sha256=67_DQwoH5bhxxSmwtuAeoW1NOCMiLMzOy48OqlJX-KY,1744
|
|
38
38
|
ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=aCfGCbevCOV1IJ444dhvwJkGDKQNH3mqIucPAuSUq-o,40149
|
|
39
39
|
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=Mj9t1SyRpkYZE74cLsGWYv4xB89gXL2ld-RX3xvvGdw,9835
|
|
40
|
-
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=
|
|
40
|
+
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=l8xfp7n-gDF_cwngox6gJkv5ShHP0oGSBzVXENj-3bM,48546
|
|
41
41
|
ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=kpEmSnfzfgB4OjcCuS_X6jgW_ftcphxEnjjoLoAHTLY,6582
|
|
42
42
|
ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=mRBcf7XuNWOSXbZYc3NuJow18AMZ30D6Z-BtyNYfNcM,2072
|
|
43
43
|
ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=Krt5oyGNcRAN3szsgU7LoTh8yVTOdHW-Kq7R9MDDV-Q,7673
|
|
@@ -45,7 +45,7 @@ ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=oYEhz5ZWMnbu97_CcYEqdDxakUF
|
|
|
45
45
|
ScriptCollection/TFCPS/TFCPS_OCIImageSecretScan.py,sha256=rhw0glr4gZ5enG9faOD51xE4MMK1cIdNjUdaswiMsrY,14622
|
|
46
46
|
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=XLVsFTA1jvfDbZ7wYJgIdEByZhF_bYVbA5jkisuvK4k,2322
|
|
47
47
|
ScriptCollection/TFCPS/TFCPS_RemoteBuild.py,sha256=gQQbk7Va7c_0VL2pu_UYM-GPkbQxe0vvs2D_gJdZulI,21103
|
|
48
|
-
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=
|
|
48
|
+
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=49gtLQO_V3T9SYiuIp9sqDxSZ4BSWhl8GD7BEV-Hils,159611
|
|
49
49
|
ScriptCollection/TFCPS/TFCPS_VisualRegressionTests.py,sha256=6_63udxHnPlu_TMk_ftLZTnzriJO8MCxVCVAsweZqHs,37073
|
|
50
50
|
ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
51
51
|
ScriptCollection/TFCPS/CPP/TFCPS_CodeUnitSpecific_CPP.py,sha256=4skj2I73VOo93HMXcBuWmdyuoE9zjqr2H_DtsYrcvNo,16375
|
|
@@ -71,8 +71,8 @@ ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=yyjWPMHQjPLkML
|
|
|
71
71
|
ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
72
72
|
ScriptCollection/TFCPS/TypeScript/TFCPS_CodeUnitSpecific_TypeScript.py,sha256=5z990qyO5durX07xRWRwju1hl6wpjQAy2f-yRwJ-7s0,11856
|
|
73
73
|
ScriptCollection/TFCPS/TypeScript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
|
-
scriptcollection-4.4.
|
|
75
|
-
scriptcollection-4.4.
|
|
76
|
-
scriptcollection-4.4.
|
|
77
|
-
scriptcollection-4.4.
|
|
78
|
-
scriptcollection-4.4.
|
|
74
|
+
scriptcollection-4.4.25.dist-info/METADATA,sha256=4F_dHPXNqIZSmIMid4geNr10Zm7R3XMlbl15PNIR3lQ,7690
|
|
75
|
+
scriptcollection-4.4.25.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
76
|
+
scriptcollection-4.4.25.dist-info/entry_points.txt,sha256=GNma7tN0J59EvK71su-G1w22RnZ05bXcPrELyLx3AL0,6151
|
|
77
|
+
scriptcollection-4.4.25.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
78
|
+
scriptcollection-4.4.25.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|