ScriptCollection 3.4.4__py3-none-any.whl → 3.4.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ScriptCollection/Executables.py +0 -11
- ScriptCollection/ScriptCollectionCore.py +4 -33
- ScriptCollection/TasksForCommonProjectStructure.py +21 -10
- {ScriptCollection-3.4.4.dist-info → ScriptCollection-3.4.6.dist-info}/METADATA +1 -1
- ScriptCollection-3.4.6.dist-info/RECORD +14 -0
- {ScriptCollection-3.4.4.dist-info → ScriptCollection-3.4.6.dist-info}/WHEEL +1 -1
- ScriptCollection-3.4.4.dist-info/RECORD +0 -14
- {ScriptCollection-3.4.4.dist-info → ScriptCollection-3.4.6.dist-info}/entry_points.txt +0 -0
- {ScriptCollection-3.4.4.dist-info → ScriptCollection-3.4.6.dist-info}/top_level.txt +0 -0
ScriptCollection/Executables.py
CHANGED
|
@@ -72,17 +72,6 @@ def CalculateBitcoinBlockHash() -> int:
|
|
|
72
72
|
return 0
|
|
73
73
|
|
|
74
74
|
|
|
75
|
-
def UpdateNugetpackagesInCsharpProject() -> int:
|
|
76
|
-
|
|
77
|
-
parser = argparse.ArgumentParser(description="""TODO""")
|
|
78
|
-
parser.add_argument('csprojfile')
|
|
79
|
-
args = parser.parse_args()
|
|
80
|
-
if ScriptCollectionCore().SCUpdateNugetpackagesInCsharpProject(args.csprojfile):
|
|
81
|
-
return 1
|
|
82
|
-
else:
|
|
83
|
-
return 0
|
|
84
|
-
|
|
85
|
-
|
|
86
75
|
def Show2FAAsQRCode():
|
|
87
76
|
|
|
88
77
|
parser = argparse.ArgumentParser(description="""Always when you use 2-factor-authentication you have the problem:
|
|
@@ -29,7 +29,7 @@ from .ProgramRunnerPopen import ProgramRunnerPopen
|
|
|
29
29
|
from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
|
|
30
30
|
|
|
31
31
|
|
|
32
|
-
version = "3.4.
|
|
32
|
+
version = "3.4.6"
|
|
33
33
|
__version__ = version
|
|
34
34
|
|
|
35
35
|
|
|
@@ -879,16 +879,6 @@ class ScriptCollectionCore:
|
|
|
879
879
|
self.__print_qr_code_by_csv_line(line[0], line[1], line[2], line[3], line[4])
|
|
880
880
|
GeneralUtilities.write_message_to_stdout(separator_line)
|
|
881
881
|
|
|
882
|
-
@GeneralUtilities.check_arguments
|
|
883
|
-
def SCUpdateNugetpackagesInCsharpProject(self, csprojfile: str) -> int:
|
|
884
|
-
outdated_packages = self.get_nuget_packages_of_csproj_file(csprojfile, True)
|
|
885
|
-
GeneralUtilities.write_message_to_stdout("The following packages will be updated:")
|
|
886
|
-
for outdated_package in outdated_packages:
|
|
887
|
-
GeneralUtilities.write_message_to_stdout(outdated_package)
|
|
888
|
-
self.update_nuget_package(csprojfile, outdated_package)
|
|
889
|
-
GeneralUtilities.write_message_to_stdout(f"{len(outdated_packages)} package(s) were updated")
|
|
890
|
-
return len(outdated_packages) > 0
|
|
891
|
-
|
|
892
882
|
@GeneralUtilities.check_arguments
|
|
893
883
|
def SCUploadFileToFileHost(self, file: str, host: str) -> int:
|
|
894
884
|
try:
|
|
@@ -1118,25 +1108,6 @@ class ScriptCollectionCore:
|
|
|
1118
1108
|
GeneralUtilities.ensure_file_does_not_exist(coveragefile)
|
|
1119
1109
|
os.rename(os.path.join(repository_folder, "coverage.xml"), coveragefile)
|
|
1120
1110
|
|
|
1121
|
-
@GeneralUtilities.check_arguments
|
|
1122
|
-
def get_nuget_packages_of_csproj_file(self, csproj_file: str, only_outdated_packages: bool) -> bool:
|
|
1123
|
-
self.run_program("dotnet", f'restore --disable-parallel --force --force-evaluate "{csproj_file}"')
|
|
1124
|
-
if only_outdated_packages:
|
|
1125
|
-
only_outdated_packages_argument = " --outdated"
|
|
1126
|
-
else:
|
|
1127
|
-
only_outdated_packages_argument = ""
|
|
1128
|
-
stdout = self.run_program("dotnet", f'list "{csproj_file}" package{only_outdated_packages_argument}')[1]
|
|
1129
|
-
result = []
|
|
1130
|
-
for line in stdout.splitlines():
|
|
1131
|
-
trimmed_line = line.replace("\t", "").strip()
|
|
1132
|
-
if trimmed_line.startswith(">"):
|
|
1133
|
-
result.append(trimmed_line[2:].split(" ")[0])
|
|
1134
|
-
return result
|
|
1135
|
-
|
|
1136
|
-
@GeneralUtilities.check_arguments
|
|
1137
|
-
def update_nuget_package(self, csproj_file: str, name: str) -> None:
|
|
1138
|
-
self.run_program("dotnet", f'add "{csproj_file}" package {name}')
|
|
1139
|
-
|
|
1140
1111
|
@GeneralUtilities.check_arguments
|
|
1141
1112
|
def get_file_permission(self, file: str) -> str:
|
|
1142
1113
|
"""This function returns an usual octet-triple, for example "0700"."""
|
|
@@ -1546,7 +1517,7 @@ class ScriptCollectionCore:
|
|
|
1546
1517
|
f'-keyout {name}.key -out {name}.crt', folder)
|
|
1547
1518
|
|
|
1548
1519
|
@GeneralUtilities.check_arguments
|
|
1549
|
-
def generate_certificate(self, folder: str, domain: str,filename:str, subj_c: str, subj_st: str, subj_l: str, subj_o: str, subj_ou: str,
|
|
1520
|
+
def generate_certificate(self, folder: str, domain: str, filename: str, subj_c: str, subj_st: str, subj_l: str, subj_o: str, subj_ou: str,
|
|
1550
1521
|
days_until_expire: int = None, password: str = None) -> None:
|
|
1551
1522
|
if days_until_expire is None:
|
|
1552
1523
|
days_until_expire = 397
|
|
@@ -1582,12 +1553,12 @@ DNS = {domain}
|
|
|
1582
1553
|
""")
|
|
1583
1554
|
|
|
1584
1555
|
@GeneralUtilities.check_arguments
|
|
1585
|
-
def generate_certificate_sign_request(self, folder: str, domain: str,filename:str, subj_c: str, subj_st: str, subj_l: str, subj_o: str, subj_ou: str) -> None:
|
|
1556
|
+
def generate_certificate_sign_request(self, folder: str, domain: str, filename: str, subj_c: str, subj_st: str, subj_l: str, subj_o: str, subj_ou: str) -> None:
|
|
1586
1557
|
self.run_program("openssl", f'req -new -subj /C={subj_c}/ST={subj_st}/L={subj_l}/O={subj_o}/CN={domain}/OU={subj_ou} ' +
|
|
1587
1558
|
f'-key {filename}.key -out {filename}.csr -config {filename}.san.conf', folder)
|
|
1588
1559
|
|
|
1589
1560
|
@GeneralUtilities.check_arguments
|
|
1590
|
-
def sign_certificate(self, folder: str, ca_folder: str, ca_name: str, domain: str,filename:str, days_until_expire: int = None) -> None:
|
|
1561
|
+
def sign_certificate(self, folder: str, ca_folder: str, ca_name: str, domain: str, filename: str, days_until_expire: int = None) -> None:
|
|
1591
1562
|
if days_until_expire is None:
|
|
1592
1563
|
days_until_expire = 397
|
|
1593
1564
|
ca = os.path.join(ca_folder, ca_name)
|
|
@@ -272,7 +272,7 @@ class TasksForCommonProjectStructure:
|
|
|
272
272
|
if gpg_identity is None:
|
|
273
273
|
gpg_identity_argument = ""
|
|
274
274
|
else:
|
|
275
|
-
|
|
275
|
+
gpg_identity_argument = "" # f" --sign --identity {gpg_identity}"
|
|
276
276
|
# disabled due to https://blog.pypi.org/posts/2023-05-23-removing-pgp/
|
|
277
277
|
|
|
278
278
|
if verbosity > 2:
|
|
@@ -763,8 +763,7 @@ class TasksForCommonProjectStructure:
|
|
|
763
763
|
|
|
764
764
|
@GeneralUtilities.check_arguments
|
|
765
765
|
def standardized_tasks_run_testcases_for_dotnet_project(self, runtestcases_file: str, targetenvironmenttype: str, verbosity: int, generate_badges: bool,
|
|
766
|
-
|
|
767
|
-
dotnet_build_configuration: str = target_environmenttype_mapping[targetenvironmenttype]
|
|
766
|
+
commandline_arguments: list[str]):
|
|
768
767
|
codeunit_name: str = os.path.basename(str(Path(os.path.dirname(runtestcases_file)).parent.parent.absolute()))
|
|
769
768
|
verbosity = TasksForCommonProjectStructure.get_verbosity_from_commandline_arguments(commandline_arguments, verbosity)
|
|
770
769
|
repository_folder: str = str(Path(os.path.dirname(runtestcases_file)).parent.parent.parent.absolute())
|
|
@@ -774,7 +773,7 @@ class TasksForCommonProjectStructure:
|
|
|
774
773
|
runsettings_file = self.dotnet_runsettings_file
|
|
775
774
|
if os.path.isfile(os.path.join(working_directory, runsettings_file)):
|
|
776
775
|
runsettings_argument = f"--settings {runsettings_file} "
|
|
777
|
-
arg = f"collect dotnet test {runsettings_argument}-
|
|
776
|
+
arg = f"collect dotnet test {runsettings_argument} --no-build --output-format cobertura --output Other\\Artifacts\\TestCoverage\\Testcoverage"
|
|
778
777
|
self.__sc.run_program("dotnet-coverage", arg, working_directory, verbosity=verbosity)
|
|
779
778
|
os.rename(os.path.join(coverage_file_folder, "Testcoverage.cobertura.xml"), os.path.join(coverage_file_folder, "TestCoverage.xml"))
|
|
780
779
|
self.run_testcases_common_post_task(repository_folder, codeunit_name, verbosity, generate_badges, targetenvironmenttype, commandline_arguments)
|
|
@@ -1642,6 +1641,7 @@ class TasksForCommonProjectStructure:
|
|
|
1642
1641
|
|
|
1643
1642
|
@GeneralUtilities.check_arguments
|
|
1644
1643
|
def update_dependencies_of_typical_python_codeunit(self, update_script_file: str, verbosity: int, cmd_args: list[str]):
|
|
1644
|
+
# TODO generalize and add option to ignore certain dependencies
|
|
1645
1645
|
verbosity = self.get_verbosity_from_commandline_arguments(cmd_args, verbosity)
|
|
1646
1646
|
codeunit_folder = GeneralUtilities.resolve_relative_path("..", os.path.dirname(update_script_file))
|
|
1647
1647
|
self.__sc.update_dependencies_of_python_in_setupcfg_file(os.path.join(codeunit_folder, "setup.cfg"), verbosity)
|
|
@@ -1651,6 +1651,7 @@ class TasksForCommonProjectStructure:
|
|
|
1651
1651
|
|
|
1652
1652
|
@GeneralUtilities.check_arguments
|
|
1653
1653
|
def update_dependencies_of_typical_dotnet_codeunit(self, update_script_file: str, verbosity: int, cmd_args: list[str]):
|
|
1654
|
+
# TODO generalize and add option to ignore certain dependencies
|
|
1654
1655
|
verbosity = self.get_verbosity_from_commandline_arguments(cmd_args, verbosity)
|
|
1655
1656
|
codeunit_folder = GeneralUtilities.resolve_relative_path("..", os.path.dirname(update_script_file))
|
|
1656
1657
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
@@ -1661,7 +1662,7 @@ class TasksForCommonProjectStructure:
|
|
|
1661
1662
|
|
|
1662
1663
|
@GeneralUtilities.check_arguments
|
|
1663
1664
|
def update_dependencies_of_typical_node_codeunit(self, update_script_file: str, verbosity: int, cmd_args: list[str]):
|
|
1664
|
-
pass # TODO
|
|
1665
|
+
pass # TODO generalize and add option to ignore certain dependencies
|
|
1665
1666
|
|
|
1666
1667
|
@GeneralUtilities.check_arguments
|
|
1667
1668
|
def standardized_tasks_update_version_in_docker_examples(self, file, codeunit_version):
|
|
@@ -1970,6 +1971,7 @@ class TasksForCommonProjectStructure:
|
|
|
1970
1971
|
additional_arguments_r: str = ""
|
|
1971
1972
|
additional_arguments_l: str = ""
|
|
1972
1973
|
additional_arguments_g: str = ""
|
|
1974
|
+
additional_arguments_f: str = ""
|
|
1973
1975
|
general_argument = f' --overwrite_verbosity={str(verbosity)} --overwrite_targetenvironmenttype={target_environmenttype}'
|
|
1974
1976
|
|
|
1975
1977
|
c_additionalargumentsfile_argument = ""
|
|
@@ -1989,15 +1991,17 @@ class TasksForCommonProjectStructure:
|
|
|
1989
1991
|
config.read(additional_arguments_file)
|
|
1990
1992
|
section_name = f"{codeunit_name}_Configuration"
|
|
1991
1993
|
if config.has_option(section_name, "ArgumentsForCommonTasks"):
|
|
1992
|
-
additional_arguments_c = " "+config.get(section_name, "ArgumentsForCommonTasks")
|
|
1994
|
+
additional_arguments_c = " " + config.get(section_name, "ArgumentsForCommonTasks")
|
|
1993
1995
|
if config.has_option(section_name, "ArgumentsForBuild"):
|
|
1994
|
-
additional_arguments_b = " "+config.get(section_name, "ArgumentsForBuild")
|
|
1996
|
+
additional_arguments_b = " " + config.get(section_name, "ArgumentsForBuild")
|
|
1995
1997
|
if config.has_option(section_name, "ArgumentsForRunTestcases"):
|
|
1996
|
-
additional_arguments_r = " "+config.get(section_name, "ArgumentsForRunTestcases")
|
|
1998
|
+
additional_arguments_r = " " + config.get(section_name, "ArgumentsForRunTestcases")
|
|
1997
1999
|
if config.has_option(section_name, "ArgumentsForLinting"):
|
|
1998
|
-
additional_arguments_l = " "+config.get(section_name, "ArgumentsForLinting")
|
|
2000
|
+
additional_arguments_l = " " + config.get(section_name, "ArgumentsForLinting")
|
|
1999
2001
|
if config.has_option(section_name, "ArgumentsForGenerateReference"):
|
|
2000
|
-
additional_arguments_g = " "+config.get(section_name, "ArgumentsForGenerateReference")
|
|
2002
|
+
additional_arguments_g = " " + config.get(section_name, "ArgumentsForGenerateReference")
|
|
2003
|
+
if config.has_option(section_name, "ArgumentsForOnFinish"):
|
|
2004
|
+
additional_arguments_f = " " + config.get(section_name, "ArgumentsForOnFinish")
|
|
2001
2005
|
c_additionalargumentsfile_argument = f' --overwrite_additionalargumentsfile="{additional_arguments_file}"'
|
|
2002
2006
|
|
|
2003
2007
|
GeneralUtilities.write_message_to_stdout('Run "CommonTasks.py"...')
|
|
@@ -2037,6 +2041,13 @@ class TasksForCommonProjectStructure:
|
|
|
2037
2041
|
raise ValueError(f"GenerateReference.py resulted in exitcode {execution_result[0]}. StdOut: '{execution_result[1]}' StdOut: '{execution_result[2]}'")
|
|
2038
2042
|
self.verify_artifact_exists(codeunit_folder, dict[str, bool]({"Reference": True}))
|
|
2039
2043
|
|
|
2044
|
+
if os.path.isfile(os.path.join(other_folder, "OnBuildingFinished.py")):
|
|
2045
|
+
GeneralUtilities.write_message_to_stdout('Run "OnBuildingFinished.py"...')
|
|
2046
|
+
execution_result = self.__sc.run_program(
|
|
2047
|
+
"python", f"OnBuildingFinished.py{additional_arguments_f}{general_argument}", other_folder, verbosity=verbosity_for_executed_programs, throw_exception_if_exitcode_is_not_zero=False)
|
|
2048
|
+
if execution_result[0] != 0:
|
|
2049
|
+
raise ValueError(f"OnBuildingFinished.py resulted in exitcode {execution_result[0]}. StdOut: '{execution_result[1]}' StdOut: '{execution_result[2]}'")
|
|
2050
|
+
|
|
2040
2051
|
artifactsinformation_file = os.path.join(artifacts_folder, f"{codeunit_name}.artifactsinformation.xml")
|
|
2041
2052
|
codeunit_version = self.get_version_of_codeunit(codeunit_file)
|
|
2042
2053
|
GeneralUtilities.ensure_file_exists(artifactsinformation_file)
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
ScriptCollection/Executables.py,sha256=srooVN3-X76sJKG99BxKBV4kuF_GFNq-SuV-zTmNJGw,19002
|
|
2
|
+
ScriptCollection/GeneralUtilities.py,sha256=vZDiW5lWJRCrIZVs1bTCZ-O5slQnM5dv4GcJ-RTMowY,34378
|
|
3
|
+
ScriptCollection/ProgramRunnerBase.py,sha256=2kyOuoM3oFjBfLc9Q5t5RTz7Ya2CjUxFtB1rBBDmnjU,1937
|
|
4
|
+
ScriptCollection/ProgramRunnerEpew.py,sha256=nIzY4dG6W-xEpkeoTbozwNZtFSIo-bU_W6t6u1AZKtE,6275
|
|
5
|
+
ScriptCollection/ProgramRunnerPopen.py,sha256=HOs1QVnXiQtwXy1_xvH79bWBdd0i-2tUyyLloQBvMto,3023
|
|
6
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=hOkgV6v1XGqiX9TU7_Oqe-UJlYFmFmEwxKwaIybI2JI,94554
|
|
7
|
+
ScriptCollection/TasksForCommonProjectStructure.py,sha256=3ZXzRX7YAzLS8NurwSG0WLfnByVEbmmzx-s8zBME4vs,145487
|
|
8
|
+
ScriptCollection/UpdateCertificates.py,sha256=Go-JJK-YTi7aBB1phlLxypa8GHkmFHBEPB0_TT9G-bw,7918
|
|
9
|
+
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
+
ScriptCollection-3.4.6.dist-info/METADATA,sha256=a0a1ZlEkJK2t1C0-CV_bSxnINH0Hjw-AXuakJ6UPfSY,7650
|
|
11
|
+
ScriptCollection-3.4.6.dist-info/WHEEL,sha256=AtBG6SXL3KF_v0NxLf0ehyVOh0cold-JbJYXNGorC6Q,92
|
|
12
|
+
ScriptCollection-3.4.6.dist-info/entry_points.txt,sha256=dJKdWcH41owxlKx_khj4P7DItr9lhxWP9JU2Dq8GSsQ,2088
|
|
13
|
+
ScriptCollection-3.4.6.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
14
|
+
ScriptCollection-3.4.6.dist-info/RECORD,,
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
ScriptCollection/Executables.py,sha256=AXU8jbBlfosp6lvGS5IsfiR9dbtRjubdniuc_uFqvs8,19324
|
|
2
|
-
ScriptCollection/GeneralUtilities.py,sha256=vZDiW5lWJRCrIZVs1bTCZ-O5slQnM5dv4GcJ-RTMowY,34378
|
|
3
|
-
ScriptCollection/ProgramRunnerBase.py,sha256=2kyOuoM3oFjBfLc9Q5t5RTz7Ya2CjUxFtB1rBBDmnjU,1937
|
|
4
|
-
ScriptCollection/ProgramRunnerEpew.py,sha256=nIzY4dG6W-xEpkeoTbozwNZtFSIo-bU_W6t6u1AZKtE,6275
|
|
5
|
-
ScriptCollection/ProgramRunnerPopen.py,sha256=HOs1QVnXiQtwXy1_xvH79bWBdd0i-2tUyyLloQBvMto,3023
|
|
6
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=zRtYGEz-Mt54agZsddDTJ33D6UiSlRCZR6Ldw5BpAoY,96159
|
|
7
|
-
ScriptCollection/TasksForCommonProjectStructure.py,sha256=cxoJe_VblieUuimcS43lrE0k3K2_fOES15AE7BIKNNY,144595
|
|
8
|
-
ScriptCollection/UpdateCertificates.py,sha256=Go-JJK-YTi7aBB1phlLxypa8GHkmFHBEPB0_TT9G-bw,7918
|
|
9
|
-
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
10
|
-
ScriptCollection-3.4.4.dist-info/METADATA,sha256=F8Wpy2yUsUcUsuQ5IH8Bg34HkdkWKQdVT1FbKHV3jDU,7650
|
|
11
|
-
ScriptCollection-3.4.4.dist-info/WHEEL,sha256=pkctZYzUS4AYVn6dJ-7367OJZivF2e8RA9b_ZBjif18,92
|
|
12
|
-
ScriptCollection-3.4.4.dist-info/entry_points.txt,sha256=dJKdWcH41owxlKx_khj4P7DItr9lhxWP9JU2Dq8GSsQ,2088
|
|
13
|
-
ScriptCollection-3.4.4.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
14
|
-
ScriptCollection-3.4.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|