ScriptCollection 3.4.50__py3-none-any.whl → 3.4.52__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.
@@ -288,10 +288,10 @@ def BuildCodeUnitsC() -> int:
288
288
  parser.add_argument('--verbosity', required=False, default=1)
289
289
  parser.add_argument('--targetenvironment', required=False, default="QualityCheck")
290
290
  parser.add_argument('--additionalargumentsfile', required=False, default=None)
291
- parser.add_argument('--image', required=False, default="scbuilder:3.5.0") # TODO set deafault to aniondev/scbuilder:latest
291
+ parser.add_argument('--image', required=False, default="scbuilder:latest")
292
292
  args = parser.parse_args()
293
293
  GeneralUtilities.reconfigure_standrd_input_and_outputs()
294
- TasksForCommonProjectStructure().build_codeunitsC(args.repositoryfolder, args.image, int(args.verbosity), args.targetenvironment, args.additionalargumentsfile)
294
+ TasksForCommonProjectStructure().build_codeunits_containerized(args.repositoryfolder, args.image, int(args.verbosity), args.targetenvironment, args.additionalargumentsfile)
295
295
  return 0
296
296
 
297
297
 
@@ -27,7 +27,7 @@ from .ProgramRunnerPopen import ProgramRunnerPopen
27
27
  from .ProgramRunnerEpew import ProgramRunnerEpew, CustomEpewArgument
28
28
 
29
29
 
30
- version = "3.4.50"
30
+ version = "3.4.52"
31
31
  __version__ = version
32
32
 
33
33
 
@@ -1678,3 +1678,26 @@ DNS = {domain}
1678
1678
 
1679
1679
  # cleanup
1680
1680
  GeneralUtilities.ensure_directory_does_not_exist(temp_folder)
1681
+
1682
+
1683
+ @GeneralUtilities.check_arguments
1684
+ def update_year_in_copyright_tags(self, file: str) -> None:
1685
+ current_year=str(datetime.now().year)
1686
+ lines=GeneralUtilities.read_lines_from_file(file)
1687
+ lines_result=[]
1688
+ for line in lines:
1689
+ if match := re.search("(.*<[Cc]opyright>.*)\\d\\d\\d\\d(.*<\\/[Cc]opyright>.*)", line):
1690
+ part1 = match.group(1)
1691
+ part2 = match.group(2)
1692
+ adapted=part1+current_year+part2
1693
+ else:
1694
+ adapted=line
1695
+ lines_result.append(adapted)
1696
+ GeneralUtilities.write_lines_to_file(file,lines_result)
1697
+
1698
+ @GeneralUtilities.check_arguments
1699
+ def update_year_in_first_line_of_file(self, file: str) -> None:
1700
+ current_year=str(datetime.now().year)
1701
+ lines=GeneralUtilities.read_lines_from_file(file)
1702
+ lines[0]=re.sub("\\d\\d\\d\\d",current_year,lines[0])
1703
+ GeneralUtilities.write_lines_to_file(file,lines)
@@ -1208,7 +1208,7 @@ class TasksForCommonProjectStructure:
1208
1208
 
1209
1209
  src_branch_commit_id = self.__sc.git_get_commit_id(repository_folder, source_branch)
1210
1210
  if (src_branch_commit_id == self.__sc.git_get_commit_id(repository_folder, target_branch)):
1211
- GeneralUtilities.write_message_to_stderr(
1211
+ raise ValueError(
1212
1212
  f"Can not merge because the source-branch and the target-branch are on the same commit (commit-id: {src_branch_commit_id})")
1213
1213
 
1214
1214
  self.__sc.git_checkout(repository_folder, source_branch)
@@ -1278,7 +1278,7 @@ class TasksForCommonProjectStructure:
1278
1278
 
1279
1279
  src_branch_commit_id = self.__sc.git_get_commit_id(information.repository, information.sourcebranch)
1280
1280
  if (src_branch_commit_id == self.__sc.git_get_commit_id(information.repository, information.targetbranch)):
1281
- GeneralUtilities.write_message_to_stderr(
1281
+ raise ValueError(
1282
1282
  f"Can not merge because the source-branch and the target-branch are on the same commit (commit-id: {src_branch_commit_id})")
1283
1283
 
1284
1284
  self.assert_no_uncommitted_changes(information.repository)
@@ -1978,9 +1978,9 @@ class TasksForCommonProjectStructure:
1978
1978
  is_pre_merge, export_target_directory, assume_dependent_codeunits_are_already_built)
1979
1979
 
1980
1980
  @GeneralUtilities.check_arguments
1981
- def build_codeunitsC(self, repository_folder: str, image:str, verbosity: int = 1, target_environmenttype: str = "QualityCheck", additional_arguments_file: str = None) -> None:
1981
+ def build_codeunits_containerized(self, repository_folder: str, image:str, verbosity: int = 1, target_environmenttype: str = "QualityCheck", additional_arguments_file: str = None) -> None:
1982
1982
  if target_environmenttype == "Development":
1983
- raise ValueError(f"build_codeunitsC is not available for target_environmenttype {target_environmenttype}.")
1983
+ raise ValueError(f"build_codeunits_containerized is not available for target_environmenttype {target_environmenttype}.")
1984
1984
  # TODO handle additional_arguments_file
1985
1985
  # TODO add option to allow building different codeunits in same project with different images due to their demands
1986
1986
  # TODO check if image provides all demands of codeunit
@@ -2238,6 +2238,34 @@ class TasksForCommonProjectStructure:
2238
2238
  installedsize, maintainername, maintaineremail, description)
2239
2239
  self.__sc.create_deb_package(codeunit_name, binary_folder, control_file_content, deb_output_folder, verbosity, 555)
2240
2240
 
2241
+
2242
+ @GeneralUtilities.check_arguments
2243
+ def update_year_in_license_file_in_common_scripts_file(self, common_tasks_scripts_file: str) -> None:
2244
+ self.update_year_in_license_file(GeneralUtilities.resolve_relative_path("../../..",common_tasks_scripts_file))
2245
+
2246
+
2247
+ @GeneralUtilities.check_arguments
2248
+ def update_year_in_license_file(self, repository_folder: str) -> None:
2249
+ self.__sc.update_year_in_first_line_of_file(os.path.join(repository_folder,"License.txt"))
2250
+
2251
+
2252
+ @GeneralUtilities.check_arguments
2253
+ def update_year_for_dotnet_codeunit_in_common_scripts_file(self, common_tasks_scripts_file: str) -> None:
2254
+ self.update_year_for_dotnet_codeunit(GeneralUtilities.resolve_relative_path("../..",common_tasks_scripts_file))
2255
+
2256
+
2257
+ @GeneralUtilities.check_arguments
2258
+ def update_year_for_dotnet_codeunit(self, codeunit_folder: str) -> None:
2259
+ codeunit_name=os.path.basename(codeunit_folder)
2260
+ csproj_file=os.path.join(codeunit_folder,codeunit_name,f"{codeunit_name}.csproj")
2261
+ self.__sc.update_year_in_copyright_tags(csproj_file)
2262
+ csprojtests_file=os.path.join(codeunit_folder,f"{codeunit_name}Tests",f"{codeunit_name}Tests.csproj")
2263
+ self.__sc.update_year_in_copyright_tags(csprojtests_file)
2264
+ nuspec_file=os.path.join(codeunit_folder,"Other","Build",f"{codeunit_name}.nuspec")
2265
+ if os.path.isfile(nuspec_file):
2266
+ self.__sc.update_year_in_copyright_tags(nuspec_file)
2267
+
2268
+
2241
2269
  @GeneralUtilities.check_arguments
2242
2270
  def repository_has_codeunits(self, repository: str, ignore_disabled_codeunits: bool = True) -> bool:
2243
2271
  return len(self.get_codeunits(repository, ignore_disabled_codeunits))
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: ScriptCollection
3
- Version: 3.4.50
3
+ Version: 3.4.52
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
@@ -1,14 +1,14 @@
1
- ScriptCollection/Executables.py,sha256=ggC2f6Q0H4gRZAC_S4jCUYlDyBW3k1NXzc--FG6Mpoo,19343
1
+ ScriptCollection/Executables.py,sha256=fQp9TdKe_LemEUi7O7q9da-2ve9qRzoePEBORccdSdw,19307
2
2
  ScriptCollection/GeneralUtilities.py,sha256=aCD7iDBVuqmtMDQxBG8bNb82S4RCCEkOct6EkS_IqfA,35261
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=veDNRg2Z0u0vd4iKWAycVFKbTm_uWYfuK6NTiwlbgrM,3230
6
- ScriptCollection/ScriptCollectionCore.py,sha256=3NW7CIk2nk8XhJO8AYJJVgY65LGiLBVdFGhApgKXRu8,93137
7
- ScriptCollection/TasksForCommonProjectStructure.py,sha256=P4f5Ob4wnRiKUYy2ob0izUNBjPvqDku1FI8p--BJOX4,165749
6
+ ScriptCollection/ScriptCollectionCore.py,sha256=YVMNa6dxuKDCUARmD6zYMJs2sjJ_d9G8oo1j8yWT1q8,94128
7
+ ScriptCollection/TasksForCommonProjectStructure.py,sha256=gzCCPicXeYFQVG_npyk_7pAeCJ1S5o7Ie2ok_nvjd1k,167202
8
8
  ScriptCollection/UpdateCertificates.py,sha256=Go-JJK-YTi7aBB1phlLxypa8GHkmFHBEPB0_TT9G-bw,7918
9
9
  ScriptCollection/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
- ScriptCollection-3.4.50.dist-info/METADATA,sha256=jimGirDFvCWRNcmoYkyzmI3yhJiXtv1IvZXV6jsIw3Q,7650
11
- ScriptCollection-3.4.50.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
12
- ScriptCollection-3.4.50.dist-info/entry_points.txt,sha256=dwvB9HRGvqst5xlYIGmmwuFN7lBKhxvndmnNrQOfu8w,2153
13
- ScriptCollection-3.4.50.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
14
- ScriptCollection-3.4.50.dist-info/RECORD,,
10
+ ScriptCollection-3.4.52.dist-info/METADATA,sha256=CVWdEDDBMuW4qqiUwfPZUdR8dwGsumk5m3X42XGc2uk,7650
11
+ ScriptCollection-3.4.52.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
12
+ ScriptCollection-3.4.52.dist-info/entry_points.txt,sha256=dwvB9HRGvqst5xlYIGmmwuFN7lBKhxvndmnNrQOfu8w,2153
13
+ ScriptCollection-3.4.52.dist-info/top_level.txt,sha256=hY2hOVH0V0Ce51WB76zKkIWTUNwMUdHo4XDkR2vYVwg,17
14
+ ScriptCollection-3.4.52.dist-info/RECORD,,