Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test for invalid repo_depends items (closes #1414) #1574

Merged
merged 4 commits into from
Jun 25, 2020
Merged

Test for invalid repo_depends items (closes #1414) #1574

merged 4 commits into from
Jun 25, 2020

Conversation

yan12125
Copy link
Member

Marked as draft as this depends on archlinuxcn/lilac#144. Will update after that pull request is merged or another approach is proposed.

See https://travis-ci.org/github/yan12125/repo/builds/673671061 for an example failing test.

@yan12125
Copy link
Member Author

TODO if this PR is accepted: reject in-official-repos and orphaning issues in issuebot [1] if the to-be-removed package is listed in repo_depends of another package.

[1] https://github.com/archlinuxcn/misc_scripts/blob/master/issuebot

@yan12125 yan12125 marked this pull request as draft April 11, 2020 03:30
@lilydjwg
Copy link
Member

To read repo_depends without ImportErrors you can load only lilac.yaml, or hack the importing system to return fake modules and hope it works.

@yan12125
Copy link
Member Author

you can load only lilac.yaml

For now it does not work as

$ rg -lg lilac.py repo_depends archlinuxcn | wc -l
23

And as you know, not everyone agreed on migrating repo_depends to lilac.yaml (#990).

hack the importing system to return fake modules

Do you mean something like the commit 77660f3 in #979? I'm fine if such a commit is the only stuff to add. A bigger issue is that one needs to replicate complex logic to handle lilac.py and lilac.yaml, like _parse_lilac, _parse_lilac_py and _parse_lilac_yaml functions in #979, or lilacpy.py and lilacyaml.py in lilac2. I'm afraid that will be a big maintenance burden.

I guess you want to make the new test run no matter a packager clones lilac or not? An approach might be vendoring necessary files from lilac2 and winterpy and adjust sys.path in pre-commit. I can create a script for that if that sound fine to you.

@yan12125 yan12125 marked this pull request as ready for review April 12, 2020 08:18
@lilydjwg
Copy link
Member

lilydjwg commented Apr 12, 2020 via email

@yan12125
Copy link
Member Author

So, let's go back to #990 first?

@yan12125
Copy link
Member Author

Rebased after #1615. I also added a check to deny repo_depends in lilac.py

Chih-Hsuan Yen added 3 commits June 20, 2020 22:25
python-lhafile is now in [community]. See #1313
superlu is now in [community]. See #1678
Use newer Python as the original version of this patch uses lilac, and
the latter has `from __future__ import annotations`, which is not
available until Python 3.7. Now newer Python is not neccessary, but it
is still better to upgrade sooner than later.

And repo_depends are now denied in lilac.py (#990)
@yan12125
Copy link
Member Author

Rebased and tested manually. A new broken package armadillo is now fixed.

Given that in-official-repos and orphaned packages are now automatically handled by the issuebot, could this be merged?

@lilydjwg lilydjwg requested a review from farseerfc June 21, 2020 11:07
Copy link
Member

@lilydjwg lilydjwg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It mostly looks good to me. @farseerfc what do you think?

pre-commit Show resolved Hide resolved
lilac_yaml = yaml.load(lilac_yaml_file.read(), Loader=yaml.SafeLoader)
for dep in lilac_yaml.get('repo_depends', []):
if isinstance(dep, dict):
dep_package = list(dep.keys())[0]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding of reading this line is that, this only checks pkgbase name for splitpkgs, which is fine for solving #1414 and should work in most cases (the number of repo_depends: - pkgbase: pkgname is limited). Maybe we should leave a note about this for future improvements.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! I added a not about this line in the new commit.

pre-commit Show resolved Hide resolved
@farseerfc
Copy link
Member

LGTM except for the note on splitpkgs name.

@farseerfc
Copy link
Member

farseerfc commented Jun 24, 2020

Should I merge it and make the change about list_packages function name?

@lilydjwg lilydjwg merged commit 345f20a into archlinuxcn:master Jun 25, 2020
@yan12125 yan12125 deleted the issue1414 branch June 25, 2020 12:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants