ScriptCollection 4.3.8__py3-none-any.whl → 4.3.10__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 +5 -3
- ScriptCollection/ScriptCollectionCore.py +23 -1
- ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py +11 -2
- {scriptcollection-4.3.8.dist-info → scriptcollection-4.3.10.dist-info}/METADATA +1 -1
- {scriptcollection-4.3.8.dist-info → scriptcollection-4.3.10.dist-info}/RECORD +8 -8
- {scriptcollection-4.3.8.dist-info → scriptcollection-4.3.10.dist-info}/WHEEL +0 -0
- {scriptcollection-4.3.8.dist-info → scriptcollection-4.3.10.dist-info}/entry_points.txt +0 -0
- {scriptcollection-4.3.8.dist-info → scriptcollection-4.3.10.dist-info}/top_level.txt +0 -0
ScriptCollection/Executables.py
CHANGED
|
@@ -263,14 +263,15 @@ def BuildCodeUnits() -> int:
|
|
|
263
263
|
parser.add_argument("-c",'--nocache', required=False, default=False, action='store_true')
|
|
264
264
|
parser.add_argument('-p','--ispremerge', required=False, default=False, action='store_true')
|
|
265
265
|
parser.add_argument('-u','--assertnonewchanges', required=False, default=False, action='store_true')
|
|
266
|
+
parser.add_argument('-m','--addreadytomergeflag', required=False, default=False, action='store_true')
|
|
266
267
|
|
|
267
268
|
args = parser.parse_args()
|
|
268
|
-
|
|
269
|
+
|
|
269
270
|
verbosity=LogLevel(int(args.verbosity))
|
|
270
271
|
|
|
271
272
|
repo:str=GeneralUtilities.resolve_relative_path(args.repositoryfolder,os.getcwd())
|
|
272
273
|
|
|
273
|
-
t:TFCPS_CodeUnit_BuildCodeUnits=TFCPS_CodeUnit_BuildCodeUnits(repo,verbosity,args.targetenvironment,args.additionalargumentsfile,not args.nocache,args.ispremerge,args.assertnonewchanges)
|
|
274
|
+
t:TFCPS_CodeUnit_BuildCodeUnits=TFCPS_CodeUnit_BuildCodeUnits(repo,verbosity,args.targetenvironment,args.additionalargumentsfile,not args.nocache,args.ispremerge,args.assertnonewchanges,args.addreadytomergeflag)
|
|
274
275
|
t.build_codeunits()
|
|
275
276
|
return 0
|
|
276
277
|
|
|
@@ -286,11 +287,12 @@ def BuildCodeUnitsC() -> int:
|
|
|
286
287
|
parser.add_argument('-p','--ispremerge', required=False, default=False, action='store_true')
|
|
287
288
|
parser.add_argument('--image', required=False, default="scbuilder:latest")
|
|
288
289
|
parser.add_argument('-u','--assertnonewchanges', required=False, default=False, action='store_true')
|
|
290
|
+
parser.add_argument('-m','--addreadytomergeflag', required=False, default=False, action='store_true')
|
|
289
291
|
args = parser.parse_args()
|
|
290
292
|
GeneralUtilities.reconfigure_standard_input_and_outputs()
|
|
291
293
|
repo:str=GeneralUtilities.resolve_relative_path(args.repositoryfolder,os.getcwd())
|
|
292
294
|
verbosity=LogLevel(int(args.verbosity))
|
|
293
|
-
t:TFCPS_CodeUnit_BuildCodeUnits=TFCPS_CodeUnit_BuildCodeUnits(repo,verbosity,args.targetenvironment,args.additionalargumentsfile,not args.nocache,args.ispremerge,args.assertnonewchanges)
|
|
295
|
+
t:TFCPS_CodeUnit_BuildCodeUnits=TFCPS_CodeUnit_BuildCodeUnits(repo,verbosity,args.targetenvironment,args.additionalargumentsfile,not args.nocache,args.ispremerge,args.assertnonewchanges,args.addreadytomergeflag)
|
|
294
296
|
success, _ = t.build_codeunits_in_container()
|
|
295
297
|
return 0 if success else 1
|
|
296
298
|
|
|
@@ -37,7 +37,7 @@ from .ProgramRunnerBase import ProgramRunnerBase
|
|
|
37
37
|
from .ProgramRunnerPopen import ProgramRunnerPopen
|
|
38
38
|
from .SCLog import SCLog, LogLevel
|
|
39
39
|
|
|
40
|
-
version = "4.3.
|
|
40
|
+
version = "4.3.10"
|
|
41
41
|
__version__ = version
|
|
42
42
|
|
|
43
43
|
class VSCodeWorkspaceShellTask:
|
|
@@ -551,9 +551,31 @@ class ScriptCollectionCore:
|
|
|
551
551
|
def git_push_with_retry(self, folder: str, remotename: str, localbranchname: str, remotebranchname: str, forcepush: bool = False, pushalltags: bool = True, verbosity: LogLevel = LogLevel.Quiet, amount_of_attempts: int = 5) -> None:
|
|
552
552
|
GeneralUtilities.retry_action(lambda: self.git_push(folder, remotename, localbranchname, remotebranchname, forcepush, pushalltags, verbosity), amount_of_attempts)
|
|
553
553
|
|
|
554
|
+
@GeneralUtilities.check_arguments
|
|
555
|
+
def git_branch_is_pushable(self, folder: str, remote: str, localbranchname: str, remotebranchname: str) -> bool:
|
|
556
|
+
"""Fetches remote and returns whether pushing localbranchname to remotebranchname would advance (fast-forward) the remote-branch.
|
|
557
|
+
Returns True if the remote-branch does not exist yet or is strictly behind the local-branch.
|
|
558
|
+
Returns False if the remote-branch already contains the current commit (is equal to the local-branch), is ahead of it or
|
|
559
|
+
diverged from it, in which case a push would do nothing useful and a normal push would even fail with a non-fast-forward-error."""
|
|
560
|
+
self.is_git_or_bare_git_repository(folder)
|
|
561
|
+
self.git_fetch(folder, remote)
|
|
562
|
+
remote_ref = f"{remote}/{remotebranchname}"
|
|
563
|
+
if not self.branch_exists(folder, remote_ref):
|
|
564
|
+
return True
|
|
565
|
+
remote_is_ancestor_of_local = self.git_commit_is_ancestor(folder, remote_ref, localbranchname)
|
|
566
|
+
local_is_ancestor_of_remote = self.git_commit_is_ancestor(folder, localbranchname, remote_ref)
|
|
567
|
+
return remote_is_ancestor_of_local and not local_is_ancestor_of_remote
|
|
568
|
+
|
|
554
569
|
@GeneralUtilities.check_arguments
|
|
555
570
|
def git_push(self, folder: str, remotename: str, localbranchname: str, remotebranchname: str, forcepush: bool = False, pushalltags: bool = True, verbosity: LogLevel = LogLevel.Quiet,resurse_submodules:bool=False) -> None:
|
|
556
571
|
self.is_git_or_bare_git_repository(folder)
|
|
572
|
+
if not forcepush and not self.is_bare_git_repository(folder):
|
|
573
|
+
# If the remote-branch already contains the current commit or is ahead of the local-branch there is nothing to push and a
|
|
574
|
+
# normal push would fail with a non-fast-forward-error. In that case do nothing. (Skipped for bare-repositories because
|
|
575
|
+
# git_fetch does not support them.)
|
|
576
|
+
if not self.git_branch_is_pushable(folder, remotename, localbranchname, remotebranchname):
|
|
577
|
+
self.log.log(f"Skip pushing '{localbranchname}' to '{remotebranchname}' on '{remotename}' in '{folder}' because the remote-branch is not behind the local-branch.", LogLevel.Debug)
|
|
578
|
+
return
|
|
557
579
|
argument = ["push"]
|
|
558
580
|
if resurse_submodules:
|
|
559
581
|
argument = argument + ["--recurse-submodules=on-demand"]
|
|
@@ -20,8 +20,9 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
20
20
|
__use_cache:bool = None
|
|
21
21
|
__is_pre_merge:bool = None
|
|
22
22
|
__assert_no_new_changes:bool = None
|
|
23
|
+
__add_ready_to_merge_flag:bool = None
|
|
23
24
|
|
|
24
|
-
def __init__(self,repository:str,loglevel:LogLevel,target_environment_type:str,additionalargumentsfile:str,use_cache:bool,is_pre_merge:bool,assertnonewchanges:bool):
|
|
25
|
+
def __init__(self,repository:str,loglevel:LogLevel,target_environment_type:str,additionalargumentsfile:str,use_cache:bool,is_pre_merge:bool,assertnonewchanges:bool,add_ready_to_merge_flag:bool=False):
|
|
25
26
|
self.sc=ScriptCollectionCore()
|
|
26
27
|
self.sc.log.loglevel=loglevel
|
|
27
28
|
self.__use_cache=use_cache
|
|
@@ -34,6 +35,7 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
34
35
|
self.additionalargumentsfile=additionalargumentsfile
|
|
35
36
|
self.__is_pre_merge=is_pre_merge
|
|
36
37
|
self.__assert_no_new_changes=assertnonewchanges
|
|
38
|
+
self.__add_ready_to_merge_flag=add_ready_to_merge_flag
|
|
37
39
|
|
|
38
40
|
@GeneralUtilities.check_arguments
|
|
39
41
|
def build_codeunits(self) -> None:
|
|
@@ -96,7 +98,8 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
96
98
|
GeneralUtilities.ensure_file_does_not_exist(ready_to_merge_file)
|
|
97
99
|
else:
|
|
98
100
|
if self.is_working_branch():
|
|
99
|
-
|
|
101
|
+
if self.add_ready_to_merge_flag():
|
|
102
|
+
GeneralUtilities.ensure_file_exists(ready_to_merge_file)
|
|
100
103
|
|
|
101
104
|
if self.__assert_no_new_changes:
|
|
102
105
|
self.sc.assert_no_uncommitted_changes(self.repository,"There are new uncommitted changes in the repository.")
|
|
@@ -153,6 +156,8 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
153
156
|
scbuildcodeunits_arguments.append("-p")
|
|
154
157
|
if self.__assert_no_new_changes:
|
|
155
158
|
scbuildcodeunits_arguments.append("-u")
|
|
159
|
+
if self.__add_ready_to_merge_flag:
|
|
160
|
+
scbuildcodeunits_arguments.append("-m")
|
|
156
161
|
if GeneralUtilities.string_has_content(self.additionalargumentsfile):
|
|
157
162
|
scbuildcodeunits_arguments += ["-a", self.__translate_path_into_container(self.additionalargumentsfile, container_repository_folder)]
|
|
158
163
|
|
|
@@ -387,6 +392,10 @@ class TFCPS_CodeUnit_BuildCodeUnits:
|
|
|
387
392
|
def is_pre_merge(self) -> bool:
|
|
388
393
|
return self.__is_pre_merge
|
|
389
394
|
|
|
395
|
+
@GeneralUtilities.check_arguments
|
|
396
|
+
def add_ready_to_merge_flag(self) -> bool:
|
|
397
|
+
return self.__add_ready_to_merge_flag
|
|
398
|
+
|
|
390
399
|
@GeneralUtilities.check_arguments
|
|
391
400
|
def update_dependencies(self) -> None:
|
|
392
401
|
repository=self.repository
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: scriptcollection
|
|
3
|
-
Version: 4.3.
|
|
3
|
+
Version: 4.3.10
|
|
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
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
ScriptCollection/AnionBuildPlatform.py,sha256=T1tkh4pzQyUb8r5acWiv95TvmkNnDhiNaQAP2dJJvoA,12057
|
|
2
2
|
ScriptCollection/CertificateUpdater.py,sha256=dR5JpJDlZdjD4_pgMz7zCrt1IM7VfatmK6pULSczxQw,9693
|
|
3
|
-
ScriptCollection/Executables.py,sha256=
|
|
3
|
+
ScriptCollection/Executables.py,sha256=DHutD8oaI2g71LV-rZ75gg1h4JywoRCKQDLobWPYS5A,66665
|
|
4
4
|
ScriptCollection/GeneralUtilities.py,sha256=Qox4wQ2oWTahwXexC4qSUzXua5qr9PzRRrmOcJoM_IA,70500
|
|
5
5
|
ScriptCollection/HTTPMaintenanceOverheadHelper.py,sha256=TToNtyO1XzsMbBsTBf3o0xgOK0v4Jf03qw2Z0xb2nCk,2007
|
|
6
6
|
ScriptCollection/ProcessesRunner.py,sha256=yYaC95h40uszuZPggn2kK3qXIN2ZjGMCavo-NQ53ElQ,1537
|
|
@@ -9,7 +9,7 @@ ScriptCollection/ProgramRunnerMock.py,sha256=uTu-aFle1W_oKjeQEmuPsFPQpvo0kRf2FrR
|
|
|
9
9
|
ScriptCollection/ProgramRunnerPopen.py,sha256=zVD-gZY85o8wiGFcpYAGNDl-tXaKzipl1Bkhqy2ois4,4681
|
|
10
10
|
ScriptCollection/ProgramRunnerSudo.py,sha256=RXsiceQ8W6a8YDk_2BPscVbIAmDIpIxqe9WHBy2r4CM,5233
|
|
11
11
|
ScriptCollection/SCLog.py,sha256=Z-HhC_CRtU3HdQflNsabFh9IJOucHcXmxMDcf58fli0,4671
|
|
12
|
-
ScriptCollection/ScriptCollectionCore.py,sha256
|
|
12
|
+
ScriptCollection/ScriptCollectionCore.py,sha256=ycaLc7SU53jKAsVS46cFqrH_Sp-pH3QOyR7Va9DWoMI,230263
|
|
13
13
|
ScriptCollection/UnassignedVariablesCheck.py,sha256=v59qLQ5RRvx31ouuCW7NWZj3McWENvGBPkV5ZGBmqJE,4344
|
|
14
14
|
ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
15
15
|
ScriptCollection/OCIImages/AbstractImageHandler.py,sha256=o129UYDtLymCRjMZBP9Puaj19ueMHoNt6UTLspfnaRc,1758
|
|
@@ -35,7 +35,7 @@ ScriptCollection/Resources/MaintenanceSite/MaintenanceSite.html,sha256=CX9S1bdOz
|
|
|
35
35
|
ScriptCollection/TFCPS/SCTaskRunnerServer.py,sha256=rpuwSsQ6YQfZS2LGnvOH5ql8zs_-cHU4LQttS7XNT60,11272
|
|
36
36
|
ScriptCollection/TFCPS/TFCPS_CodeUnitSpecific_Base.py,sha256=oICRtl85n2puWvchcJIkmLZL1BAylMbzH7ltBGWfqgY,31973
|
|
37
37
|
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnit.py,sha256=s4E20EkvFZpsg2c2Gu-D6kHXS0QIkpx_chawHNSnlnU,9891
|
|
38
|
-
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=
|
|
38
|
+
ScriptCollection/TFCPS/TFCPS_CodeUnit_BuildCodeUnits.py,sha256=n_ZBkh5XybkIrz4t2LhJKY7t7eJYrqpnuNBZt8uUiy0,25512
|
|
39
39
|
ScriptCollection/TFCPS/TFCPS_CreateRelease.py,sha256=X2NgZgbOkJsdZ6wMHB_RuS_rQCuz5oQCqzYrxyXBN9Q,6680
|
|
40
40
|
ScriptCollection/TFCPS/TFCPS_Generic.py,sha256=5vCFfDiU8bvfcnoKNs2ATS8nsl6mYXcIuX7XfYE0tvg,2116
|
|
41
41
|
ScriptCollection/TFCPS/TFCPS_MergeToMain.py,sha256=BsSV4a-NZY86MZ20d-_rYxNVAI4UzAfmEwXlRZ8qWQc,7685
|
|
@@ -63,8 +63,8 @@ ScriptCollection/TFCPS/Python/TFCPS_CodeUnitSpecific_Python.py,sha256=Bd1gxCk9Fb
|
|
|
63
63
|
ScriptCollection/TFCPS/Python/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
64
64
|
ScriptCollection/TFCPS/Rust/TFCPS_CodeUnitSpecific_Rust.py,sha256=WhOsMpJxNGqnQGA3nJ99ruyqymxBeJxCcpK98zJduTo,1680
|
|
65
65
|
ScriptCollection/TFCPS/Rust/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
66
|
-
scriptcollection-4.3.
|
|
67
|
-
scriptcollection-4.3.
|
|
68
|
-
scriptcollection-4.3.
|
|
69
|
-
scriptcollection-4.3.
|
|
70
|
-
scriptcollection-4.3.
|
|
66
|
+
scriptcollection-4.3.10.dist-info/METADATA,sha256=fkKN4GjqMtFxTZKuNi9lTY9BJ261wqJJ4n6TXUXXfn8,7816
|
|
67
|
+
scriptcollection-4.3.10.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
|
|
68
|
+
scriptcollection-4.3.10.dist-info/entry_points.txt,sha256=MwiP9P29EeSfjS19JOZmqbx8OzpZrUWpgMza3EffBs8,5812
|
|
69
|
+
scriptcollection-4.3.10.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
|
|
70
|
+
scriptcollection-4.3.10.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|