ScriptCollection 4.2.121__py3-none-any.whl → 4.2.122__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/TFCPS_Tools_General.py +40 -5
- {scriptcollection-4.2.121.dist-info → scriptcollection-4.2.122.dist-info}/METADATA +1 -1
- {scriptcollection-4.2.121.dist-info → scriptcollection-4.2.122.dist-info}/RECORD +7 -7
- {scriptcollection-4.2.121.dist-info → scriptcollection-4.2.122.dist-info}/WHEEL +0 -0
- {scriptcollection-4.2.121.dist-info → scriptcollection-4.2.122.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.2.121.dist-info → scriptcollection-4.2.122.dist-info}/top_level.txt +0 -0
|
@@ -1305,6 +1305,7 @@ class TFCPS_Tools_General:
|
|
|
1305
1305
|
GeneralUtilities.assert_file_exists(os.path.join(codeunit_folder, "ReadMe.md"))
|
|
1306
1306
|
self.__sc.run_program_with_retry("docker-pushrm", target_image_address, codeunit_folder)
|
|
1307
1307
|
|
|
1308
|
+
@GeneralUtilities.check_arguments
|
|
1308
1309
|
def push_docker_build_artifact_as_multi_arch_artifact(self,tar_files: list[tuple[str, str, str]], image_address: str, tag: str):
|
|
1309
1310
|
"""
|
|
1310
1311
|
tar_files: list of (tar_path, os, arch) tuples
|
|
@@ -1458,6 +1459,7 @@ class TFCPS_Tools_General:
|
|
|
1458
1459
|
- Updated geo-ip-database.
|
|
1459
1460
|
""")
|
|
1460
1461
|
|
|
1462
|
+
@GeneralUtilities.check_arguments
|
|
1461
1463
|
def set_latest_version_for_clone_repository_as_resource(self,repository_folder:str, resourcename: str, github_link: str, branch: str = "main"):
|
|
1462
1464
|
resrepo_commit_id_folder: str = os.path.join(repository_folder, "Other", "Resources", f"{resourcename}Version")
|
|
1463
1465
|
resrepo_commit_id_file: str = os.path.join(resrepo_commit_id_folder, f"{resourcename}Version.txt")
|
|
@@ -1554,6 +1556,7 @@ class TFCPS_Tools_General:
|
|
|
1554
1556
|
arguments_for_log=arguments
|
|
1555
1557
|
self.__sc.run_program_with_retry("docker",arguments,test_service_folder,arguments_for_log=arguments_for_log,print_live_output=self.__sc.log.loglevel==LogLevel.Debug)
|
|
1556
1558
|
|
|
1559
|
+
@GeneralUtilities.check_arguments
|
|
1557
1560
|
def load_deb_control_file_content(self, file: str, codeunitname: str, codeunitversion: str, installedsize: int, maintainername: str, maintaineremail: str, description: str) -> str:
|
|
1558
1561
|
content = GeneralUtilities.read_text_from_file(file)
|
|
1559
1562
|
content = GeneralUtilities.replace_variable_in_string(content, "codeunitname", codeunitname)
|
|
@@ -1564,6 +1567,7 @@ class TFCPS_Tools_General:
|
|
|
1564
1567
|
content = GeneralUtilities.replace_variable_in_string(content, "description", description)
|
|
1565
1568
|
return content
|
|
1566
1569
|
|
|
1570
|
+
@GeneralUtilities.check_arguments
|
|
1567
1571
|
def calculate_deb_package_size(self, binary_folder: str) -> int:
|
|
1568
1572
|
size_in_bytes = 0
|
|
1569
1573
|
for file in GeneralUtilities.get_all_files_of_folder(binary_folder):
|
|
@@ -1571,6 +1575,7 @@ class TFCPS_Tools_General:
|
|
|
1571
1575
|
result = math.ceil(size_in_bytes/1024)
|
|
1572
1576
|
return result
|
|
1573
1577
|
|
|
1578
|
+
@GeneralUtilities.check_arguments
|
|
1574
1579
|
def create_deb_package_for_artifact(self,codeunit_folder: str, maintainername: str, maintaineremail: str, description: str) -> None:
|
|
1575
1580
|
self.assert_is_codeunit_folder(codeunit_folder)
|
|
1576
1581
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
@@ -1591,6 +1596,7 @@ class TFCPS_Tools_General:
|
|
|
1591
1596
|
GeneralUtilities.ensure_folder_exists_and_is_empty(target_folder)
|
|
1592
1597
|
shutil.move(archive_file, target_folder)
|
|
1593
1598
|
|
|
1599
|
+
@GeneralUtilities.check_arguments
|
|
1594
1600
|
def generate_winget_zip_manifest(self, codeunit_folder: str, artifact_name_of_zip: str):
|
|
1595
1601
|
self.assert_is_codeunit_folder(codeunit_folder)
|
|
1596
1602
|
codeunit_name = os.path.basename(codeunit_folder)
|
|
@@ -1610,7 +1616,8 @@ class TFCPS_Tools_General:
|
|
|
1610
1616
|
manifest_content = GeneralUtilities.replace_variable_in_string(manifest_content, "sha256_hashvalue", GeneralUtilities.get_sha256_of_file(artifacts_file))
|
|
1611
1617
|
GeneralUtilities.write_text_to_file(winget_manifest_file, manifest_content)
|
|
1612
1618
|
|
|
1613
|
-
|
|
1619
|
+
@GeneralUtilities.check_arguments
|
|
1620
|
+
def download_file(self,source:str, target:str):
|
|
1614
1621
|
GeneralUtilities.ensure_directory_exists(os.path.dirname(target))
|
|
1615
1622
|
GeneralUtilities.ensure_file_exists(target)
|
|
1616
1623
|
response = requests.get(source, timeout=30)
|
|
@@ -1618,16 +1625,44 @@ class TFCPS_Tools_General:
|
|
|
1618
1625
|
with open(target, "wb") as f:
|
|
1619
1626
|
f.write(response.content)
|
|
1620
1627
|
|
|
1621
|
-
|
|
1628
|
+
@GeneralUtilities.check_arguments
|
|
1629
|
+
def try_update_basic_codeunitreference_from_examples_repository(self, codeunit_folder:str,example_codeunit_name: str):
|
|
1622
1630
|
source=f"https://raw.githubusercontent.com/anionDev/CommonProjectStructureExamples/refs/heads/main/{example_codeunit_name}/Other/Reference/ReferenceContent/HowToBuild.md"
|
|
1623
1631
|
target=f"{codeunit_folder}/Other/Reference/ReferenceContent/HowToBuild.md"
|
|
1624
1632
|
self.download_file(source,target)
|
|
1625
1633
|
|
|
1626
|
-
|
|
1634
|
+
@GeneralUtilities.check_arguments
|
|
1635
|
+
def try_update_basic_repositoryreference_from_examples_repository(self, repository_folder:str):
|
|
1627
1636
|
source=f"https://raw.githubusercontent.com/anionDev/CommonProjectStructureExamples/refs/heads/main/Other/Reference/RepositoryStructure.mdd"
|
|
1628
1637
|
target=f"{repository_folder}/Other/Reference/RepositoryStructure.md"
|
|
1629
1638
|
self.download_file(source,target)
|
|
1630
1639
|
|
|
1631
|
-
|
|
1632
|
-
def update_dependent_oci_images(self,repo:str):
|
|
1640
|
+
@GeneralUtilities.check_arguments
|
|
1641
|
+
def update_dependent_oci_images(self, repo:str):
|
|
1633
1642
|
self.oci_image_manager.update_default_tag_for_images_in_image_definitions_file(repo,True)
|
|
1643
|
+
|
|
1644
|
+
@GeneralUtilities.check_arguments
|
|
1645
|
+
def update_github_actions_image(self, repo_path: str, image_name: str, new_tag: str):
|
|
1646
|
+
"""
|
|
1647
|
+
Updates the Docker image name + tag in .github/workflows/buildpipeline.yml
|
|
1648
|
+
|
|
1649
|
+
Args:
|
|
1650
|
+
repo_path (str): Path to repository root
|
|
1651
|
+
image_name (str): Docker image name (e.g. 'aniondev/scbuilder')
|
|
1652
|
+
new_tag (str): New tag (e.g. 'v1.2.3')
|
|
1653
|
+
"""
|
|
1654
|
+
|
|
1655
|
+
workflow_file = Path(repo_path) / ".github" / "workflows" / "buildpipeline.yml"
|
|
1656
|
+
if not workflow_file.exists():
|
|
1657
|
+
raise FileNotFoundError(f"Workflow file not found: {workflow_file}")
|
|
1658
|
+
content = workflow_file.read_text(encoding="utf-8")
|
|
1659
|
+
escaped_image = re.escape(image_name)
|
|
1660
|
+
pattern = rf"({escaped_image}:)([^\s\"']+)"
|
|
1661
|
+
new_content, count = re.subn(
|
|
1662
|
+
pattern,
|
|
1663
|
+
rf"\1{new_tag}",
|
|
1664
|
+
content
|
|
1665
|
+
)
|
|
1666
|
+
if count == 0:
|
|
1667
|
+
raise ValueError(f"No matching image '{image_name}' found in workflow file.")
|
|
1668
|
+
workflow_file.write_text(new_content, encoding="utf-8")
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scriptcollection
|
|
3
|
-
Version: 4.2.
|
|
3
|
+
Version: 4.2.122
|
|
4
4
|
Summary: The ScriptCollection is the place for reusable scripts.
|
|
5
5
|
Author-email: Marius Göcke <marius.goecke@gmail.com>
|
|
6
6
|
Project-URL: Homepage, https://github.com/anionDev/ScriptCollection
|
|
@@ -9,7 +9,7 @@ ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrR
|
|
|
9
9
|
ScriptCollection/ProgramRunnerPopen.py,sha256=8tP0xWKeRYoGlaNB3iUh4o61O-tKtcxrS7IUqtU85C4,4091
|
|
10
10
|
ScriptCollection/ProgramRunnerSudo.py,sha256=4lxbUFMIWMbthM5Q_QaFjvZfAsNpKlXeqfEbiofg_DI,5109
|
|
11
11
|
ScriptCollection/SCLog.py,sha256=8TRy1LeYMsPOIuWUcnUNNbO5pd-cNBS-3cn-kdzP8FU,4768
|
|
12
|
-
ScriptCollection/ScriptCollectionCore.py,sha256=
|
|
12
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=DAjGRovCeOBIYzPmaSNnjAOilXai0_qa-nvQejawnhk,205431
|
|
13
13
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
14
14
|
ScriptCollection/OCIImages/AbstractImageHandler.py,sha256=o129UYDtLymCRjMZBP9Puaj19ueMHoNt6UTLspfnaRc,1758
|
|
15
15
|
ScriptCollection/OCIImages/OCIImageManager.py,sha256=TaSGXaDH4KWxN8Iv30m9zyitcaDYhEZVEPdKO3C3zfs,10712
|
|
@@ -32,7 +32,7 @@ ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=Tpzgiz6m3-cYCkObZOG5Uu7oM-EMoWFzz
|
|
|
32
32
|
ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=Vwj7IWmvwIICXiv7I-c6MkxbqlRWCEwzaKW6dgEUjCM,7480
|
|
33
33
|
ScriptCollection/TFCPS/TFCPS_MergeToStable.py,sha256=xVPer8EGH5vhTT3_mpTMJJxWLB3aLxIcyTxKHODMbYg,22201
|
|
34
34
|
ScriptCollection/TFCPS/TFCPS_PreBuildCodeunitsScript.py,sha256=f0Uq1cA_4LvmL72cal0crrbKF6PcxL13D9wBKuQ1YBw,2328
|
|
35
|
-
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=
|
|
35
|
+
ScriptCollection/TFCPS/TFCPS_Tools_General.py,sha256=PtYjrIDUtOIM7k6G5V-4DYqVNGNLw44y0u-4owDZbAY,106842
|
|
36
36
|
ScriptCollection/TFCPS/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
37
37
|
ScriptCollection/TFCPS/Docker/TFCPS_CodeUnitSpecific_Docker.py,sha256=wS2yzYUmJ4m0cf6cBYVTHsiXSXfYhHoLFFy8x6yEQvY,19573
|
|
38
38
|
ScriptCollection/TFCPS/Docker/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
@@ -53,8 +53,8 @@ ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=ufb3f7gnB4
|
|
|
53
53
|
ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
54
54
|
ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=WhOsMpJxNGqnQGA3nJ99ruyqymxBeJxCcpK98zJduTo,1680
|
|
55
55
|
ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
56
|
-
scriptcollection-4.2.
|
|
57
|
-
scriptcollection-4.2.
|
|
58
|
-
scriptcollection-4.2.
|
|
59
|
-
scriptcollection-4.2.
|
|
60
|
-
scriptcollection-4.2.
|
|
56
|
+
scriptcollection-4.2.122.dist-info/METADATA,sha256=0Ea9B2vFPEoHo8C-X6V6LSWYugYsBppNxmmbx-iiJMs,7697
|
|
57
|
+
scriptcollection-4.2.122.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
58
|
+
scriptcollection-4.2.122.dist-info/entry_points.txt,sha256=ySZ09rptnBxyfpU-K62zmoUFH-0xWZUxzoPScoXubrg,5045
|
|
59
|
+
scriptcollection-4.2.122.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
60
|
+
scriptcollection-4.2.122.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|