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

Update DatafileHandler default methods #3042

Merged
merged 3 commits into from
Aug 14, 2022

Conversation

JonoYang
Copy link
Contributor

@JonoYang JonoYang commented Aug 4, 2022

This PR updates DatafileHandler.assemble() and DatafileHandler.assemble_from_many() to yield Packages, Dependencies, and Resources before associating Packages to Resources using a package_adder. This is to help with using packagedcode Package handlers in scancode.io, where a Package needs to be created in scancode.io before it can be associated with a Resource.

   * Yield Packages and Dependencies before associating Packages to Resources

Signed-off-by: Jono Yang <jyang@nexb.com>
@JonoYang
Copy link
Contributor Author

JonoYang commented Aug 4, 2022

On second thought, it makes more sense to sort the assembly items after the fact in scancode.io than it is to mandate every .assembly() method yields Packages, Dependencies, and Resources in that order.

Signed-off-by: Jono Yang <jyang@nexb.com>
    * Update assemble methods for alpine and debian to yield Packages first before other items

Signed-off-by: Jono Yang <jyang@nexb.com>
@JonoYang
Copy link
Contributor Author

@pombredanne

I've updated the rest of the assemble() methods to yield Packages before other assembly items. I tried sorting the output of the assemble() method in my code on scancode.io, but it doesn't seem that there is a way around reordering the logic in the different assemble() methods when we want to create a Package before associating it to a Resource.

Copy link
Member

@pombredanne pombredanne left a comment

Choose a reason for hiding this comment

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

LGTM!
Thanks
merging.

@pombredanne pombredanne merged commit 267518b into develop Aug 14, 2022
@pombredanne pombredanne deleted the datafilehandler-yield-package-first branch August 14, 2022 09:12
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.

None yet

2 participants