ScriptCollection 3.5.0__py3-none-any.whl → 3.5.1__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.
@@ -29,7 +29,7 @@ from .ProgramRunnerPopen import ProgramRunnerPopen
29
29
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
30
30
 
31
31
 
32
- version = "3.5.0"
32
+ version = "3.5.1"
33
33
  __version__ = version
34
34
 
35
35
 
@@ -73,15 +73,15 @@ class ScriptCollectionCore:
73
73
 
74
74
  @GeneralUtilities.check_arguments
75
75
  def replace_version_in_dockerfile_file(self, dockerfile: str, new_version_value: str) -> None:
76
- GeneralUtilities.write_text_to_file(dockerfile, re.sub("ARG Version=\"\\d+\\.\\d+\\.\\d+\"", f"ARG Version=\"{new_version_value}\"", GeneralUtilities.read_text_from_file(dockerfile)))
76
+ GeneralUtilities.write_text_to_file(dockerfile, re.sub("ARG Version=\"\\d+\\.\\d+\\.\\d+\"", f"ARG Version=\"{new_version_value}\"", GeneralUtilities.read_text_from_file(dockerfile)))
77
77
 
78
78
  @GeneralUtilities.check_arguments
79
79
  def replace_version_in_python_file(self, file: str, new_version_value: str):
80
- GeneralUtilities.write_text_to_file(file, re.sub("version = \"\\d+\\.\\d+\\.\\d+\"", f"version = \"{new_version_value}\"", GeneralUtilities.read_text_from_file(file)))
80
+ GeneralUtilities.write_text_to_file(file, re.sub("version = \"\\d+\\.\\d+\\.\\d+\"", f"version = \"{new_version_value}\"", GeneralUtilities.read_text_from_file(file)))
81
81
 
82
82
  @GeneralUtilities.check_arguments
83
83
  def replace_version_in_ini_file(self, file: str, new_version_value: str):
84
- GeneralUtilities.write_text_to_file(file, re.sub("version = \\d+\\.\\d+\\.\\d+", f"version = {new_version_value}", GeneralUtilities.read_text_from_file(file)))
84
+ GeneralUtilities.write_text_to_file(file, re.sub("version = \\d+\\.\\d+\\.\\d+", f"version = {new_version_value}", GeneralUtilities.read_text_from_file(file)))
85
85
 
86
86
  @GeneralUtilities.check_arguments
87
87
  def replace_version_in_nuspec_file(self, nuspec_file: str, new_version: str) -> None:
@@ -90,7 +90,7 @@ class ScriptCollectionCore:
90
90
  versiononlyregex = f"^{versionregex}$"
91
91
  pattern = re.compile(versiononlyregex)
92
92
  if pattern.match(new_version):
93
- GeneralUtilities.write_text_to_file(nuspec_file, re.sub(f"<version>{versionregex}<\\/version>", f"<version>{new_version}</version>", GeneralUtilities.read_text_from_file(nuspec_file)))
93
+ GeneralUtilities.write_text_to_file(nuspec_file, re.sub(f"<version>{versionregex}<\\/version>", f"<version>{new_version}</version>", GeneralUtilities.read_text_from_file(nuspec_file)))
94
94
  else:
95
95
  raise ValueError(f"Version '{new_version}' does not match version-regex '{versiononlyregex}'")
96
96
 
@@ -101,7 +101,7 @@ class ScriptCollectionCore:
101
101
  pattern = re.compile(versiononlyregex)
102
102
  if pattern.match(current_version):
103
103
  for tag in ["Version", "AssemblyVersion", "FileVersion"]:
104
- GeneralUtilities.write_text_to_file(csproj_file, re.sub(f"<{tag}>{versionregex}(.\\d+)?<\\/{tag}>", f"<{tag}>{current_version}</{tag}>", GeneralUtilities.read_text_from_file(csproj_file)))
104
+ GeneralUtilities.write_text_to_file(csproj_file, re.sub(f"<{tag}>{versionregex}(.\\d+)?<\\/{tag}>", f"<{tag}>{current_version}</{tag}>", GeneralUtilities.read_text_from_file(csproj_file)))
105
105
  else:
106
106
  raise ValueError(f"Version '{current_version}' does not match version-regex '{versiononlyregex}'")
107
107
 
@@ -109,7 +109,7 @@ class ScriptCollectionCore:
109
109
  def push_nuget_build_artifact(self, nupkg_file: str, registry_address: str, api_key: str, verbosity: int = 1):
110
110
  nupkg_file_name = os.path.basename(nupkg_file)
111
111
  nupkg_file_folder = os.path.dirname(nupkg_file)
112
- self.run_program("dotnet", f"nuget push {nupkg_file_name} --force-english-output --source {registry_address} --api-key {api_key}", nupkg_file_folder, verbosity)
112
+ self.run_program("dotnet", f"nuget push {nupkg_file_name} --force-english-output --source {registry_address} --api-key {api_key}", nupkg_file_folder, verbosity)
113
113
 
114
114
  @GeneralUtilities.check_arguments
115
115
  def dotnet_build(self, repository_folder: str, projectname: str, configuration: str):
@@ -142,7 +142,7 @@ class ScriptCollectionCore:
142
142
 
143
143
  @GeneralUtilities.check_arguments
144
144
  def get_parent_commit_ids_of_commit(self, repository_folder: str, commit_id: str) -> str:
145
- return self.run_program("git", f'log --pretty=%P -n 1 "{commit_id}"', repository_folder, throw_exception_if_exitcode_is_not_zero=True)[1].replace("\r", "").replace("\n", "").split(" ")
145
+ return self.run_program("git", f'log --pretty=%P -n 1 "{commit_id}"', repository_folder, throw_exception_if_exitcode_is_not_zero=True)[1].replace("\r", "").replace("\n", "").split(" ")
146
146
 
147
147
  @GeneralUtilities.check_arguments
148
148
  def get_all_authors_and_committers_of_repository(self, repository_folder: str, subfolder: str = None, verbosity: int = 1) -> list[tuple[str, str]]:
@@ -151,7 +151,7 @@ class ScriptCollectionCore:
151
151
  subfolder_argument = ""
152
152
  else:
153
153
  subfolder_argument = f" -- {subfolder}"
154
- log_result = self.run_program("git", f'log --pretty=%aN{space_character}%aE%n%cN{space_character}%cE HEAD{subfolder_argument}', repository_folder, verbosity=0)
154
+ log_result = self.run_program("git", f'log --pretty=%aN{space_character}%aE%n%cN{space_character}%cE HEAD{subfolder_argument}', repository_folder, verbosity=0)
155
155
  plain_content: list[str] = list(set([line for line in log_result[1].split("\n") if len(line) > 0]))
156
156
  result: list[tuple[str, str]] = []
157
157
  for item in plain_content:
@@ -166,7 +166,7 @@ class ScriptCollectionCore:
166
166
  def get_commit_ids_between_dates(self, repository_folder: str, since: datetime, until: datetime, ignore_commits_which_are_not_in_history_of_head: bool = True) -> None:
167
167
  since_as_string = self.__datetime_to_string_for_git(since)
168
168
  until_as_string = self.__datetime_to_string_for_git(until)
169
- result = filter(lambda line: not GeneralUtilities.string_is_none_or_whitespace(line), self.run_program("git", f'log --since "{since_as_string}" --until "{until_as_string}" --pretty=format:"%H" --no-patch', repository_folder, throw_exception_if_exitcode_is_not_zero=True)[1].split("\n").replace("\r", ""))
169
+ result = filter(lambda line: not GeneralUtilities.string_is_none_or_whitespace(line), self.run_program("git", f'log --since "{since_as_string}" --until "{until_as_string}" --pretty=format:"%H" --no-patch', repository_folder, throw_exception_if_exitcode_is_not_zero=True)[1].split("\n").replace("\r", ""))
170
170
  if ignore_commits_which_are_not_in_history_of_head:
171
171
  result = [commit_id for commit_id in result if self.git_commit_is_ancestor(repository_folder, commit_id)]
172
172
  return result
@@ -187,7 +187,7 @@ class ScriptCollectionCore:
187
187
 
188
188
  @GeneralUtilities.check_arguments
189
189
  def __git_changes_helper(self, repository_folder: str, arguments_as_array: list[str]) -> bool:
190
- lines = GeneralUtilities.string_to_lines(self.run_program_argsasarray("git", arguments_as_array, repository_folder, throw_exception_if_exitcode_is_not_zero=True, verbosity=0)[1], False)
190
+ lines = GeneralUtilities.string_to_lines(self.run_program_argsasarray("git", arguments_as_array, repository_folder, throw_exception_if_exitcode_is_not_zero=True, verbosity=0)[1], False)
191
191
  for line in lines:
192
192
  if GeneralUtilities.string_has_content(line):
193
193
  return True
@@ -451,7 +451,7 @@ class ScriptCollectionCore:
451
451
  return tags
452
452
 
453
453
  @GeneralUtilities.check_arguments
454
- def git_move_tags_to_another_branch(self, repository: str, tag_source_branch: str, tag_target_branch: str, sign: bool = False, message: str = None) -> None:
454
+ def git_move_tags_to_another_branch(self, repository: str, tag_source_branch: str, tag_target_branch: str, sign: bool = False, message: str = None) -> None:
455
455
  tags = self.git_get_tags(repository)
456
456
  tags_count = len(tags)
457
457
  counter = 0
@@ -712,7 +712,7 @@ class ScriptCollectionCore:
712
712
  self.git_remove_branch(repository, sourcebranch)
713
713
 
714
714
  @GeneralUtilities.check_arguments
715
- def sc_organize_lines_in_file(self, file: str, encoding: str, sort: bool = False, remove_duplicated_lines: bool = False, ignore_first_line: bool = False, remove_empty_lines: bool = True, ignored_start_character: list = list()) -> int:
715
+ def sc_organize_lines_in_file(self, file: str, encoding: str, sort: bool = False, remove_duplicated_lines: bool = False, ignore_first_line: bool = False, remove_empty_lines: bool = True, ignored_start_character: list = list()) -> int:
716
716
  if os.path.isfile(file):
717
717
 
718
718
  # read file
@@ -1303,7 +1303,7 @@ class ScriptCollectionCore:
1303
1303
  f"stderr: {GeneralUtilities.str_none_safe(str(r.stderr))})"
1304
1304
 
1305
1305
  @GeneralUtilities.check_arguments
1306
- def register_mock_program_call(self, program: str, argument: str, workingdirectory: str, result_exit_code: int, result_stdout: str, result_stderr: str, result_pid: int, amount_of_expected_calls=1):
1306
+ def register_mock_program_call(self, program: str, argument: str, workingdirectory: str, result_exit_code: int, result_stdout: str, result_stderr: str, result_pid: int, amount_of_expected_calls=1):
1307
1307
  "This function is for test-purposes only"
1308
1308
  for _ in itertools.repeat(None, amount_of_expected_calls):
1309
1309
  mock_call = ScriptCollectionCore.__MockProgramCall()
@@ -1435,7 +1435,7 @@ class ScriptCollectionCore:
1435
1435
  self.run_program("openssl", f'req -new -newkey ec -pkeyopt ec_paramgen_curve:prime256v1 -days {days_until_expire} -nodes -x509 -subj /C={subj_c}/ST={subj_st}/L={subj_l}/O={subj_o}/CN={name}/OU={subj_ou} -passout pass:{password} -keyout {name}.key -out {name}.crt', folder)
1436
1436
 
1437
1437
  @GeneralUtilities.check_arguments
1438
- 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, days_until_expire: int = None, password: str = None) -> None:
1438
+ 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, days_until_expire: int = None, password: str = None) -> None:
1439
1439
  if days_until_expire is None:
1440
1440
  days_until_expire = 397
1441
1441
  if password is None:
@@ -2375,7 +2375,8 @@ class TasksForCommonProjectStructure:
2375
2375
  # prepare
2376
2376
  self.assert_no_uncommitted_changes(repository_folder)
2377
2377
  self.__sc.git_checkout(repository_folder, merge_source_branch)
2378
- self.generic_update_dependencies(repository_folder)
2378
+ if not "--prevent-dependency-update" in generic_prepare_new_release_arguments.commandline_arguments:
2379
+ self.generic_update_dependencies(repository_folder)
2379
2380
  self.merge_to_main_branch(repository_folder, merge_source_branch, verbosity=verbosity, fast_forward_source_branch=True)
2380
2381
  self.__sc.git_commit(build_repository_folder, "Updated submodule due to merge to main-branch.")
2381
2382
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ScriptCollection
3
- Version: 3.5.0
3
+ Version: 3.5.1
4
4
  Summary: The ScriptCollection is the place for reusable scripts.
5
5
  Home-page: https://github.com/anionDev/ScriptCollection
6
6
  Author: Marius Göcke
@@ -3,12 +3,12 @@ ScriptCollection/GeneralUtilities.py,sha256=Mcp6ghb6AbS1KsOjEnRw3x4a4mBrAZ6DAjV2
3
3
  ScriptCollection/ProgramRunnerBase.py,sha256=2kyOuoM3oFjBfLc9Q5t5RTz7Ya2CjUxFtB1rBBDmnjU,1937
4
4
  ScriptCollection/ProgramRunnerEpew.py,sha256=nIzY4dG6W-xEpkeoTbozwNZtFSIo-bU_W6t6u1AZKtE,6275
5
5
  ScriptCollection/ProgramRunnerPopen.py,sha256=kV7KVuDenKjOyNBFurMTcuhuLuLZ74MaaSrwaPjaHCs,3158
6
- ScriptCollection/ScriptCollectionCore.py,sha256=LXHRp3sWZmIdWRhOXFbQxGE4aPel194AhMXgD8LCKOs,92657
7
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=4ZxLkYtT7nszV46AT0E7_TuAziFokFnG1UcZ9VFYfzk,173711
6
+ ScriptCollection/ScriptCollectionCore.py,sha256=HOrGzg_XZVDLBILfY7LPS-a3G3k9uIamI3oiSLYzlP4,92041
7
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=8GA4Ko7xmELPTMTH_is86twJZ-UyWoDCiH5Z3boJ0FI,173825
8
8
  ScriptCollection/UpdateCertificates.py,sha256=3C_E9og5SZec35aD3BFYLchzJtonsg1KR4enFCb5Jzk,7914
9
9
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- ScriptCollection-3.5.0.dist-info/METADATA,sha256=RVO_ZaAz9cLgXhOTyAZUMvA7eqk9pMGPvmAUEcDEqeQ,7648
11
- ScriptCollection-3.5.0.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
12
- ScriptCollection-3.5.0.dist-info/entry_points.txt,sha256=dwvB9HRGvqst5xlYIGmmwuFN7lBKhxvndmnNrQOfu8w,2153
13
- ScriptCollection-3.5.0.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
14
- ScriptCollection-3.5.0.dist-info/RECORD,,
10
+ ScriptCollection-3.5.1.dist-info/METADATA,sha256=rAK2osGWF6py3N0o3YHP8A-HSJRxXDXa94Cux2Ishjo,7648
11
+ ScriptCollection-3.5.1.dist-info/WHEEL,sha256=GJ7t_kWBFywbagK5eo9IoUwLW6oyOeTKmQ-9iHFVNxQ,92
12
+ ScriptCollection-3.5.1.dist-info/entry_points.txt,sha256=dwvB9HRGvqst5xlYIGmmwuFN7lBKhxvndmnNrQOfu8w,2153
13
+ ScriptCollection-3.5.1.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
14
+ ScriptCollection-3.5.1.dist-info/RECORD,,