ScriptCollection 4.4.57__py3-none-any.whl → 4.4.59__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/ScriptCollectionCore.py +1 -1
- ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py +117 -8
- ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py +5 -5
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py +3 -3
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py +2 -2
- ScriptCollection/TFCPS/TFCPS_Tools_General.py +22 -15
- {scriptcollection-4.4.57.dist-info → scriptcollection-4.4.59.dist-info}/METADATA +172 -172
- {scriptcollection-4.4.57.dist-info → scriptcollection-4.4.59.dist-info}/RECORD +11 -11
- {scriptcollection-4.4.57.dist-info → scriptcollection-4.4.59.dist-info}/WHEEL +0 -0
- {scriptcollection-4.4.57.dist-info → scriptcollection-4.4.59.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.4.57.dist-info → scriptcollection-4.4.59.dist-info}/top_level.txt +0 -0
|
@@ -4,8 +4,10 @@ import re
|
|
|
4
4
|
import shutil
|
|
5
5
|
import uuid
|
|
6
6
|
import json
|
|
7
|
+
import requests
|
|
7
8
|
from lxml import etree
|
|
8
9
|
import yaml
|
|
10
|
+
from packaging.version import Version
|
|
9
11
|
from .CertificateGeneratorInformationBase import CertificateGeneratorInformationBase
|
|
10
12
|
from ...GeneralUtilities import GeneralUtilities, VersionEcholon
|
|
11
13
|
from ...SCLog import LogLevel
|
|
@@ -843,12 +845,50 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
843
845
|
return f'filename="{filename_relative}"'
|
|
844
846
|
|
|
845
847
|
|
|
848
|
+
@GeneralUtilities.check_arguments
|
|
846
849
|
def get_dependencies(self)->dict[str,set[str]]:
|
|
847
|
-
|
|
848
|
-
|
|
850
|
+
csproj_file: str = self.csproj_file
|
|
851
|
+
root: etree._ElementTree = etree.parse(csproj_file)
|
|
852
|
+
result: dict[str, set[str]] = {}
|
|
853
|
+
for package_reference in root.xpath("//PackageReference"):
|
|
854
|
+
attributes: dict[str, str] = {name.lower(): value for name, value in package_reference.attrib.items()}
|
|
855
|
+
package_name: str = attributes.get("include")
|
|
856
|
+
if package_name:
|
|
857
|
+
version: str = attributes.get("version")
|
|
858
|
+
if version:
|
|
859
|
+
version_clean = version.strip().strip("[]")
|
|
860
|
+
if package_name not in result:
|
|
861
|
+
result[package_name] = set()
|
|
862
|
+
result[package_name].add(version_clean)
|
|
863
|
+
return result
|
|
864
|
+
|
|
849
865
|
@GeneralUtilities.check_arguments
|
|
850
|
-
def get_available_versions(self,dependencyname:str)->list[str]:
|
|
851
|
-
|
|
866
|
+
def get_available_versions(self, dependencyname: str) -> list[str]:
|
|
867
|
+
try:
|
|
868
|
+
url = f"https://api.nuget.org/v3/flatcontainer/{dependencyname.lower()}/index.json"
|
|
869
|
+
response = requests.get(url, timeout=10)
|
|
870
|
+
if response.status_code != 200:
|
|
871
|
+
return []
|
|
872
|
+
data = response.json()
|
|
873
|
+
versions: list[str] = data.get("versions", [])
|
|
874
|
+
if not versions:
|
|
875
|
+
return []
|
|
876
|
+
return TFCPS_CodeUnitSpecific_DotNet_Functions.select_updatable_versions_from_nuget_versions(versions)
|
|
877
|
+
except Exception:
|
|
878
|
+
return []
|
|
879
|
+
|
|
880
|
+
@staticmethod
|
|
881
|
+
@GeneralUtilities.check_arguments
|
|
882
|
+
def select_updatable_versions_from_nuget_versions(versions: list[str]) -> list[str]:
|
|
883
|
+
"""Returns the versions from a raw NuGet-version-list which the dependency-update can handle, sorted from the
|
|
884
|
+
latest to the oldest. Only plain three-part-versions (major.minor.patch) are kept: NuGet also lists four-part-
|
|
885
|
+
versions (for example "1.8.0.7") and pre-release-versions (for example "2.8.0-preview4" or "2.9.2-ci-210"), which
|
|
886
|
+
the rest of the update-logic does not support (it asserts a three-part-format) and which "packaging.version.Version"
|
|
887
|
+
can not always parse. Without this strict filter such an unparseable string would let the sorting below raise, which
|
|
888
|
+
the caller turns into an empty version-list and therefore into the misleading error "Version-list can not be empty"
|
|
889
|
+
for a dependency whose registry actually offers usable versions."""
|
|
890
|
+
three_part_versions = [version for version in versions if re.match(r"^\d+\.\d+\.\d+$", version)]
|
|
891
|
+
return sorted(three_part_versions, key=Version, reverse=True)
|
|
852
892
|
|
|
853
893
|
@GeneralUtilities.check_arguments
|
|
854
894
|
def update_dependencies_with_specific_echolon(self, echolon: VersionEcholon) -> None:
|
|
@@ -858,12 +898,81 @@ class TFCPS_CodeUnitSpecific_DotNet_Functions(TFCPS_CodeUnitSpecific_Base):
|
|
|
858
898
|
resolved before. Writing them again is part of the update: without it the next build fails with NU1004, and the
|
|
859
899
|
state of the dependencies of the codeunit would be spread over two places which do not agree."""
|
|
860
900
|
super().update_dependencies_with_specific_echolon(echolon)
|
|
901
|
+
self.synchronize_dependency_versions_across_project_files()
|
|
861
902
|
self.tfcps_Tools_General.update_lock_files_of_dotnet_codeunit(self.get_codeunit_folder())
|
|
862
903
|
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
904
|
+
@GeneralUtilities.check_arguments
|
|
905
|
+
def get_csproj_files_of_codeunit(self) -> list[str]:
|
|
906
|
+
"""Returns the project-files of this codeunit (the project-file of the library/application and the project-file of
|
|
907
|
+
its tests). Build-output (`bin`, `obj`) and the `Other`-folder (which holds scripts and build-artifacts, not the
|
|
908
|
+
source-projects) are excluded, so only the project-files which declare the dependencies of the codeunit remain."""
|
|
909
|
+
codeunit_folder = self.get_codeunit_folder()
|
|
910
|
+
ignored_folder_names = {"bin", "obj", "Other", ".vs", "node_modules"}
|
|
911
|
+
result: list[str] = []
|
|
912
|
+
for csproj_file in glob.glob(os.path.join(codeunit_folder, "**", "*.csproj"), recursive=True):
|
|
913
|
+
relative_parts = os.path.relpath(csproj_file, codeunit_folder).split(os.sep)
|
|
914
|
+
if not any(part in ignored_folder_names for part in relative_parts):
|
|
915
|
+
result.append(csproj_file)
|
|
916
|
+
return sorted(result)
|
|
917
|
+
|
|
918
|
+
@GeneralUtilities.check_arguments
|
|
919
|
+
def synchronize_dependency_versions_across_project_files(self) -> None:
|
|
920
|
+
"""Pins every dependency which the project-file of this codeunit declares to the same version in the other
|
|
921
|
+
project-files of the codeunit (typically the test-project). The test-project references the library-project, so
|
|
922
|
+
NuGet rejects a restore in which the test-project pins a shared dependency lower than the version the library-
|
|
923
|
+
project requires (error NU1605). The library-project is the source of truth, because its dependencies are the ones
|
|
924
|
+
the update resolves. This runs after every update (and is idempotent when the versions already agree), so a shared
|
|
925
|
+
dependency stays consistent even when the library-project did not have to be changed in this update but the test-
|
|
926
|
+
project was still pinned to an older version from a previous, only partially applied update. The notation of each
|
|
927
|
+
project-file is preserved by set_dependency_version_in_csproj_content (an exact pin keeps its brackets)."""
|
|
928
|
+
main_csproj_file = self.csproj_file
|
|
929
|
+
main_dependencies = self.get_dependencies()
|
|
930
|
+
other_csproj_files = [csproj_file for csproj_file in self.get_csproj_files_of_codeunit() if os.path.abspath(csproj_file) != os.path.abspath(main_csproj_file)]
|
|
931
|
+
for other_csproj_file in other_csproj_files:
|
|
932
|
+
former_content = GeneralUtilities.read_text_from_file(other_csproj_file)
|
|
933
|
+
new_content = former_content
|
|
934
|
+
for dependency_name, dependency_versions in main_dependencies.items():
|
|
935
|
+
new_content = TFCPS_CodeUnitSpecific_DotNet_Functions.set_dependency_version_in_csproj_content(new_content, dependency_name, next(iter(dependency_versions)))
|
|
936
|
+
if new_content != former_content:
|
|
937
|
+
GeneralUtilities.write_text_to_file(other_csproj_file, new_content)
|
|
938
|
+
|
|
939
|
+
@GeneralUtilities.check_arguments
|
|
940
|
+
def set_dependency_version(self, name: str, new_version: str) -> None:
|
|
941
|
+
"""Sets the version of the given dependency in the project-file of this codeunit (the same project-file from which
|
|
942
|
+
get_dependencies reads the dependencies)."""
|
|
943
|
+
csproj_file: str = self.csproj_file
|
|
944
|
+
former_content: str = GeneralUtilities.read_text_from_file(csproj_file)
|
|
945
|
+
new_content: str = TFCPS_CodeUnitSpecific_DotNet_Functions.set_dependency_version_in_csproj_content(former_content, name, new_version)
|
|
946
|
+
GeneralUtilities.assert_condition(new_content != former_content, f"The dependency \"{name}\" could not be set to version \"{new_version}\" because the project-file \"{csproj_file}\" does not declare it with a version-attribute.")
|
|
947
|
+
GeneralUtilities.write_text_to_file(csproj_file, new_content)
|
|
948
|
+
|
|
949
|
+
@staticmethod
|
|
950
|
+
@GeneralUtilities.check_arguments
|
|
951
|
+
def set_dependency_version_in_csproj_content(content: str, name: str, new_version: str) -> str:
|
|
952
|
+
"""Returns the content of a .csproj-file in which the version of the given dependency is set to the new version.
|
|
953
|
+
The version is written into the "Version"-attribute of every "PackageReference" whose "Include"-attribute names
|
|
954
|
+
the dependency; the rest of the file (formatting, order and every other dependency) stays untouched, the same way
|
|
955
|
+
the pub- and npm-updaters change only the declaration of the dependency they update. The notation of the former
|
|
956
|
+
version is preserved: a version which was pinned exactly with brackets (for example "[2.9.1]") keeps its brackets
|
|
957
|
+
("[2.9.2]") and an unbracketed version stays unbracketed, so that the meaning the project-file assigns to the
|
|
958
|
+
declaration (an exact pin stays an exact pin) is not changed by the update. A project-file which does not declare
|
|
959
|
+
the dependency with a version-attribute is returned unchanged."""
|
|
960
|
+
package_reference_tag = re.compile(r"<PackageReference\b[^>]*?/?>", re.IGNORECASE)
|
|
961
|
+
include_attribute = re.compile(r'\bInclude\s*=\s*"([^"]*)"', re.IGNORECASE)
|
|
962
|
+
version_attribute = re.compile(r'(\bVersion\s*=\s*")(\[?)([^"]*?)(\]?)(")', re.IGNORECASE)
|
|
963
|
+
|
|
964
|
+
def replace_version_in_tag(tag_match: re.Match) -> str:
|
|
965
|
+
tag: str = tag_match.group(0)
|
|
966
|
+
include_match = include_attribute.search(tag)
|
|
967
|
+
if include_match is None or include_match.group(1) != name:
|
|
968
|
+
return tag
|
|
969
|
+
|
|
970
|
+
def replace_version(version_match: re.Match) -> str:
|
|
971
|
+
keeps_brackets: bool = version_match.group(2) == "[" and version_match.group(4) == "]"
|
|
972
|
+
replacement_version: str = f"[{new_version}]" if keeps_brackets else new_version
|
|
973
|
+
return f"{version_match.group(1)}{replacement_version}{version_match.group(5)}"
|
|
974
|
+
return version_attribute.sub(replace_version, tag, count=1)
|
|
975
|
+
return package_reference_tag.sub(replace_version_in_tag, content)
|
|
867
976
|
|
|
868
977
|
|
|
869
978
|
class TFCPS_CodeUnitSpecific_DotNet_CLI:
|
|
@@ -12,7 +12,7 @@ from lxml import etree
|
|
|
12
12
|
from ..GeneralUtilities import GeneralUtilities, VersionEcholon
|
|
13
13
|
from ..ScriptCollectionCore import ScriptCollectionCore
|
|
14
14
|
from ..SCLog import LogLevel
|
|
15
|
-
from .TFCPS_Tools_General import TFCPS_Tools_General
|
|
15
|
+
from .TFCPS_Tools_General import TFCPS_Tools_General, CommonProjectStructureNamespace, CommonProjectStructureVersion
|
|
16
16
|
from .TFCPS_RemoteBuild import TFCPS_RemoteBuild, RunnerOperatingSystem
|
|
17
17
|
|
|
18
18
|
|
|
@@ -30,7 +30,7 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
|
|
|
30
30
|
_protected_sc:ScriptCollectionCore = None
|
|
31
31
|
__is_pre_merge:bool=False
|
|
32
32
|
__validate_developers_of_repository:bool=True#TODO must be settable to false
|
|
33
|
-
codeunit_namespace:str=
|
|
33
|
+
codeunit_namespace:str=CommonProjectStructureNamespace
|
|
34
34
|
|
|
35
35
|
def __init__(self,current_file:str,verbosity:LogLevel,target_envionment_type:str,use_cache:bool,is_pre_merge:bool):
|
|
36
36
|
self.__verbosity=verbosity
|
|
@@ -141,7 +141,7 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
|
|
|
141
141
|
GeneralUtilities.assert_condition(len(codeunit_files_in_folder) == 1, f'The codeunit-folder "{codeunit_folder}" must contain exactly one codeunit-file (matching "*{codeunit_filename_suffix}") but contains {len(codeunit_files_in_folder)}.')
|
|
142
142
|
codeunit_name_in_codeunit_filename = codeunit_files_in_folder[0][:-len(codeunit_filename_suffix)]
|
|
143
143
|
GeneralUtilities.assert_condition(codeunit_name_in_codeunit_filename == codeunit_name, f'The codeunit-file "{codeunit_files_in_folder[0]}" must be named "{codeunit_name}{codeunit_filename_suffix}" to match its folder-name ("{codeunit_name}").')
|
|
144
|
-
supported_codeunitspecificationversion =
|
|
144
|
+
supported_codeunitspecificationversion = CommonProjectStructureVersion # should always be the latest version of the ProjectTemplates-repository
|
|
145
145
|
codeunit_file = os.path.join(codeunit_folder, f"{codeunit_name}{codeunit_filename_suffix}")
|
|
146
146
|
if not os.path.isfile(codeunit_file):
|
|
147
147
|
raise ValueError(f'Codeunitfile "{codeunit_file}" does not exist.')
|
|
@@ -401,7 +401,7 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
|
|
|
401
401
|
product_information_file = os.path.join(self.get_repository_folder(), ".ScriptCollection", "ProductInformation.xml")
|
|
402
402
|
GeneralUtilities.assert_file_exists(product_information_file)
|
|
403
403
|
root: etree._ElementTree = etree.parse(product_information_file)
|
|
404
|
-
return str(root.xpath(f'/cps:productinformation/cps:{property_name}/text()', namespaces={'cps':
|
|
404
|
+
return str(root.xpath(f'/cps:productinformation/cps:{property_name}/text()', namespaces={'cps': CommonProjectStructureNamespace})[0])
|
|
405
405
|
|
|
406
406
|
@GeneralUtilities.check_arguments
|
|
407
407
|
def get_current_folder(self)->str:
|
|
@@ -562,7 +562,7 @@ class TFCPS_CodeUnitSpecific_Base(ABC):
|
|
|
562
562
|
@GeneralUtilities.check_arguments
|
|
563
563
|
def get_testcoverage_threshold_from_codeunit_file(self):
|
|
564
564
|
root: etree._ElementTree = etree.parse(self.get_codeunit_file())
|
|
565
|
-
return float(str(root.xpath('//cps:properties/cps:testsettings/@minimalcodecoverageinpercent', namespaces={'cps':
|
|
565
|
+
return float(str(root.xpath('//cps:properties/cps:testsettings/@minimalcodecoverageinpercent', namespaces={'cps': CommonProjectStructureNamespace})[0]))
|
|
566
566
|
|
|
567
567
|
|
|
568
568
|
@GeneralUtilities.check_arguments
|
|
@@ -3,7 +3,7 @@ import re
|
|
|
3
3
|
from ..GeneralUtilities import GeneralUtilities
|
|
4
4
|
from ..ScriptCollectionCore import ScriptCollectionCore
|
|
5
5
|
from ..SCLog import LogLevel
|
|
6
|
-
from .TFCPS_Tools_General import TFCPS_Tools_General
|
|
6
|
+
from .TFCPS_Tools_General import TFCPS_Tools_General, CommonProjectStructureNamespace, CommonProjectStructureXSDBaseURL
|
|
7
7
|
|
|
8
8
|
|
|
9
9
|
class TFCPS_CodeUnit_BuildCodeUnit:
|
|
@@ -106,8 +106,8 @@ class TFCPS_CodeUnit_BuildCodeUnit:
|
|
|
106
106
|
commit_id = self.sc.git_get_commit_id(self.repository_folder) # the actual commit-id (not the branch-name) which was checked-out while building this codeunit
|
|
107
107
|
# TODO implement usage of reference_latest_version_of_xsd_when_generating_xml
|
|
108
108
|
GeneralUtilities.write_text_to_file(artifactsinformation_file, f"""<?xml version="1.0" encoding="UTF-8" ?>
|
|
109
|
-
<cps:artifactsinformation xmlns:cps="
|
|
110
|
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
|
|
109
|
+
<cps:artifactsinformation xmlns:cps="{CommonProjectStructureNamespace}" artifactsinformationspecificationversion="1.0.0"
|
|
110
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="{CommonProjectStructureNamespace} {CommonProjectStructureXSDBaseURL}/artifactsinformation.xsd">
|
|
111
111
|
<cps:name>{self.codeunit_name}</cps:name>
|
|
112
112
|
<cps:version>{codeunit_version}</cps:version>
|
|
113
113
|
<cps:timestamp>{moment}</cps:timestamp>
|
|
@@ -11,7 +11,7 @@ from .TFCPS_BuildCodeUnitsHook import TFCPS_BuildCodeUnitsHook
|
|
|
11
11
|
from .TFCPS_CodeUnit_BuildCodeUnit import TFCPS_CodeUnit_BuildCodeUnit
|
|
12
12
|
from .TFCPS_CodeSpellCheck import TFCPS_CodeSpellCheck
|
|
13
13
|
from .TFCPS_OCIImageSecretScan import TFCPS_OCIImageSecretScan
|
|
14
|
-
from .TFCPS_Tools_General import TFCPS_Tools_General
|
|
14
|
+
from .TFCPS_Tools_General import TFCPS_Tools_General, CommonProjectStructureXSDBaseURL
|
|
15
15
|
|
|
16
16
|
|
|
17
17
|
class TFCPS_UpdateDependenciesHook(TFCPS_BuildCodeUnitsHook):
|
|
@@ -158,7 +158,7 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
158
158
|
self.__run_custom_pre_codeunit_build_script()
|
|
159
159
|
|
|
160
160
|
try:
|
|
161
|
-
xmlschema.validate(product_information_file, "
|
|
161
|
+
xmlschema.validate(product_information_file, f"{CommonProjectStructureXSDBaseURL}/productinformation.xsd")
|
|
162
162
|
except Exception as exception:
|
|
163
163
|
self.sc.log.log_exception(f"'{product_information_file}' could not be validated against the XSD:", exception, LogLevel.Warning)
|
|
164
164
|
|
|
@@ -25,6 +25,13 @@ from ..OCIImages.OCIImageManager import OCIImageManager
|
|
|
25
25
|
from .PackageSource import PackageSource
|
|
26
26
|
from .PlantUMLRenderer import PlantUMLRenderer
|
|
27
27
|
|
|
28
|
+
# Central definition of the common-project-structure-version. This is the single place which has to be updated to bump the
|
|
29
|
+
# whole repository (and all common-project-structure-files which are generated or validated by ScriptCollection) to a new
|
|
30
|
+
# common-project-structure-version. Both the namespace and the xsd-base-url are derived from this version.
|
|
31
|
+
CommonProjectStructureVersion: str = "3.0.4"
|
|
32
|
+
CommonProjectStructureNamespace: str = f"https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/v{CommonProjectStructureVersion}/Conventions/RepositoryStructure/CommonProjectStructure"
|
|
33
|
+
CommonProjectStructureXSDBaseURL: str = f"https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/raw/v{CommonProjectStructureVersion}/Conventions/RepositoryStructure/CommonProjectStructure"
|
|
34
|
+
|
|
28
35
|
class TFCPS_Tools_General:
|
|
29
36
|
|
|
30
37
|
__sc:ScriptCollectionCore=None
|
|
@@ -45,7 +52,7 @@ class TFCPS_Tools_General:
|
|
|
45
52
|
@GeneralUtilities.check_arguments
|
|
46
53
|
def codeunit_is_enabled(self, codeunit_file: str) -> bool:
|
|
47
54
|
root: etree._ElementTree = etree.parse(codeunit_file)
|
|
48
|
-
return GeneralUtilities.string_to_boolean(str(root.xpath('//cps:codeunit/@enabled', namespaces={'cps':
|
|
55
|
+
return GeneralUtilities.string_to_boolean(str(root.xpath('//cps:codeunit/@enabled', namespaces={'cps': CommonProjectStructureNamespace})[0]))
|
|
49
56
|
|
|
50
57
|
@GeneralUtilities.check_arguments
|
|
51
58
|
def ensure_cyclonedxcli_is_available(self,enforce_update:bool) -> str:
|
|
@@ -286,7 +293,7 @@ class TFCPS_Tools_General:
|
|
|
286
293
|
@GeneralUtilities.check_arguments
|
|
287
294
|
def get_dependent_code_units(self, codeunit_file: str) -> list[str]:
|
|
288
295
|
root: etree._ElementTree = etree.parse(codeunit_file)
|
|
289
|
-
result = set(root.xpath('//cps:dependentcodeunit/text()', namespaces={'cps':
|
|
296
|
+
result = set(root.xpath('//cps:dependentcodeunit/text()', namespaces={'cps': CommonProjectStructureNamespace}))
|
|
290
297
|
result = sorted(result)
|
|
291
298
|
return result
|
|
292
299
|
|
|
@@ -393,7 +400,7 @@ class TFCPS_Tools_General:
|
|
|
393
400
|
versiononlyregex = f"^{versionregex}$"
|
|
394
401
|
if re.match(versiononlyregex, current_version) is None:
|
|
395
402
|
raise ValueError(f"Version '{current_version}' does not match version-regex '{versiononlyregex}'.")
|
|
396
|
-
namespace =
|
|
403
|
+
namespace = CommonProjectStructureNamespace
|
|
397
404
|
#the namespace is registered as default-namespace, otherwise every tag of the file would be written with an invented prefix ("ns0:version") instead of the form the file uses.
|
|
398
405
|
ET.register_namespace("", namespace)
|
|
399
406
|
tree: ET.ElementTree = ET.parse(codeunit_file)
|
|
@@ -473,7 +480,7 @@ class TFCPS_Tools_General:
|
|
|
473
480
|
@GeneralUtilities.check_arguments
|
|
474
481
|
def get_version_of_codeunit_filecontent(self,file_content:str) -> None:
|
|
475
482
|
root: etree._ElementTree = etree.fromstring(file_content.encode("utf-8"))
|
|
476
|
-
result = str(root.xpath('//cps:version/text()', namespaces={'cps':
|
|
483
|
+
result = str(root.xpath('//cps:version/text()', namespaces={'cps': CommonProjectStructureNamespace})[0])
|
|
477
484
|
return result
|
|
478
485
|
|
|
479
486
|
@GeneralUtilities.check_arguments
|
|
@@ -486,14 +493,14 @@ class TFCPS_Tools_General:
|
|
|
486
493
|
@GeneralUtilities.check_arguments
|
|
487
494
|
def get_codeunit_description(self,codeunit_file:str) -> bool:
|
|
488
495
|
root: etree._ElementTree = etree.parse(codeunit_file)
|
|
489
|
-
return str(root.xpath('//cps:properties/@description', namespaces={'cps':
|
|
496
|
+
return str(root.xpath('//cps:properties/@description', namespaces={'cps': CommonProjectStructureNamespace})[0])
|
|
490
497
|
|
|
491
498
|
@GeneralUtilities.check_arguments
|
|
492
499
|
def get_product_name(self, repository_folder: str) -> str:
|
|
493
500
|
product_information_file = os.path.join(repository_folder, ".ScriptCollection", "ProductInformation.xml")
|
|
494
501
|
GeneralUtilities.assert_file_exists(product_information_file)
|
|
495
502
|
root: etree._ElementTree = etree.parse(product_information_file)
|
|
496
|
-
return str(root.xpath('/cps:productinformation/cps:producttitle/text()', namespaces={'cps':
|
|
503
|
+
return str(root.xpath('/cps:productinformation/cps:producttitle/text()', namespaces={'cps': CommonProjectStructureNamespace})[0])
|
|
497
504
|
|
|
498
505
|
@GeneralUtilities.check_arguments
|
|
499
506
|
def get_required_environment_variable_names(self, repository: str) -> list[str]:
|
|
@@ -510,7 +517,7 @@ class TFCPS_Tools_General:
|
|
|
510
517
|
product_information_file = os.path.join(repository, ".ScriptCollection", "ProductInformation.xml")
|
|
511
518
|
GeneralUtilities.assert_file_exists(product_information_file)
|
|
512
519
|
root: etree._ElementTree = etree.parse(product_information_file)
|
|
513
|
-
namespaces = {'cps':
|
|
520
|
+
namespaces = {'cps': CommonProjectStructureNamespace}
|
|
514
521
|
declaration_elements = root.xpath('/cps:productinformation/cps:requiredenvironmentvariables', namespaces=namespaces)
|
|
515
522
|
GeneralUtilities.assert_condition(1 == len(declaration_elements), f"'{product_information_file}' must contain exactly one 'requiredenvironmentvariables'-element but it contains {len(declaration_elements)}. Add '<cps:requiredenvironmentvariables></cps:requiredenvironmentvariables>' (empty if the build of this product does not need any environment-variable) to that file.")
|
|
516
523
|
result: list[str] = []
|
|
@@ -687,8 +694,8 @@ class TFCPS_Tools_General:
|
|
|
687
694
|
|
|
688
695
|
# TODO implement usage of self.reference_latest_version_of_xsd_when_generating_xml
|
|
689
696
|
GeneralUtilities.write_text_to_file(constants_metafile, f"""<?xml version="1.0" encoding="UTF-8" ?>
|
|
690
|
-
<cps:constant xmlns:cps="
|
|
691
|
-
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="
|
|
697
|
+
<cps:constant xmlns:cps="{CommonProjectStructureNamespace}" constantspecificationversion="1.1.0"
|
|
698
|
+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="{CommonProjectStructureNamespace} {CommonProjectStructureXSDBaseURL}/constant.xsd">
|
|
692
699
|
<cps:name>{constantname}</cps:name>
|
|
693
700
|
<cps:documentationsummary>{documentationsummary}</cps:documentationsummary>
|
|
694
701
|
<cps:path>{constants_valuefiler_reference}</cps:path>
|
|
@@ -713,7 +720,7 @@ class TFCPS_Tools_General:
|
|
|
713
720
|
self.assert_is_codeunit_folder(source_codeunit_folder)
|
|
714
721
|
root: etree._ElementTree = etree.parse(os.path.join(source_codeunit_folder, "Other", "Resources", "Constants", f"{constant_name}.constant.xml"))
|
|
715
722
|
results = root.xpath(f'//cps:{propertyname}/text()', namespaces={
|
|
716
|
-
'cps':
|
|
723
|
+
'cps': CommonProjectStructureNamespace
|
|
717
724
|
})
|
|
718
725
|
length = len(results)
|
|
719
726
|
if (length == 0):
|
|
@@ -822,18 +829,18 @@ class TFCPS_Tools_General:
|
|
|
822
829
|
def codeunit_has_testable_sourcecode(self,codeunit_file:str) -> bool:
|
|
823
830
|
self.assert_is_codeunit_folder(os.path.dirname(codeunit_file))
|
|
824
831
|
root: etree._ElementTree = etree.parse(codeunit_file)
|
|
825
|
-
return GeneralUtilities.string_to_boolean(str(root.xpath('//cps:properties/@codeunithastestablesourcecode', namespaces={'cps':
|
|
832
|
+
return GeneralUtilities.string_to_boolean(str(root.xpath('//cps:properties/@codeunithastestablesourcecode', namespaces={'cps': CommonProjectStructureNamespace})[0]))
|
|
826
833
|
|
|
827
834
|
@GeneralUtilities.check_arguments
|
|
828
835
|
def codeunit_has_updatable_dependencies(self,codeunit_file:str) -> bool:
|
|
829
836
|
self.assert_is_codeunit_folder(os.path.dirname(codeunit_file))
|
|
830
837
|
root: etree._ElementTree = etree.parse(codeunit_file)
|
|
831
|
-
return GeneralUtilities.string_to_boolean(str(root.xpath('//cps:properties/@codeunithasupdatabledependencies', namespaces={'cps':
|
|
838
|
+
return GeneralUtilities.string_to_boolean(str(root.xpath('//cps:properties/@codeunithasupdatabledependencies', namespaces={'cps': CommonProjectStructureNamespace})[0]))
|
|
832
839
|
|
|
833
840
|
@GeneralUtilities.check_arguments
|
|
834
841
|
def get_codeunit_owner_emailaddress(self,codeunit_file:str) -> None:
|
|
835
842
|
self.assert_is_codeunit_folder(os.path.dirname(codeunit_file))
|
|
836
|
-
namespaces = {'cps':
|
|
843
|
+
namespaces = {'cps': CommonProjectStructureNamespace, 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
|
|
837
844
|
root: etree._ElementTree = etree.parse(codeunit_file)
|
|
838
845
|
result = root.xpath('//cps:codeunit/cps:codeunitowneremailaddress/text()', namespaces=namespaces)[0]
|
|
839
846
|
return result
|
|
@@ -841,7 +848,7 @@ class TFCPS_Tools_General:
|
|
|
841
848
|
@GeneralUtilities.check_arguments
|
|
842
849
|
def get_codeunit_owner_name(self,codeunit_file:str) -> None:
|
|
843
850
|
self.assert_is_codeunit_folder(os.path.dirname(codeunit_file))
|
|
844
|
-
namespaces = {'cps':
|
|
851
|
+
namespaces = {'cps': CommonProjectStructureNamespace, 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
|
|
845
852
|
root: etree._ElementTree = etree.parse(codeunit_file)
|
|
846
853
|
result = root.xpath('//cps:codeunit/cps:codeunitownername/text()', namespaces=namespaces)[0]
|
|
847
854
|
return result
|
|
@@ -2085,7 +2092,7 @@ class TFCPS_Tools_General:
|
|
|
2085
2092
|
@GeneralUtilities.check_arguments
|
|
2086
2093
|
def get_dependencies_which_are_ignored_from_updates(self, codeunit_folder: str) -> list[str]:
|
|
2087
2094
|
self.assert_is_codeunit_folder(codeunit_folder)
|
|
2088
|
-
namespaces = {'cps':
|
|
2095
|
+
namespaces = {'cps': CommonProjectStructureNamespace, 'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
|
|
2089
2096
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
2090
2097
|
codeunit_file = os.path.join(codeunit_folder, f"{codeunit_name}.codeunit.xml")
|
|
2091
2098
|
root: etree._ElementTree = etree.parse(codeunit_file)
|
|
@@ -1,172 +1,172 @@
|
|
|
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.2
|
|
39
|
-
Requires-Dist: pyOpenSSL>=25.3.0
|
|
40
|
-
Requires-Dist: PyPDF>=6.20.0
|
|
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)
|
|
57
|
-
[](https://pepy.tech/project/scriptcollection)
|
|
58
|
-

|
|
59
|
-
|
|
60
|
-
The ScriptCollection is the place for reusable scripts.
|
|
61
|
-
|
|
62
|
-
## Reference
|
|
63
|
-
|
|
64
|
-
The reference can be found [here](https://aniondev.github.io/ScriptCollectionReference/index.html).
|
|
65
|
-
|
|
66
|
-
## Hints
|
|
67
|
-
|
|
68
|
-
Most of the scripts are written in [python](https://www.python.org) 3.
|
|
69
|
-
|
|
70
|
-
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.
|
|
71
|
-
|
|
72
|
-
Some functions are not entirely available on windows or require common third-party tools. 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. 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.
|
|
91
|
-
|
|
92
|
-
## Troubleshooting
|
|
93
|
-
|
|
94
|
-
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/anionDevelopment/ScriptCollection/issues).
|
|
95
|
-
|
|
96
|
-
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:
|
|
97
|
-
|
|
98
|
-
```python
|
|
99
|
-
from ScriptCollection.ScriptCollectionCore import ScriptCollectionCore
|
|
100
|
-
ScriptCollectionCore.get_scriptcollection_version()
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
Or you can simply run `pip3 freeze` to get information about (all) currently installed pip-packages.
|
|
104
|
-
|
|
105
|
-
## Development
|
|
106
|
-
|
|
107
|
-
### Branching-system
|
|
108
|
-
|
|
109
|
-
This repository applies the [GitFlowSimplified](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/BranchingSystem/GitFlowSimplified/GitFlowSimplified.md)-branching-system.
|
|
110
|
-
|
|
111
|
-
### Repository-structure
|
|
112
|
-
|
|
113
|
-
This repository applies the [CommonProjectStructure](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/RepositoryStructure/CommonProjectStructure/CommonProjectStructure.md) as repository-structure.
|
|
114
|
-
|
|
115
|
-
### Install dependencies
|
|
116
|
-
|
|
117
|
-
ScriptCollection requires [Python](https://www.python.org) 3.11 or newer.
|
|
118
|
-
|
|
119
|
-
To develop ScriptCollection it is obviously required that the following commandline-commands are available on your system:
|
|
120
|
-
|
|
121
|
-
- `python` (on some systems `python3`)
|
|
122
|
-
- `pip3`
|
|
123
|
-
|
|
124
|
-
The pip-packages which are required for developing on this project are defined in `ScriptCollection/requirements.txt`.
|
|
125
|
-
|
|
126
|
-
### IDE
|
|
127
|
-
|
|
128
|
-
The recommended IDE for developing ScriptCollection is Visual Studio Code.
|
|
129
|
-
The recommended addons for developing ScriptCollection with Visual Studio Code are:
|
|
130
|
-
|
|
131
|
-
- [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance)
|
|
132
|
-
- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
|
|
133
|
-
- [Spell Right](https://marketplace.visualstudio.com/items?itemName=ban.spellright)
|
|
134
|
-
- [docs-markdown](https://marketplace.visualstudio.com/items?itemName=docsmsft.docs-markdown)
|
|
135
|
-
|
|
136
|
-
### Build
|
|
137
|
-
|
|
138
|
-
To create and install a ScriptCollection locally simply do the following commands in the repository-root:
|
|
139
|
-
|
|
140
|
-
```bash
|
|
141
|
-
python ./ScriptCollection/Other/Build/Build.py
|
|
142
|
-
pip3 install --force-reinstall ./ScriptCollection/Other/Artifacts/BuildResult_Wheel/scriptcollection-x.x.x-py3-none-any.whl
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
(Note: `x.x.x` must be replaced by the appropriate version-number.)
|
|
146
|
-
|
|
147
|
-
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). Afterwards `task dl` installs the built wheel locally.
|
|
148
|
-
|
|
149
|
-
### Coding style
|
|
150
|
-
|
|
151
|
-
In this repository [pylint](https://pylint.org/) will be used to report linting-issues.
|
|
152
|
-
If you change code in this repository please ensure pylint does not find any issues before creating a pull-request.
|
|
153
|
-
|
|
154
|
-
If linting-issues exist in the current code-base can be checked by running `python ./ScriptCollection/Other/QualityCheck/Linting.py`.
|
|
155
|
-
|
|
156
|
-
## Runtime dependencies
|
|
157
|
-
|
|
158
|
-
ScriptCollection requires [Python](https://www.python.org) 3.11 or newer.
|
|
159
|
-
|
|
160
|
-
The usual Python-dependencies will be installed automagically by `pip`.
|
|
161
|
-
|
|
162
|
-
For functions to read or change the permissions or the owner of a file the ScriptCollection relies on the functionality of the following tools:
|
|
163
|
-
|
|
164
|
-
- chmod
|
|
165
|
-
- chown
|
|
166
|
-
- ls
|
|
167
|
-
|
|
168
|
-
These tools must be available on the system where the functions should be executed. Meanwhile these tools are also available on Windows but may have a slightly limited functionality.
|
|
169
|
-
|
|
170
|
-
## License
|
|
171
|
-
|
|
172
|
-
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.59
|
|
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.2
|
|
39
|
+
Requires-Dist: pyOpenSSL>=25.3.0
|
|
40
|
+
Requires-Dist: PyPDF>=6.20.0
|
|
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)
|
|
57
|
+
[](https://pepy.tech/project/scriptcollection)
|
|
58
|
+

|
|
59
|
+
|
|
60
|
+
The ScriptCollection is the place for reusable scripts.
|
|
61
|
+
|
|
62
|
+
## Reference
|
|
63
|
+
|
|
64
|
+
The reference can be found [here](https://aniondev.github.io/ScriptCollectionReference/index.html).
|
|
65
|
+
|
|
66
|
+
## Hints
|
|
67
|
+
|
|
68
|
+
Most of the scripts are written in [python](https://www.python.org) 3.
|
|
69
|
+
|
|
70
|
+
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.
|
|
71
|
+
|
|
72
|
+
Some functions are not entirely available on windows or require common third-party tools. 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. 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.
|
|
91
|
+
|
|
92
|
+
## Troubleshooting
|
|
93
|
+
|
|
94
|
+
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/anionDevelopment/ScriptCollection/issues).
|
|
95
|
+
|
|
96
|
+
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:
|
|
97
|
+
|
|
98
|
+
```python
|
|
99
|
+
from ScriptCollection.ScriptCollectionCore import ScriptCollectionCore
|
|
100
|
+
ScriptCollectionCore.get_scriptcollection_version()
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
Or you can simply run `pip3 freeze` to get information about (all) currently installed pip-packages.
|
|
104
|
+
|
|
105
|
+
## Development
|
|
106
|
+
|
|
107
|
+
### Branching-system
|
|
108
|
+
|
|
109
|
+
This repository applies the [GitFlowSimplified](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/BranchingSystem/GitFlowSimplified/GitFlowSimplified.md)-branching-system.
|
|
110
|
+
|
|
111
|
+
### Repository-structure
|
|
112
|
+
|
|
113
|
+
This repository applies the [CommonProjectStructure](https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/blob/main/Conventions/RepositoryStructure/CommonProjectStructure/CommonProjectStructure.md) as repository-structure.
|
|
114
|
+
|
|
115
|
+
### Install dependencies
|
|
116
|
+
|
|
117
|
+
ScriptCollection requires [Python](https://www.python.org) 3.11 or newer.
|
|
118
|
+
|
|
119
|
+
To develop ScriptCollection it is obviously required that the following commandline-commands are available on your system:
|
|
120
|
+
|
|
121
|
+
- `python` (on some systems `python3`)
|
|
122
|
+
- `pip3`
|
|
123
|
+
|
|
124
|
+
The pip-packages which are required for developing on this project are defined in `ScriptCollection/requirements.txt`.
|
|
125
|
+
|
|
126
|
+
### IDE
|
|
127
|
+
|
|
128
|
+
The recommended IDE for developing ScriptCollection is Visual Studio Code.
|
|
129
|
+
The recommended addons for developing ScriptCollection with Visual Studio Code are:
|
|
130
|
+
|
|
131
|
+
- [Pylance](https://marketplace.visualstudio.com/items?itemName=ms-python.vscode-pylance)
|
|
132
|
+
- [Python](https://marketplace.visualstudio.com/items?itemName=ms-python.python)
|
|
133
|
+
- [Spell Right](https://marketplace.visualstudio.com/items?itemName=ban.spellright)
|
|
134
|
+
- [docs-markdown](https://marketplace.visualstudio.com/items?itemName=docsmsft.docs-markdown)
|
|
135
|
+
|
|
136
|
+
### Build
|
|
137
|
+
|
|
138
|
+
To create and install a ScriptCollection locally simply do the following commands in the repository-root:
|
|
139
|
+
|
|
140
|
+
```bash
|
|
141
|
+
python ./ScriptCollection/Other/Build/Build.py
|
|
142
|
+
pip3 install --force-reinstall ./ScriptCollection/Other/Artifacts/BuildResult_Wheel/scriptcollection-x.x.x-py3-none-any.whl
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
(Note: `x.x.x` must be replaced by the appropriate version-number.)
|
|
146
|
+
|
|
147
|
+
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). Afterwards `task dl` installs the built wheel locally.
|
|
148
|
+
|
|
149
|
+
### Coding style
|
|
150
|
+
|
|
151
|
+
In this repository [pylint](https://pylint.org/) will be used to report linting-issues.
|
|
152
|
+
If you change code in this repository please ensure pylint does not find any issues before creating a pull-request.
|
|
153
|
+
|
|
154
|
+
If linting-issues exist in the current code-base can be checked by running `python ./ScriptCollection/Other/QualityCheck/Linting.py`.
|
|
155
|
+
|
|
156
|
+
## Runtime dependencies
|
|
157
|
+
|
|
158
|
+
ScriptCollection requires [Python](https://www.python.org) 3.11 or newer.
|
|
159
|
+
|
|
160
|
+
The usual Python-dependencies will be installed automagically by `pip`.
|
|
161
|
+
|
|
162
|
+
For functions to read or change the permissions or the owner of a file the ScriptCollection relies on the functionality of the following tools:
|
|
163
|
+
|
|
164
|
+
- chmod
|
|
165
|
+
- chown
|
|
166
|
+
- ls
|
|
167
|
+
|
|
168
|
+
These tools must be available on the system where the functions should be executed. Meanwhile these tools are also available on Windows but may have a slightly limited functionality.
|
|
169
|
+
|
|
170
|
+
## License
|
|
171
|
+
|
|
172
|
+
See [License.txt](https://raw.githubusercontent.com/anionDevelopment/ScriptCollection/main/License.txt) for license-information.
|
|
@@ -11,7 +11,7 @@ ScriptCollection/ProgramRunnerSudo.py,sha256=vwKq-MOcqsgiKhSf-MBUDBC_UyaU8evP3Ro
|
|
|
11
11
|
ScriptCollection/RepositoryDiagramGenerator.py,sha256=K_u2NW_p4ozdWD50irJEkkcDVa70TcUJpZN63TeXSLw,7092
|
|
12
12
|
ScriptCollection/RepositoryHistoryAnalyzer.py,sha256=u9141B9D-Kef-9uo3yR7BXKUMzIKLVsesnYk7H-cWm4,6157
|
|
13
13
|
ScriptCollection/SCLog.py,sha256=Fjf8Pdi63cXHGMxL_aI6A0dwGm7QIfrv3czjvpSUlaM,4705
|
|
14
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
14
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=SB4DYgIPPdyPRlmuQkpBArtXrnjYwPmFZNXzz-TnRyM,310633
|
|
15
15
|
ScriptCollection/TestKind.py,sha256=jqLJwNvQeyea7SZf-UFzMC9pM0znv4do7FIC1xq8u9M,1672
|
|
16
16
|
ScriptCollection/UnassignedVariablesCheck.py,sha256=8xNcp1D5HeOLO1a1NEerq2TsnpFhw7yzYPkaay-oisY,3804
|
|
17
17
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -37,9 +37,9 @@ ScriptCollection/TFCPS/PubDependencies.py,sha256=hl6BfYjzb0-esO-pqyV_sxBLbHBi55G
|
|
|
37
37
|
ScriptCollection/TFCPS/SCTaskRunnerServer.py,sha256=mmtpxrFn36GlW9ZdmEb_oigsQZBqJ85awJb9BOP3tGI,31089
|
|
38
38
|
ScriptCollection/TFCPS/TFCPS_BuildCodeUnitsHook.py,sha256=67_DQwoH5bhxxSmwtuAeoW1NOCMiLMzOy48OqlJX-KY,1744
|
|
39
39
|
ScriptCollection/TFCPS/TFCPS_CodeSpellCheck.py,sha256=zV62O7UiGjewx1yQUIWmUJ9D-5ipkV_f28uNhp-JWUs,5306
|
|
40
|
-
ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=
|
|
41
|
-
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=
|
|
42
|
-
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=
|
|
40
|
+
ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=cQtYndqBLLOxRyRmid95fIvi4AswKgwxiolLTYnWV0w,40272
|
|
41
|
+
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=P9dqY-zZb5z76Dut8aYQJX481ZQbMQTP_Y8QjNEz9_8,9601
|
|
42
|
+
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=PxWyScOFyKZ9yBd39SeK6mxTxGrfCMZHA1vMK_ewN_M,63583
|
|
43
43
|
ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=BVK3fpEyjcXYVHIb6YYLH7bWe6iKRaCtPrJ3tXAemYw,6582
|
|
44
44
|
ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=mRBcf7XuNWOSXbZYc3NuJow18AMZ30D6Z-BtyNYfNcM,2072
|
|
45
45
|
ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=Krt5oyGNcRAN3szsgU7LoTh8yVTOdHW-Kq7R9MDDV-Q,7673
|
|
@@ -47,7 +47,7 @@ ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=oYEhz5ZWMnbu97_CcYEqdDxakUF
|
|
|
47
47
|
ScriptCollection/TFCPS/TFCPS_OCIImageSecretScan.py,sha256=Jb7AaMcJDW-gYEYBUVZAG3QLTTNWmXlvVEW-lZsykws,14821
|
|
48
48
|
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=XLVsFTA1jvfDbZ7wYJgIdEByZhF_bYVbA5jkisuvK4k,2322
|
|
49
49
|
ScriptCollection/TFCPS/TFCPS_RemoteBuild.py,sha256=2Tx5HLk1ZftBWDCTiGZdP2QiiGNyWsEuTCSt33dNQjc,23891
|
|
50
|
-
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=
|
|
50
|
+
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=A6yRDqF8U5k5BOw6tEI7Mwdj7vi3z9QNK5XFp9QvN3A,158033
|
|
51
51
|
ScriptCollection/TFCPS/TFCPS_VisualRegressionTests.py,sha256=F90CF5kLCgV_M3yN696xWzF1cglWLXecau9My2ZyGxw,42230
|
|
52
52
|
ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
53
|
ScriptCollection/TFCPS/CPP/TFCPS_CodeUnitSpecific_CPP.py,sha256=BNZPMjGiWLMBH7QDtP06WEVLMnI38NLX4Dpd13bSbi4,16614
|
|
@@ -57,7 +57,7 @@ ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5N
|
|
|
57
57
|
ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationBase.py,sha256=bT6Gd5pQpZCw4OQz6HWkPCSn5z__eUUEisABLDSxd0o,200
|
|
58
58
|
ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationGenerate.py,sha256=QyjOfMY22JWCvKjMelHiDWbJiWqotOfebpJpgDUaoO4,237
|
|
59
59
|
ScriptCollection/TFCPS/DotNet/CertificateGeneratorInformationNoGenerate.py,sha256=i0zEGehj0sttxjjZtoq2KFSKp_ulxVyWp_ZgAhIY_So,241
|
|
60
|
-
ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=
|
|
60
|
+
ScriptCollection/TFCPS/DotNet/TFCPS_CodeUnitSpecific_DotNet.py,sha256=RfvRHlB_sQFmnV-NYdluz8OstROMVczTSBzvcYOxLCc,71171
|
|
61
61
|
ScriptCollection/TFCPS/DotNet/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
62
62
|
ScriptCollection/TFCPS/Flutter/TFCPS_CodeUnitSpecific_Flutter.py,sha256=9PMxJFB4nyKGzl916UOCvHB5toIyLcWk-ZAM8vPdLxw,64571
|
|
63
63
|
ScriptCollection/TFCPS/Flutter/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -73,8 +73,8 @@ ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=yyjWPMHQjPLkML
|
|
|
73
73
|
ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
74
74
|
ScriptCollection/TFCPS/TypeScript/TFCPS_CodeUnitSpecific_TypeScript.py,sha256=ILVhJHvwG5TvPBBqSvyACYb7W9QnWrJpxKgHu8IQu4g,9249
|
|
75
75
|
ScriptCollection/TFCPS/TypeScript/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
76
|
-
scriptcollection-4.4.
|
|
77
|
-
scriptcollection-4.4.
|
|
78
|
-
scriptcollection-4.4.
|
|
79
|
-
scriptcollection-4.4.
|
|
80
|
-
scriptcollection-4.4.
|
|
76
|
+
scriptcollection-4.4.59.dist-info/METADATA,sha256=PUNsdtV23Zcp-tOEcyXiUq9v3GQ_cdTJ0QPv2y_z-Nk,8204
|
|
77
|
+
scriptcollection-4.4.59.dist-info/WHEEL,sha256=YVMoNqKzERt-wjUZwJ33xBGAwnFl-4cqbYkTtWa4itE,91
|
|
78
|
+
scriptcollection-4.4.59.dist-info/entry_points.txt,sha256=--Xk3EcTa14uk1YnUD8CQ2naQjNKJFohScd1ONy4CeY,6135
|
|
79
|
+
scriptcollection-4.4.59.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
80
|
+
scriptcollection-4.4.59.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|