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

Support conan in packagedcode #3650

Merged
merged 7 commits into from
Feb 19, 2024
Merged

Conversation

keshav-space
Copy link
Member

@keshav-space keshav-space commented Feb 7, 2024

Tasks

  • Reviewed contribution guidelines
  • PR is descriptively titled 📑 and links the original issue above 🔗
  • Tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR
    Run tests locally to check for errors.
  • Commits are in uniquely-named feature branch and has no merge conflicts 📁
  • Updated documentation pages (if applicable)
  • Updated CHANGELOG.rst (if applicable)

Signed-off-by: Keshav Priyadarshi <git@keshav.space>
- Parse and collect version and download_url for conan package
- Override the assembly to enhance the package data from conanfile.py

Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra left a comment

Choose a reason for hiding this comment

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

@keshav-space Thanks++
Looking great already, I had some questions and comments for you to consider, see below.

src/packagedcode/conan.py Outdated Show resolved Hide resolved
)

@classmethod
def assemble(
Copy link
Member

Choose a reason for hiding this comment

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

Usually we have the assemble function under a base class and then inherit that in all other datafile handlers if these manifests can exist on their own and also together, to cover all the cases, would that also benifit us here?

Copy link
Member Author

Choose a reason for hiding this comment

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

conanfile.py can exist on its own, but conandata.yml should not exist in isolation. We need the custom assembly only in the case of conandata.yml

Copy link
Member

@pombredanne pombredanne Feb 15, 2024

Choose a reason for hiding this comment

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

Which brings to light the limits of a single-file-at-a-time approach. Should we start looking outside of the current file? ScanCode is not design for this at all though for now.

Copy link
Member Author

Choose a reason for hiding this comment

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

In case of conan, we need to process 2 files to obtain the package data. However, if we encounter a scenario where we have more than 2 files that need to be processed to obtain package data, processing multiple files at once would be helpful. Otherwise, the assembly will become a bit complex.

src/packagedcode/conan.py Show resolved Hide resolved
src/packagedcode/conan.py Outdated Show resolved Hide resolved
src/packagedcode/conan.py Show resolved Hide resolved
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Signed-off-by: Keshav Priyadarshi <git@keshav.space>
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! we just need a changelog

Signed-off-by: Keshav Priyadarshi <git@keshav.space>
Copy link
Member

@AyanSinhaMahapatra AyanSinhaMahapatra 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 @keshav-space
Merging!

@AyanSinhaMahapatra AyanSinhaMahapatra merged commit f8a9538 into develop Feb 19, 2024
34 checks passed
@AyanSinhaMahapatra AyanSinhaMahapatra deleted the 2388-support-conan branch February 19, 2024 09:14
@AyanSinhaMahapatra AyanSinhaMahapatra added this to the v32.1 milestone Mar 18, 2024
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.

Add support for conan.io C/C++ packages
3 participants