Skip to content

Conversation

@JonoYang
Copy link
Member

@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 JonoYang requested a review from pombredanne August 4, 2022 21:03
@JonoYang
Copy link
Member 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
Member 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.

3 participants