ALBS-987: Generate i686 and dev repositories with pungi on building new distr. version automatically #15

Merged
soksanichenko merged 8 commits from ALBS-987 into al_master 2023-03-31 09:03:40 +00:00
  • [Generator of packages.json] Replace using CLI by config.yaml
  • [Gather RPMs] os.path is replaced by Path
- [Generator of packages.json] Replace using CLI by config.yaml - [Gather RPMs] os.path is replaced by Path
soksanichenko added 1 commit 2023-03-22 13:58:27 +00:00
- [Generator of packages.json] Replace using CLI by config.yaml
- [Gather RPMs] os.path is replaced by Path
soksanichenko added 1 commit 2023-03-23 07:36:59 +00:00
soksanichenko added 1 commit 2023-03-24 10:45:36 +00:00
- Path.rglob/glob doesn't work with symlinks (it's the bug and reported)
- Refactoring
soksanichenko added 1 commit 2023-03-24 14:39:18 +00:00
soksanichenko added 1 commit 2023-03-28 09:58:16 +00:00
Korulag approved these changes 2023-03-28 10:42:11 +00:00
anfimovdm requested changes 2023-03-28 12:12:54 +00:00
@ -157,1 +155,3 @@
(package_info["name"], package_info["version"], package_info["release"])
if package_info['epoch'] is not None:
epoch_suffix = ':' + package_info['epoch']
else:
Member

unnecessary else statement, you can declare epoch_suffix before if statement

unnecessary `else` statement, you can declare `epoch_suffix` before `if` statement
soksanichenko marked this conversation as resolved
@ -101,0 +135,4 @@
repo_info.path + '/',
repo_info.folder,
)
else:
Member

same

same
soksanichenko marked this conversation as resolved
@ -172,2 +214,4 @@
'repodata/repomd.xml'
)
repomd_file_path = self.get_remote_file_content(repomd_file_path)
else:
Member

same

same
soksanichenko marked this conversation as resolved
@ -270,0 +303,4 @@
full_repo_path = self._get_full_repo_path(repo_info)
if full_repo_path in self.pkgs:
return self.pkgs[full_repo_path]
else:
Member

same

same
soksanichenko marked this conversation as resolved
@ -313,0 +329,4 @@
) -> str:
if package.arch in self.repo_arches[variant_arch]:
return package.arch
else:
Member

same

same
soksanichenko marked this conversation as resolved
@ -313,0 +379,4 @@
for package in self.get_packages_iterator(repo_info=repo_info):
if self.is_skipped_module_package(package):
continue
if self.is_excluded_package(
Member

those if statements can be united

those `if` statements can be united
Author
Owner

It's splitted for more readable code.

It's splitted for more readable code.
anfimovdm marked this conversation as resolved
@ -368,0 +405,4 @@
package_info['is_reference'] == is_reference and \
self.compare_pkgs_version(
package_1=package,
package_2=package_info['package'],
Member

wrong indents

wrong indents
Author
Owner

Pycharm didn't agree with you)

Pycharm didn't agree with you)
Member

btw, even if linter doesn't show any warnings about indents, it looks wierd, because indents for function arguments supposed to be like this

self.compare_pkgs_version(
    package_1=package,
    package_2=package_info['package'],
):

I prefer to use black for code formatting, here is an example of black formatting for those lines

if "is_reference" not in package_info:
    package_info["variants"].append(variant_info.name)
    package_info["is_reference"] = is_reference
    package_info["package"] = package
elif (
    not package_info["is_reference"]
    or package_info["is_reference"] == is_reference
    and self.compare_pkgs_version(
        package_1=package,
        package_2=package_info["package"],
    )
    > 0
):
    package_info["variants"] = [variant_info.name]
    package_info["is_reference"] = is_reference
    package_info["package"] = package
elif (
    self.compare_pkgs_version(
        package_1=package,
        package_2=package_info["package"],
    )
    == 0
    and repo_info.repo_type != "absent"
):
    package_info["variants"].append(variant_info.name)


btw, even if linter doesn't show any warnings about indents, it looks wierd, because indents for function arguments supposed to be like this ```python3 self.compare_pkgs_version( package_1=package, package_2=package_info['package'], ): ``` I prefer to use `black` for code formatting, here is an example of black formatting for those lines ```python3 if "is_reference" not in package_info: package_info["variants"].append(variant_info.name) package_info["is_reference"] = is_reference package_info["package"] = package elif ( not package_info["is_reference"] or package_info["is_reference"] == is_reference and self.compare_pkgs_version( package_1=package, package_2=package_info["package"], ) > 0 ): package_info["variants"] = [variant_info.name] package_info["is_reference"] = is_reference package_info["package"] = package elif ( self.compare_pkgs_version( package_1=package, package_2=package_info["package"], ) == 0 and repo_info.repo_type != "absent" ): package_info["variants"].append(variant_info.name) ```
@ -449,0 +468,4 @@
name=variant_name,
arch=variant_info['arch'],
excluded_packages=variant_info.get('excluded_packages', []),
repos=[RepoInfo(
Member

you can unpack dicts instead of passing keyword arguments

VariantInfo(**variant_info)

you can unpack dicts instead of passing keyword arguments ```python3 VariantInfo(**variant_info) ```
Author
Owner

Yes, I know, but that variant is more readable

Yes, I know, but that variant is more readable
soksanichenko marked this conversation as resolved
soksanichenko added 1 commit 2023-03-29 08:40:08 +00:00
anfimovdm approved these changes 2023-03-29 09:24:03 +00:00
soksanichenko added 1 commit 2023-03-30 09:52:59 +00:00
soksanichenko added 1 commit 2023-03-30 11:05:55 +00:00
soksanichenko merged commit 68aee1fa2d into al_master 2023-03-31 09:03:40 +00:00
Sign in to join this conversation.
No reviewers
No Label
No Milestone
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: almalinux/pungi#15
No description provided.