ScriptCollection 3.5.23__py3-none-any.whl → 3.5.25__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- ScriptCollection/ScriptCollectionCore.py +17 -2
- ScriptCollection/TasksForCommonProjectStructure.py +21 -4
- {ScriptCollection-3.5.23.dist-info → ScriptCollection-3.5.25.dist-info}/METADATA +1 -1
- {ScriptCollection-3.5.23.dist-info → ScriptCollection-3.5.25.dist-info}/RECORD +7 -7
- {ScriptCollection-3.5.23.dist-info → ScriptCollection-3.5.25.dist-info}/WHEEL +0 -0
- {ScriptCollection-3.5.23.dist-info → ScriptCollection-3.5.25.dist-info}/entry_points.txt +0 -0
- {ScriptCollection-3.5.23.dist-info → ScriptCollection-3.5.25.dist-info}/top_level.txt +0 -0
|
@@ -4,6 +4,7 @@ import json
|
|
|
4
4
|
import binascii
|
|
5
5
|
import filecmp
|
|
6
6
|
import hashlib
|
|
7
|
+
import multiprocessing
|
|
7
8
|
import time
|
|
8
9
|
from io import BytesIO
|
|
9
10
|
import itertools
|
|
@@ -30,7 +31,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
|
|
|
30
31
|
from .ProgramRunnerPopen import ProgramRunnerPopen
|
|
31
32
|
from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
|
|
32
33
|
|
|
33
|
-
version = "3.5.
|
|
34
|
+
version = "3.5.25"
|
|
34
35
|
__version__ = version
|
|
35
36
|
|
|
36
37
|
|
|
@@ -1072,7 +1073,7 @@ class ScriptCollectionCore:
|
|
|
1072
1073
|
@GeneralUtilities.check_arguments
|
|
1073
1074
|
def get_docker_debian_version(self, image_tag: str) -> str:
|
|
1074
1075
|
result = ScriptCollectionCore().run_program_argsasarray("docker", ['run', f'debian:{image_tag}', 'bash', '-c', 'apt-get -y update && apt-get -y install lsb-release && lsb_release -cs'])
|
|
1075
|
-
result_line = GeneralUtilities.string_to_lines(result[1])[-
|
|
1076
|
+
result_line = GeneralUtilities.string_to_lines(result[1])[-1]
|
|
1076
1077
|
return result_line
|
|
1077
1078
|
|
|
1078
1079
|
@GeneralUtilities.check_arguments
|
|
@@ -1870,3 +1871,17 @@ TXDX
|
|
|
1870
1871
|
- [QualityCheck-system](TXDX)
|
|
1871
1872
|
|
|
1872
1873
|
""")
|
|
1874
|
+
|
|
1875
|
+
@GeneralUtilities.check_arguments
|
|
1876
|
+
def run_with_timeout(self, method, timeout_in_seconds: float) -> bool:
|
|
1877
|
+
# Returns true if the method was terminated due to a timeout
|
|
1878
|
+
# Returns false if the method terminates in the given time
|
|
1879
|
+
p = multiprocessing.Process(target=method)
|
|
1880
|
+
p.start()
|
|
1881
|
+
p.join(timeout_in_seconds)
|
|
1882
|
+
if p.is_alive():
|
|
1883
|
+
p.kill()
|
|
1884
|
+
p.join()
|
|
1885
|
+
return True
|
|
1886
|
+
else:
|
|
1887
|
+
return False
|
|
@@ -1287,8 +1287,9 @@ class TasksForCommonProjectStructure:
|
|
|
1287
1287
|
codeunitname: str = Path(os.path.dirname(build_script_file)).parent.parent.name
|
|
1288
1288
|
codeunit_folder = GeneralUtilities.resolve_relative_path("../..", str(os.path.dirname(build_script_file)))
|
|
1289
1289
|
codeunitname_lower = codeunitname.lower()
|
|
1290
|
-
|
|
1291
|
-
|
|
1290
|
+
codeunit_file = os.path.join(codeunit_folder, f"{codeunitname}.codeunit.xml")
|
|
1291
|
+
codeunitversion = self.get_version_of_codeunit(codeunit_file)
|
|
1292
|
+
args = ["image", "build", "--pull", "--force-rm", "--progress=plain", "--build-arg", f"TargetEnvironmentType={target_environment_type}", "--build-arg", f"CodeUnitName={codeunitname}", "--build-arg", f"CodeUnitVersion={codeunitversion}", "--build-arg", f"CodeUnitOwnerName={self.get_codeunit_owner_name(codeunit_file)}", "--build-arg", f"CodeUnitOwnerEMailAddress={self.get_codeunit_owner_emailaddress(codeunit_file)}"]
|
|
1292
1293
|
for custom_argument_key, custom_argument_value in custom_arguments.items():
|
|
1293
1294
|
args.append("--build-arg")
|
|
1294
1295
|
args.append(f"{custom_argument_key}={custom_argument_value}")
|
|
@@ -1430,11 +1431,11 @@ class TasksForCommonProjectStructure:
|
|
|
1430
1431
|
raise ValueError(f"The folder-name ('{codeunit_name}') is not equal to the codeunit-name ('{codeunit_name_in_codeunit_file}').")
|
|
1431
1432
|
|
|
1432
1433
|
# Check owner-name
|
|
1433
|
-
codeunit_ownername_in_codeunit_file =
|
|
1434
|
+
codeunit_ownername_in_codeunit_file = self. get_codeunit_owner_name(codeunit_file)
|
|
1434
1435
|
GeneralUtilities.assert_condition(GeneralUtilities.string_has_content(codeunit_ownername_in_codeunit_file), "No valid name for codeunitowner given.")
|
|
1435
1436
|
|
|
1436
1437
|
# Check owner-emailaddress
|
|
1437
|
-
codeunit_owneremailaddress_in_codeunit_file =
|
|
1438
|
+
codeunit_owneremailaddress_in_codeunit_file = self.get_codeunit_owner_emailaddress(codeunit_file)
|
|
1438
1439
|
GeneralUtilities.assert_condition(GeneralUtilities.string_has_content(codeunit_owneremailaddress_in_codeunit_file), "No valid email-address for codeunitowner given.")
|
|
1439
1440
|
|
|
1440
1441
|
# Check development-state
|
|
@@ -1512,6 +1513,22 @@ class TasksForCommonProjectStructure:
|
|
|
1512
1513
|
# Generate diff-report
|
|
1513
1514
|
self.generate_diff_report(repository_folder, codeunit_name, codeunit_version)
|
|
1514
1515
|
|
|
1516
|
+
@GeneralUtilities.check_arguments
|
|
1517
|
+
def get_codeunit_owner_name(self, codeunit_file: str) -> None:
|
|
1518
|
+
namespaces = {'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure',
|
|
1519
|
+
'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
|
|
1520
|
+
root: etree._ElementTree = etree.parse(codeunit_file)
|
|
1521
|
+
result = root.xpath('//cps:codeunit/cps:codeunitownername/text()', namespaces=namespaces)[0]
|
|
1522
|
+
return result
|
|
1523
|
+
|
|
1524
|
+
@GeneralUtilities.check_arguments
|
|
1525
|
+
def get_codeunit_owner_emailaddress(self, codeunit_file: str) -> None:
|
|
1526
|
+
namespaces = {'cps': 'https://projects.aniondev.de/PublicProjects/Common/ProjectTemplates/-/tree/main/Conventions/RepositoryStructure/CommonProjectStructure',
|
|
1527
|
+
'xsi': 'http://www.w3.org/2001/XMLSchema-instance'}
|
|
1528
|
+
root: etree._ElementTree = etree.parse(codeunit_file)
|
|
1529
|
+
result = root.xpath('//cps:codeunit/cps:codeunitowneremailaddress/text()', namespaces=namespaces)[0]
|
|
1530
|
+
return result
|
|
1531
|
+
|
|
1515
1532
|
@GeneralUtilities.check_arguments
|
|
1516
1533
|
def generate_diff_report(self, repository_folder: str, codeunit_name: str, current_version: str) -> None:
|
|
1517
1534
|
codeunit_folder = os.path.join(repository_folder, codeunit_name)
|
|
@@ -5,12 +5,12 @@ ScriptCollection/ProgramRunnerBase.py,sha256=7QAjoqOz6XPmJH19F2k-Z1fFQB_uZnPFvn-
|
|
|
5
5
|
ScriptCollection/ProgramRunnerEpew.py,sha256=C2Rs3YWOWWWJct7XmKphp5CF1tf0j4Fp-ljV2drLTfs,6349
|
|
6
6
|
ScriptCollection/ProgramRunnerPopen.py,sha256=G3LgQUVCfaq7XjBsGzalElH31Hbr0etttGR2_H87YzA,3512
|
|
7
7
|
ScriptCollection/RPStream.py,sha256=NRRHL3YSP3D9MuAV2jB_--0KUKCsvJGxeKnxgrRZ9kY,1545
|
|
8
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
9
|
-
ScriptCollection/TasksForCommonProjectStructure.py,sha256=
|
|
8
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=QkSVb1Ehol4v-13QRK44aQcGbvWG8O4H0wW5OUm86B0,101078
|
|
9
|
+
ScriptCollection/TasksForCommonProjectStructure.py,sha256=2s_oiUzfcBgKWc33kYphcqDlfdnwpYkn8oCUxKeWmhc,193504
|
|
10
10
|
ScriptCollection/UpdateCertificates.py,sha256=Eynbgu7k9jLxApP2D_8Il77B6BFjJap6K7oTeEAZYbk,7790
|
|
11
11
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
12
|
-
ScriptCollection-3.5.
|
|
13
|
-
ScriptCollection-3.5.
|
|
14
|
-
ScriptCollection-3.5.
|
|
15
|
-
ScriptCollection-3.5.
|
|
16
|
-
ScriptCollection-3.5.
|
|
12
|
+
ScriptCollection-3.5.25.dist-info/METADATA,sha256=Yj0rW-8rdvEl6z12x6uLz3MIiTt4xOWVwZchFUOQMnM,7684
|
|
13
|
+
ScriptCollection-3.5.25.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
14
|
+
ScriptCollection-3.5.25.dist-info/entry_points.txt,sha256=yASwR6hWZ_b5d4W49YeX1htD8ngfWbwgjpfQiJdtUAU,2322
|
|
15
|
+
ScriptCollection-3.5.25.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
16
|
+
ScriptCollection-3.5.25.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|