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 6 months ago
Owner
  • [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 6 months ago
6d58bc2ed8 ALBS-987: Generate i686 and dev repositories with pungi on building new distr. version automatically
- [Generator of packages.json] Replace using CLI by config.yaml
- [Gather RPMs] os.path is replaced by Path
soksanichenko added 1 commit 6 months ago
soksanichenko added 1 commit 6 months ago
4b64d20826 ALBS-987: Generate i686 and dev repositories with pungi on building new distr. version automatically
- Path.rglob/glob doesn't work with symlinks (it's the bug and reported)
- Refactoring
soksanichenko added 1 commit 6 months ago
soksanichenko added 1 commit 6 months ago
Korulag approved these changes 6 months ago
anfimovdm requested changes 6 months ago
@ -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:
Collaborator

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:
Collaborator

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:
Collaborator

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:
Collaborator

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:
Collaborator

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(
Collaborator

those if statements can be united

those `if` statements can be united
Poster
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'],
Collaborator

wrong indents

wrong indents
Poster
Owner

Pycharm didn't agree with you)

Pycharm didn't agree with you)
Collaborator

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(
Collaborator

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) ```
Poster
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 6 months ago
anfimovdm approved these changes 6 months ago
soksanichenko added 1 commit 6 months ago
soksanichenko added 1 commit 6 months ago
soksanichenko merged commit 68aee1fa2d into al_master 6 months ago

Reviewers

Korulag approved these changes 6 months ago
anfimovdm approved these changes 6 months ago
The pull request has been merged as 68aee1fa2d.
You can also view command line instructions.

Step 1:

From your project repository, check out a new branch and test the changes.
git checkout -b ALBS-987 al_master
git pull origin ALBS-987

Step 2:

Merge the changes and update on Gitea.
git checkout al_master
git merge --no-ff ALBS-987
git push origin al_master
Sign in to join this conversation.
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
Loading…
There is no content yet.