ScriptCollection 4.4.71__py3-none-any.whl → 4.4.72__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 +3 -3
- ScriptCollection/GeneralUtilities.py +42 -0
- ScriptCollection/OCIImages/AbstractImageHandler.py +14 -26
- ScriptCollection/OCIImages/AbstractTagPatternImageHandler.py +46 -0
- ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebian.py +5 -14
- ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerDebianSlim.py +5 -14
- ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGeneric.py +6 -15
- ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGenericV.py +6 -15
- ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGitlabCE.py +7 -8
- ScriptCollection/OCIImages/ConcreteImageHandlers/ImageHandlerGitlabEE.py +7 -8
- ScriptCollection/OCIImages/OCIImageManager.py +73 -68
- ScriptCollection/OCIImages/OCIRegistryClient.py +117 -0
- ScriptCollection/ScriptCollectionCore.py +9 -4
- ScriptCollection/TFCPS/Android/TFCPS_CodeUnitSpecific_Android.py +375 -0
- ScriptCollection/TFCPS/Android/__init__.py +0 -0
- ScriptCollection/TFCPS/CPP/TFCPS_CodeUnitSpecific_CPP.py +5 -4
- ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py +38 -4
- ScriptCollection/TFCPS/Maven/TFCPS_CodeUnitSpecific_Maven.py +1 -0
- ScriptCollection/TFCPS/Rust/CargoLockFile.py +151 -0
- ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py +5 -0
- ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py +1 -0
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py +14 -0
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py +19 -0
- ScriptCollection/TFCPS/TFCPS_Tools_General.py +15 -2
- {scriptcollection-4.4.71.dist-info → scriptcollection-4.4.72.dist-info}/METADATA +177 -177
- {scriptcollection-4.4.71.dist-info → scriptcollection-4.4.72.dist-info}/RECORD +29 -24
- {scriptcollection-4.4.71.dist-info → scriptcollection-4.4.72.dist-info}/WHEEL +0 -0
- {scriptcollection-4.4.71.dist-info → scriptcollection-4.4.72.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.4.71.dist-info → scriptcollection-4.4.72.dist-info}/top_level.txt +0 -0
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import re
|
|
3
|
+
import tomllib
|
|
4
|
+
from ...GeneralUtilities import GeneralUtilities
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class CargoLockFile:
|
|
8
|
+
"""Synchronizes the versions of the local packages in a "Cargo.lock"-file with the versions which their
|
|
9
|
+
"Cargo.toml"-files declare.
|
|
10
|
+
|
|
11
|
+
A local package is a package which is not resolved from a registry or a git-repository: the cargo-project itself
|
|
12
|
+
and every path-dependency (directly or transitively). Cargo writes such a package into the lock-file without a
|
|
13
|
+
"source"-entry, together with the version its cargo-file declared at the time the lock-file was written. When the
|
|
14
|
+
version in a cargo-file changes (which happens on every new version of a codeunit), the lock-file is outdated and
|
|
15
|
+
a build with "--locked" fails. Cargo can not update the lock-file without being allowed to resolve the dependencies
|
|
16
|
+
again, so the versions of the local packages are adjusted textually here: everything else in the lock-file stays
|
|
17
|
+
exactly as it is, no network-access is required and running it again does not change anything anymore."""
|
|
18
|
+
|
|
19
|
+
__dependency_sections: tuple = ("dependencies", "dev-dependencies", "build-dependencies")
|
|
20
|
+
# Cargo uses this version for a package whose cargo-file does not declare a version
|
|
21
|
+
# (see https://doc.rust-lang.org/cargo/reference/manifest.html#the-version-field).
|
|
22
|
+
__version_of_package_without_declared_version: str = "0.0.0"
|
|
23
|
+
|
|
24
|
+
@staticmethod
|
|
25
|
+
@GeneralUtilities.check_arguments
|
|
26
|
+
def synchronize_versions_of_local_packages(cargo_file: str) -> None:
|
|
27
|
+
"""Sets the version of every local package in the lock-file next to the given cargo-file to the version
|
|
28
|
+
which the cargo-file of that package declares. A cargo-project without lock-file (for example a library,
|
|
29
|
+
which usually does not commit its lock-file) is left as it is."""
|
|
30
|
+
lock_file = os.path.join(os.path.dirname(cargo_file), "Cargo.lock")
|
|
31
|
+
if os.path.isfile(lock_file):
|
|
32
|
+
CargoLockFile.set_versions_of_local_packages(lock_file, CargoLockFile.get_versions_of_local_packages(cargo_file))
|
|
33
|
+
|
|
34
|
+
@staticmethod
|
|
35
|
+
@GeneralUtilities.check_arguments
|
|
36
|
+
def get_versions_of_local_packages(cargo_file: str) -> dict[str, str]:
|
|
37
|
+
"""Returns the names and the versions of the package of the given cargo-file and of all of its (also
|
|
38
|
+
transitive) path-dependencies, read from their cargo-files."""
|
|
39
|
+
result: dict[str, str] = {}
|
|
40
|
+
CargoLockFile.__add_versions_of_local_packages(os.path.abspath(cargo_file), result, set())
|
|
41
|
+
return result
|
|
42
|
+
|
|
43
|
+
@staticmethod
|
|
44
|
+
@GeneralUtilities.check_arguments
|
|
45
|
+
def __add_versions_of_local_packages(cargo_file: str, result: dict[str, str], visited_cargo_files: set[str]) -> None:
|
|
46
|
+
if cargo_file in visited_cargo_files:
|
|
47
|
+
return
|
|
48
|
+
visited_cargo_files.add(cargo_file)
|
|
49
|
+
GeneralUtilities.assert_file_exists(cargo_file, f'The cargo-file "{cargo_file}" does not exist. If it belongs to a dependent codeunit, then this codeunit must be built before.')
|
|
50
|
+
content: dict = tomllib.loads(GeneralUtilities.read_text_from_file(cargo_file))
|
|
51
|
+
package: dict = content.get("package")
|
|
52
|
+
GeneralUtilities.assert_condition(package is not None, f'The cargo-file "{cargo_file}" does not contain a package-section.')
|
|
53
|
+
version = package.get("version", CargoLockFile.__version_of_package_without_declared_version)
|
|
54
|
+
GeneralUtilities.assert_condition(isinstance(version, str), f'The version of the package in "{cargo_file}" is not declared as plain version-string, which is not supported.')
|
|
55
|
+
result[package["name"]] = version
|
|
56
|
+
cargo_project_folder = os.path.dirname(cargo_file)
|
|
57
|
+
for relative_path in CargoLockFile.__get_paths_of_path_dependencies(content):
|
|
58
|
+
dependency_cargo_file = os.path.abspath(os.path.join(cargo_project_folder, relative_path, "Cargo.toml"))
|
|
59
|
+
CargoLockFile.__add_versions_of_local_packages(dependency_cargo_file, result, visited_cargo_files)
|
|
60
|
+
|
|
61
|
+
@staticmethod
|
|
62
|
+
@GeneralUtilities.check_arguments
|
|
63
|
+
def __get_paths_of_path_dependencies(cargo_file_content: dict) -> list[str]:
|
|
64
|
+
# Dependencies can be declared in the top-level-sections and in the target-specific sections
|
|
65
|
+
# (for example "[target.'cfg(windows)'.dependencies]").
|
|
66
|
+
dependency_tables: list[dict] = [cargo_file_content.get(section, {}) for section in CargoLockFile.__dependency_sections]
|
|
67
|
+
for target_content in cargo_file_content.get("target", {}).values():
|
|
68
|
+
dependency_tables.extend(target_content.get(section, {}) for section in CargoLockFile.__dependency_sections)
|
|
69
|
+
result: list[str] = []
|
|
70
|
+
for dependency_table in dependency_tables:
|
|
71
|
+
for declaration in dependency_table.values():
|
|
72
|
+
if isinstance(declaration, dict) and "path" in declaration:
|
|
73
|
+
result.append(declaration["path"])
|
|
74
|
+
return result
|
|
75
|
+
|
|
76
|
+
@staticmethod
|
|
77
|
+
@GeneralUtilities.check_arguments
|
|
78
|
+
def set_versions_of_local_packages(lock_file: str, versions_of_local_packages: dict[str, str]) -> None:
|
|
79
|
+
"""Sets the version of every package of the lock-file which has no source and whose name is contained in
|
|
80
|
+
the given dictionary to the version stated there. A package of the lock-file which is not contained in the
|
|
81
|
+
dictionary is not changed. The line-endings and all other lines of the lock-file are preserved."""
|
|
82
|
+
lines: list[str] = GeneralUtilities.read_text_from_file(lock_file).splitlines(keepends=True)
|
|
83
|
+
packages = CargoLockFile.__parse_packages(lines)
|
|
84
|
+
changed_references: dict[str, str] = {}
|
|
85
|
+
for package in packages:
|
|
86
|
+
name: str = package["name"]
|
|
87
|
+
if package["has_source"] or name not in versions_of_local_packages or package["version_line_index"] is None:
|
|
88
|
+
continue
|
|
89
|
+
old_version: str = package["version"]
|
|
90
|
+
new_version: str = versions_of_local_packages[name]
|
|
91
|
+
if old_version != new_version:
|
|
92
|
+
line_index: int = package["version_line_index"]
|
|
93
|
+
lines[line_index] = CargoLockFile.__replace_quoted_value(lines[line_index], old_version, new_version)
|
|
94
|
+
# A dependency is referenced as "<name> <version>" instead of "<name>" when the lock-file contains
|
|
95
|
+
# several packages with this name. Such a reference must be changed together with the version. When a
|
|
96
|
+
# package from a registry has the same name and the same old version, then the reference can not be
|
|
97
|
+
# assigned unambiguously to the local package, so it is not changed.
|
|
98
|
+
if not any(other["has_source"] and other["name"] == name and other["version"] == old_version for other in packages):
|
|
99
|
+
changed_references[f"{name} {old_version}"] = f"{name} {new_version}"
|
|
100
|
+
if len(changed_references) > 0:
|
|
101
|
+
for package in packages:
|
|
102
|
+
for line_index in range(package["start_line_index"], package["end_line_index"]):
|
|
103
|
+
lines[line_index] = CargoLockFile.__replace_dependency_reference(lines[line_index], changed_references)
|
|
104
|
+
GeneralUtilities.write_text_to_file(lock_file, "".join(lines))
|
|
105
|
+
|
|
106
|
+
@staticmethod
|
|
107
|
+
@GeneralUtilities.check_arguments
|
|
108
|
+
def __parse_packages(lines: list[str]) -> list[dict]:
|
|
109
|
+
"""Returns the "[[package]]"-entries of the lines of a lock-file with their name, their version, the index of
|
|
110
|
+
the line which contains the version, the information whether they have a source and the range of their
|
|
111
|
+
lines (the end-index is exclusive)."""
|
|
112
|
+
result: list[dict] = []
|
|
113
|
+
current_package: dict = None
|
|
114
|
+
for line_index, line in enumerate(lines):
|
|
115
|
+
stripped_line = line.strip()
|
|
116
|
+
if stripped_line.startswith("["):
|
|
117
|
+
if current_package is not None:
|
|
118
|
+
current_package["end_line_index"] = line_index
|
|
119
|
+
result.append(current_package)
|
|
120
|
+
current_package = None
|
|
121
|
+
if stripped_line == "[[package]]":
|
|
122
|
+
current_package = {"name": None, "version": None, "version_line_index": None, "has_source": False, "start_line_index": line_index}
|
|
123
|
+
continue
|
|
124
|
+
if current_package is None:
|
|
125
|
+
continue
|
|
126
|
+
match = re.match(r'^(name|version|source)\s*=\s*"([^"]*)"$', stripped_line)
|
|
127
|
+
if match is not None:
|
|
128
|
+
key = match.group(1)
|
|
129
|
+
if key == "source":
|
|
130
|
+
current_package["has_source"] = True
|
|
131
|
+
else:
|
|
132
|
+
current_package[key] = match.group(2)
|
|
133
|
+
if key == "version":
|
|
134
|
+
current_package["version_line_index"] = line_index
|
|
135
|
+
if current_package is not None:
|
|
136
|
+
current_package["end_line_index"] = len(lines)
|
|
137
|
+
result.append(current_package)
|
|
138
|
+
return result
|
|
139
|
+
|
|
140
|
+
@staticmethod
|
|
141
|
+
@GeneralUtilities.check_arguments
|
|
142
|
+
def __replace_quoted_value(line: str, old_value: str, new_value: str) -> str:
|
|
143
|
+
return line.replace(f'"{old_value}"', f'"{new_value}"', 1)
|
|
144
|
+
|
|
145
|
+
@staticmethod
|
|
146
|
+
@GeneralUtilities.check_arguments
|
|
147
|
+
def __replace_dependency_reference(line: str, changed_references: dict[str, str]) -> str:
|
|
148
|
+
match = re.match(r'^(\s*)"([^"]+)"(.*)$', line, re.DOTALL)
|
|
149
|
+
if match is not None and match.group(2) in changed_references:
|
|
150
|
+
return f'{match.group(1)}"{changed_references[match.group(2)]}"{match.group(3)}'
|
|
151
|
+
return line
|
|
@@ -6,6 +6,7 @@ from lxml import etree
|
|
|
6
6
|
from ...GeneralUtilities import GeneralUtilities, Dependency
|
|
7
7
|
from ...SCLog import LogLevel
|
|
8
8
|
from ..TFCPS_CodeUnitSpecific_Base import TFCPS_CodeUnitSpecific_Base, TFCPS_CodeUnitSpecific_Base_CLI
|
|
9
|
+
from .CargoLockFile import CargoLockFile
|
|
9
10
|
|
|
10
11
|
class TFCPS_CodeUnitSpecific_Rust_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
11
12
|
"""Implements the tasks of a codeunit which contains a cargo-project.
|
|
@@ -65,6 +66,7 @@ class TFCPS_CodeUnitSpecific_Rust_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
65
66
|
|
|
66
67
|
@GeneralUtilities.check_arguments
|
|
67
68
|
def linting(self) -> None:
|
|
69
|
+
self._protected_sc.normalize_invisible_characters_of_files_in_folder(self.get_codeunit_folder(), ["rs"])
|
|
68
70
|
# "--all-targets" includes the testcases in the check, and "-D warnings" makes clippy exit with a non-zero
|
|
69
71
|
# exit-code for a warning as well, because a warning is a linting-issue too.
|
|
70
72
|
self.__run_cargo("clippy --all-targets --all-features -- -D warnings")
|
|
@@ -73,6 +75,9 @@ class TFCPS_CodeUnitSpecific_Rust_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
73
75
|
def do_common_tasks(self, current_codeunit_version: str) -> None:
|
|
74
76
|
self.do_common_tasks_base(current_codeunit_version)
|
|
75
77
|
self.__set_version_in_cargo_file(self.get_version_of_project())
|
|
78
|
+
# The lock-file contains the versions of the local packages (this project and its path-dependencies, for
|
|
79
|
+
# example the copies of dependent codeunits), so it must be adjusted to the versions of their cargo-files.
|
|
80
|
+
CargoLockFile.synchronize_versions_of_local_packages(self.get_cargo_file())
|
|
76
81
|
|
|
77
82
|
@GeneralUtilities.check_arguments
|
|
78
83
|
def generate_reference(self) -> None:
|
|
@@ -102,6 +102,7 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
|
|
|
102
102
|
if len(dependency_versions)==1:
|
|
103
103
|
GeneralUtilities.write_message_to_stdout("Update dependency "+dependencyname+" (which is currently used in version "+dependency_version+") to version "+desired_version+".")
|
|
104
104
|
self.set_dependency_version(dependencyname,desired_version)
|
|
105
|
+
self.tfcps_Tools_General.log_newer_major_versions_of_dependency(dependencyname,available_versions,desired_version)
|
|
105
106
|
except Exception:
|
|
106
107
|
GeneralUtilities.write_message_to_stderr(f"Error while updating {dependencyname}.")
|
|
107
108
|
raise
|
|
@@ -34,6 +34,19 @@ class TFCPS_CodeUnit_BuildCodeUnit:
|
|
|
34
34
|
self.is_pre_merge=is_pre_merge
|
|
35
35
|
self.fast_lane=fast_lane
|
|
36
36
|
|
|
37
|
+
def __check_article_links(self) -> None:
|
|
38
|
+
reference_content_folder: str = os.path.join(self.codeunit_folder, "Other", "Reference", "ReferenceContent")
|
|
39
|
+
articles_folder: str = os.path.join(reference_content_folder, "Articles")
|
|
40
|
+
if not os.path.isdir(articles_folder):
|
|
41
|
+
return
|
|
42
|
+
index_file: str = os.path.join(reference_content_folder, "index.md")
|
|
43
|
+
index_content: str = GeneralUtilities.read_text_from_file(index_file)
|
|
44
|
+
GeneralUtilities.assert_file_exists(index_file)
|
|
45
|
+
for article_file in sorted(os.listdir(articles_folder)):
|
|
46
|
+
if article_file.lower().endswith(".md") and os.path.isfile(os.path.join(articles_folder, article_file)):
|
|
47
|
+
if f"(./Articles/{article_file})" not in index_content:
|
|
48
|
+
self.sc.log.log(f"Article \"{article_file}\" is not linked in \"{index_file}\".", LogLevel.Warning)
|
|
49
|
+
|
|
37
50
|
@GeneralUtilities.check_arguments
|
|
38
51
|
def build_codeunit(self) -> None:
|
|
39
52
|
codeunit_file: str = str(os.path.join(self.codeunit_folder, f"{self.codeunit_name}.codeunit.xml"))
|
|
@@ -77,6 +90,7 @@ class TFCPS_CodeUnit_BuildCodeUnit:
|
|
|
77
90
|
self.sc.log.log(line, LogLevel.Warning)
|
|
78
91
|
for line in GeneralUtilities.string_to_lines(linting_result[2]):
|
|
79
92
|
self.sc.log.log(line, LogLevel.Warning)
|
|
93
|
+
self.__check_article_links()
|
|
80
94
|
|
|
81
95
|
self.sc.log.log("Generate reference...")
|
|
82
96
|
try:
|
|
@@ -441,6 +441,25 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
441
441
|
if os.path.isfile(openspec_configuration_file):
|
|
442
442
|
self.sc.log.log("Update openspec-instruction-files...")
|
|
443
443
|
self.sc.run_with_epew("openspec", "update --force", self.repository)
|
|
444
|
+
self.__replace_openspec_skill_links_by_copies()
|
|
445
|
+
|
|
446
|
+
@GeneralUtilities.check_arguments
|
|
447
|
+
def __replace_openspec_skill_links_by_copies(self) -> None:
|
|
448
|
+
"""openspec (since v2.0.0) writes its skills to '.agents/skills' and links them into the skill-folders of the configured tools
|
|
449
|
+
(for example '.claude/skills') if the operating-system allows to create symbolic links, otherwise it writes copies. openspec has no
|
|
450
|
+
option to always write copies, so the links are replaced by copies here. This way the content of the repository does not depend on
|
|
451
|
+
the operating-system on which the build ran.
|
|
452
|
+
The skill-folders of all tools are located in folders in the root of the repository whose names start with a dot, so only these
|
|
453
|
+
folders are searched (and not for example the codeunit-folders, which may contain large folders like 'node_modules').
|
|
454
|
+
Submodules are not changed, because their content belongs to another repository."""
|
|
455
|
+
shared_skills_folder: str = os.path.join(self.repository, ".agents", "skills")
|
|
456
|
+
if os.path.isdir(shared_skills_folder):
|
|
457
|
+
submodule_folders: list[str] = [os.path.join(self.repository, submodule) for submodule in self.sc.get_git_submodules(self.repository)]
|
|
458
|
+
for name in os.listdir(self.repository):
|
|
459
|
+
tool_folder: str = os.path.join(self.repository, name)
|
|
460
|
+
if name.startswith(".") and name not in [".git", ".agents"] and os.path.isdir(tool_folder) and not os.path.islink(tool_folder):
|
|
461
|
+
for replaced_link in GeneralUtilities.replace_symlinks_by_copies(tool_folder, shared_skills_folder, submodule_folders):
|
|
462
|
+
self.sc.log.log(f"Replaced symbolic link \"{replaced_link}\" by a copy of its target.", LogLevel.Debug)
|
|
444
463
|
|
|
445
464
|
@GeneralUtilities.check_arguments
|
|
446
465
|
def __validate_openspec(self,repository:str) -> None:
|
|
@@ -2091,11 +2091,11 @@ class TFCPS_Tools_General:
|
|
|
2091
2091
|
changelog_file = os.path.join(repository_folder, "Other", "Resources", "Changelog", f"v{current_version}.md")
|
|
2092
2092
|
if (not os.path.isfile(changelog_file)):
|
|
2093
2093
|
GeneralUtilities.ensure_file_exists(changelog_file)
|
|
2094
|
-
GeneralUtilities.write_text_to_file(changelog_file, """# Release notes
|
|
2094
|
+
GeneralUtilities.write_text_to_file(changelog_file, f"""# Release notes
|
|
2095
2095
|
|
|
2096
2096
|
## Changes
|
|
2097
2097
|
|
|
2098
|
-
- Updated
|
|
2098
|
+
- Updated submodule {submodule_name}.
|
|
2099
2099
|
""")
|
|
2100
2100
|
|
|
2101
2101
|
@GeneralUtilities.check_arguments
|
|
@@ -2111,6 +2111,19 @@ class TFCPS_Tools_General:
|
|
|
2111
2111
|
if current_version != latest_version:
|
|
2112
2112
|
GeneralUtilities.write_text_to_file(resrepo_commit_id_file, latest_version)
|
|
2113
2113
|
|
|
2114
|
+
@GeneralUtilities.check_arguments
|
|
2115
|
+
def log_newer_major_versions_of_dependency(self, dependency_name: str, available_versions: list[str], used_version: str) -> None:
|
|
2116
|
+
"""Logs if a newer major-version of the given dependency is available than the used one.
|
|
2117
|
+
An update with an echolon like LatestPatchOrLatestMinor does not take over a new major-version, so without this message it would not be visible that the dependency falls behind.
|
|
2118
|
+
Being 1 major-version behind is logged as information, being 2 or more major-versions behind is logged as warning.
|
|
2119
|
+
used_version is the version which is used after the update (if an update was done)."""
|
|
2120
|
+
amount_of_major_versions_behind: int = GeneralUtilities.get_amount_of_major_versions_behind(available_versions, used_version)
|
|
2121
|
+
if amount_of_major_versions_behind == 0:
|
|
2122
|
+
return
|
|
2123
|
+
loglevel: LogLevel = LogLevel.Information if amount_of_major_versions_behind == 1 else LogLevel.Warning
|
|
2124
|
+
latest_version: str = GeneralUtilities.get_latest_version(available_versions)
|
|
2125
|
+
self.__sc.log.log(f"Dependency {dependency_name} is used in version {used_version}, which is {amount_of_major_versions_behind} major-version(s) behind the latest available version {latest_version}. A new major-version has to be taken over deliberately.", loglevel)
|
|
2126
|
+
|
|
2114
2127
|
@GeneralUtilities.check_arguments
|
|
2115
2128
|
def get_dependencies_which_are_ignored_from_updates(self, codeunit_folder: str) -> list[str]:
|
|
2116
2129
|
self.assert_is_codeunit_folder(codeunit_folder)
|
|
@@ -1,177 +1,177 @@
|
|
|
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
|
-
License-Expression: GPL-3.0-only
|
|
7
|
-
Project-URL: Homepage, https://github.com/anionDevelopment/ScriptCollection
|
|
8
|
-
Project-URL: Documentation, https://aniondev.github.io/ScriptCollectionReference/index.html
|
|
9
|
-
Project-URL: Changelog, https://github.com/anionDevelopment/ScriptCollection/tree/main/Other/Resources/Changelog
|
|
10
|
-
Keywords: package,release,build,management
|
|
11
|
-
Classifier: Intended Audience :: Developers
|
|
12
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
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.6.1
|
|
25
|
-
Requires-Dist: codespell>=2.4.3
|
|
26
|
-
Requires-Dist: CountryInformation>=1.0.12
|
|
27
|
-
Requires-Dist: coverage>=7.16.2
|
|
28
|
-
Requires-Dist: cyclonedx-bom>=7.1.0
|
|
29
|
-
Requires-Dist: defusedxml>=0.7.1
|
|
30
|
-
Requires-Dist: keyboard>=0.13.5
|
|
31
|
-
Requires-Dist: lcov-cobertura>=2.1.1
|
|
32
|
-
Requires-Dist: lxml>=6.0.1
|
|
33
|
-
Requires-Dist: ntplib>=0.4.0
|
|
34
|
-
Requires-Dist: Pillow>=11.3.0
|
|
35
|
-
Requires-Dist: psutil>=7.2.2
|
|
36
|
-
Requires-Dist: pycdlib>=1.22.0
|
|
37
|
-
Requires-Dist: Pygments>=2.21.0
|
|
38
|
-
Requires-Dist: pylint>=4.1.3
|
|
39
|
-
Requires-Dist: pyOpenSSL>=26.4.0
|
|
40
|
-
Requires-Dist: PyPDF>=6.21.1
|
|
41
|
-
Requires-Dist: pytest>=8.4.2
|
|
42
|
-
Requires-Dist: PyYAML>=6.0.3
|
|
43
|
-
Requires-Dist: qrcode>=8.2.0
|
|
44
|
-
Requires-Dist: send2trash>=1.8.3
|
|
45
|
-
Requires-Dist: twine>=6.2.0
|
|
46
|
-
Requires-Dist: xmlschema>=4.3.2
|
|
47
|
-
|
|
48
|
-
# ScriptCollection
|
|
49
|
-
|
|
50
|
-
## General
|
|
51
|
-
|
|
52
|
-
[](https://pypi.org/project/ScriptCollection/)
|
|
53
|
-

|
|
54
|
-

|
|
55
|
-
|
|
56
|
-
[](https://www.codefactor.io/repository/github/anionDevelopment/scriptcollection/overview/main) [](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.
|
|
72
|
-
See the [Runtime dependencies](#runtime-dependencies)-section for more information.
|
|
73
|
-
|
|
74
|
-
When using ScriptCollection it is not required but recommended for better usability to have [epew](https://github.com/anionDev/Epew) installed.
|
|
75
|
-
|
|
76
|
-
## Get ScriptCollection
|
|
77
|
-
|
|
78
|
-
### Installation via pip
|
|
79
|
-
|
|
80
|
-
`pip3 install ScriptCollection`
|
|
81
|
-
|
|
82
|
-
See the [PyPI-site for ScriptCollection](https://pypi.org/project/ScriptCollection)
|
|
83
|
-
|
|
84
|
-
### Download sourcecode using git
|
|
85
|
-
|
|
86
|
-
You can simply git-clone the ScriptCollection and then use the scripts under the provided license.
|
|
87
|
-
|
|
88
|
-
`git clone https://github.com/anionDevelopment/ScriptCollection.git`
|
|
89
|
-
|
|
90
|
-
It may be easier to pip-install the ScriptCollection but technically pip is not required.
|
|
91
|
-
Actually you need to git-clone (or download as zip-file from [GitHub](https://github.com/anionDevelopment/ScriptCollection)) the ScriptCollection to use the scripts in this repository which are not written in python.
|
|
92
|
-
|
|
93
|
-
## Troubleshooting
|
|
94
|
-
|
|
95
|
-
It is recommended to always use only the newest version of the ScriptCollection.
|
|
96
|
-
If you have an older version: Update it (e. g. using `pip3 install ScriptCollection --upgrade` if you installed the ScriptCollection via pip).
|
|
97
|
-
If you still have problems, then feel free to create an [issue](https://github.com/anionDevelopment/ScriptCollection/issues).
|
|
98
|
-
|
|
99
|
-
If you have installed the ScriptCollection as pip-package you can simply check the version by running `scshowversion` or using Python with the following commands:
|
|
100
|
-
|
|
101
|
-
```python
|
|
102
|
-
from ScriptCollection.ScriptCollectionCore import ScriptCollectionCore
|
|
103
|
-
ScriptCollectionCore.get_scriptcollection_version()
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
Or you can simply run `pip3 freeze` to get information about (all) currently installed pip-packages.
|
|
107
|
-
|
|
108
|
-
## Development
|
|
109
|
-
|
|
110
|
-
### Branching-system
|
|
111
|
-
|
|
112
|
-
This repository applies the [GitFlowSimplified](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/BranchingSystem/GitFlowSimplified/GitFlowSimplified.md)-branching-system.
|
|
113
|
-
|
|
114
|
-
### Repository-structure
|
|
115
|
-
|
|
116
|
-
This repository applies the [CommonProjectStructure](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/RepositoryStructure/CommonProjectStructure/CommonProjectStructure.md) as repository-structure.
|
|
117
|
-
|
|
118
|
-
### Install dependencies
|
|
119
|
-
|
|
120
|
-
ScriptCollection requires [Python](https://www.python.org) 3.11 or newer.
|
|
121
|
-
|
|
122
|
-
To develop ScriptCollection it is obviously required that the following commandline-commands are available on your system:
|
|
123
|
-
|
|
124
|
-
- `python` (on some systems `python3`)
|
|
125
|
-
- `pip3`
|
|
126
|
-
|
|
127
|
-
The pip-packages which are required for developing on this project are defined in `ScriptCollection/requirements.txt`.
|
|
128
|
-
|
|
129
|
-
### IDE
|
|
130
|
-
|
|
131
|
-
The recommended IDE for developing ScriptCollection is Visual Studio Code.
|
|
132
|
-
The recommended addons for developing ScriptCollection with Visual Studio Code are:
|
|
133
|
-
|
|
134
|
-
- [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance)
|
|
135
|
-
- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
|
|
136
|
-
- [Spell Right](https://marketplace.visualstudio.com/items?itemName=ban.spellright)
|
|
137
|
-
- [docs-markdown](https://marketplace.visualstudio.com/items?itemName=docsmsft.docs-markdown)
|
|
138
|
-
|
|
139
|
-
### Build
|
|
140
|
-
|
|
141
|
-
To create and install a ScriptCollection locally simply do the following commands in the repository-root:
|
|
142
|
-
|
|
143
|
-
```bash
|
|
144
|
-
python ./ScriptCollection/Other/Build/Build.py
|
|
145
|
-
pip3 install --force-reinstall ./ScriptCollection/Other/Artifacts/BuildResult_Wheel/scriptcollection-x.x.x-py3-none-any.whl
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
(Note: `x.x.x` must be replaced by the appropriate version-number.)
|
|
149
|
-
|
|
150
|
-
The complete build-pipeline (build, testcases, linting, reference-generation, etc.) is run by `scbuildcodeunits` in the repository-root (or `task bb` if [Task](https://taskfile.dev) is installed).
|
|
151
|
-
Afterwards `task dl` installs the built wheel locally.
|
|
152
|
-
|
|
153
|
-
### Coding style
|
|
154
|
-
|
|
155
|
-
In this repository [pylint](https://pylint.org/) will be used to report linting-issues.
|
|
156
|
-
If you change code in this repository please ensure pylint does not find any issues before creating a pull-request.
|
|
157
|
-
|
|
158
|
-
If linting-issues exist in the current code-base can be checked by running `python ./ScriptCollection/Other/QualityCheck/Linting.py`.
|
|
159
|
-
|
|
160
|
-
## Runtime dependencies
|
|
161
|
-
|
|
162
|
-
ScriptCollection requires [Python](https://www.python.org) 3.11 or newer.
|
|
163
|
-
|
|
164
|
-
The usual Python-dependencies will be installed automagically by `pip`.
|
|
165
|
-
|
|
166
|
-
For functions to read or change the permissions or the owner of a file the ScriptCollection relies on the functionality of the following tools:
|
|
167
|
-
|
|
168
|
-
- chmod
|
|
169
|
-
- chown
|
|
170
|
-
- ls
|
|
171
|
-
|
|
172
|
-
These tools must be available on the system where the functions should be executed.
|
|
173
|
-
Meanwhile these tools are also available on Windows but may have a slightly limited functionality.
|
|
174
|
-
|
|
175
|
-
## License
|
|
176
|
-
|
|
177
|
-
See [License.txt](https://raw.githubusercontent.com/anionDevelopment/ScriptCollection/main/License.txt) for license-information.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: scriptcollection
|
|
3
|
+
Version: 4.4.72
|
|
4
|
+
Summary: The ScriptCollection is the place for reusable scripts.
|
|
5
|
+
Author-email: Marius Göcke <marius.goecke@gmail.com>
|
|
6
|
+
License-Expression: GPL-3.0-only
|
|
7
|
+
Project-URL: Homepage, https://github.com/anionDevelopment/ScriptCollection
|
|
8
|
+
Project-URL: Documentation, https://aniondev.github.io/ScriptCollectionReference/index.html
|
|
9
|
+
Project-URL: Changelog, https://github.com/anionDevelopment/ScriptCollection/tree/main/Other/Resources/Changelog
|
|
10
|
+
Keywords: package,release,build,management
|
|
11
|
+
Classifier: Intended Audience :: Developers
|
|
12
|
+
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
13
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
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.6.1
|
|
25
|
+
Requires-Dist: codespell>=2.4.3
|
|
26
|
+
Requires-Dist: CountryInformation>=1.0.12
|
|
27
|
+
Requires-Dist: coverage>=7.16.2
|
|
28
|
+
Requires-Dist: cyclonedx-bom>=7.1.0
|
|
29
|
+
Requires-Dist: defusedxml>=0.7.1
|
|
30
|
+
Requires-Dist: keyboard>=0.13.5
|
|
31
|
+
Requires-Dist: lcov-cobertura>=2.1.1
|
|
32
|
+
Requires-Dist: lxml>=6.0.1
|
|
33
|
+
Requires-Dist: ntplib>=0.4.0
|
|
34
|
+
Requires-Dist: Pillow>=11.3.0
|
|
35
|
+
Requires-Dist: psutil>=7.2.2
|
|
36
|
+
Requires-Dist: pycdlib>=1.22.0
|
|
37
|
+
Requires-Dist: Pygments>=2.21.0
|
|
38
|
+
Requires-Dist: pylint>=4.1.3
|
|
39
|
+
Requires-Dist: pyOpenSSL>=26.4.0
|
|
40
|
+
Requires-Dist: PyPDF>=6.21.1
|
|
41
|
+
Requires-Dist: pytest>=8.4.2
|
|
42
|
+
Requires-Dist: PyYAML>=6.0.3
|
|
43
|
+
Requires-Dist: qrcode>=8.2.0
|
|
44
|
+
Requires-Dist: send2trash>=1.8.3
|
|
45
|
+
Requires-Dist: twine>=6.2.0
|
|
46
|
+
Requires-Dist: xmlschema>=4.3.2
|
|
47
|
+
|
|
48
|
+
# ScriptCollection
|
|
49
|
+
|
|
50
|
+
## General
|
|
51
|
+
|
|
52
|
+
[](https://pypi.org/project/ScriptCollection/)
|
|
53
|
+

|
|
54
|
+

|
|
55
|
+
|
|
56
|
+
[](https://www.codefactor.io/repository/github/anionDevelopment/scriptcollection/overview/main) [](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.
|
|
72
|
+
See the [Runtime dependencies](#runtime-dependencies)-section for more information.
|
|
73
|
+
|
|
74
|
+
When using ScriptCollection it is not required but recommended for better usability to have [epew](https://github.com/anionDev/Epew) installed.
|
|
75
|
+
|
|
76
|
+
## Get ScriptCollection
|
|
77
|
+
|
|
78
|
+
### Installation via pip
|
|
79
|
+
|
|
80
|
+
`pip3 install ScriptCollection`
|
|
81
|
+
|
|
82
|
+
See the [PyPI-site for ScriptCollection](https://pypi.org/project/ScriptCollection)
|
|
83
|
+
|
|
84
|
+
### Download sourcecode using git
|
|
85
|
+
|
|
86
|
+
You can simply git-clone the ScriptCollection and then use the scripts under the provided license.
|
|
87
|
+
|
|
88
|
+
`git clone https://github.com/anionDevelopment/ScriptCollection.git`
|
|
89
|
+
|
|
90
|
+
It may be easier to pip-install the ScriptCollection but technically pip is not required.
|
|
91
|
+
Actually you need to git-clone (or download as zip-file from [GitHub](https://github.com/anionDevelopment/ScriptCollection)) the ScriptCollection to use the scripts in this repository which are not written in python.
|
|
92
|
+
|
|
93
|
+
## Troubleshooting
|
|
94
|
+
|
|
95
|
+
It is recommended to always use only the newest version of the ScriptCollection.
|
|
96
|
+
If you have an older version: Update it (e. g. using `pip3 install ScriptCollection --upgrade` if you installed the ScriptCollection via pip).
|
|
97
|
+
If you still have problems, then feel free to create an [issue](https://github.com/anionDevelopment/ScriptCollection/issues).
|
|
98
|
+
|
|
99
|
+
If you have installed the ScriptCollection as pip-package you can simply check the version by running `scshowversion` or using Python with the following commands:
|
|
100
|
+
|
|
101
|
+
```python
|
|
102
|
+
from ScriptCollection.ScriptCollectionCore import ScriptCollectionCore
|
|
103
|
+
ScriptCollectionCore.get_scriptcollection_version()
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
Or you can simply run `pip3 freeze` to get information about (all) currently installed pip-packages.
|
|
107
|
+
|
|
108
|
+
## Development
|
|
109
|
+
|
|
110
|
+
### Branching-system
|
|
111
|
+
|
|
112
|
+
This repository applies the [GitFlowSimplified](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/BranchingSystem/GitFlowSimplified/GitFlowSimplified.md)-branching-system.
|
|
113
|
+
|
|
114
|
+
### Repository-structure
|
|
115
|
+
|
|
116
|
+
This repository applies the [CommonProjectStructure](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/RepositoryStructure/CommonProjectStructure/CommonProjectStructure.md) as repository-structure.
|
|
117
|
+
|
|
118
|
+
### Install dependencies
|
|
119
|
+
|
|
120
|
+
ScriptCollection requires [Python](https://www.python.org) 3.11 or newer.
|
|
121
|
+
|
|
122
|
+
To develop ScriptCollection it is obviously required that the following commandline-commands are available on your system:
|
|
123
|
+
|
|
124
|
+
- `python` (on some systems `python3`)
|
|
125
|
+
- `pip3`
|
|
126
|
+
|
|
127
|
+
The pip-packages which are required for developing on this project are defined in `ScriptCollection/requirements.txt`.
|
|
128
|
+
|
|
129
|
+
### IDE
|
|
130
|
+
|
|
131
|
+
The recommended IDE for developing ScriptCollection is Visual Studio Code.
|
|
132
|
+
The recommended addons for developing ScriptCollection with Visual Studio Code are:
|
|
133
|
+
|
|
134
|
+
- [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance)
|
|
135
|
+
- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
|
|
136
|
+
- [Spell Right](https://marketplace.visualstudio.com/items?itemName=ban.spellright)
|
|
137
|
+
- [docs-markdown](https://marketplace.visualstudio.com/items?itemName=docsmsft.docs-markdown)
|
|
138
|
+
|
|
139
|
+
### Build
|
|
140
|
+
|
|
141
|
+
To create and install a ScriptCollection locally simply do the following commands in the repository-root:
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
python ./ScriptCollection/Other/Build/Build.py
|
|
145
|
+
pip3 install --force-reinstall ./ScriptCollection/Other/Artifacts/BuildResult_Wheel/scriptcollection-x.x.x-py3-none-any.whl
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
(Note: `x.x.x` must be replaced by the appropriate version-number.)
|
|
149
|
+
|
|
150
|
+
The complete build-pipeline (build, testcases, linting, reference-generation, etc.) is run by `scbuildcodeunits` in the repository-root (or `task bb` if [Task](https://taskfile.dev) is installed).
|
|
151
|
+
Afterwards `task dl` installs the built wheel locally.
|
|
152
|
+
|
|
153
|
+
### Coding style
|
|
154
|
+
|
|
155
|
+
In this repository [pylint](https://pylint.org/) will be used to report linting-issues.
|
|
156
|
+
If you change code in this repository please ensure pylint does not find any issues before creating a pull-request.
|
|
157
|
+
|
|
158
|
+
If linting-issues exist in the current code-base can be checked by running `python ./ScriptCollection/Other/QualityCheck/Linting.py`.
|
|
159
|
+
|
|
160
|
+
## Runtime dependencies
|
|
161
|
+
|
|
162
|
+
ScriptCollection requires [Python](https://www.python.org) 3.11 or newer.
|
|
163
|
+
|
|
164
|
+
The usual Python-dependencies will be installed automagically by `pip`.
|
|
165
|
+
|
|
166
|
+
For functions to read or change the permissions or the owner of a file the ScriptCollection relies on the functionality of the following tools:
|
|
167
|
+
|
|
168
|
+
- chmod
|
|
169
|
+
- chown
|
|
170
|
+
- ls
|
|
171
|
+
|
|
172
|
+
These tools must be available on the system where the functions should be executed.
|
|
173
|
+
Meanwhile these tools are also available on Windows but may have a slightly limited functionality.
|
|
174
|
+
|
|
175
|
+
## License
|
|
176
|
+
|
|
177
|
+
See [License.txt](https://raw.githubusercontent.com/anionDevelopment/ScriptCollection/main/License.txt) for license-information.
|