feat: add basic support for Python in gen-build-spec#1203
Conversation
bb8c99d to
81d6f60
Compare
AbhinavPradeep
left a comment
There was a problem hiding this comment.
I think I understand build_spec_generator parts, but would need to understand the database bit in the larger context in more detail. My understanding is like this: We have a BaseBuildSpecDict, which is a typed dictionary storing inferred build data. We define BaseBuildSpec as an abstract base class which requires the resolve_fields method. MavenBuildSpec and PyPIBuildSpec implement BaseBuildSpec and will have their custom logic which populates BaseBuildSpecDict. From reading through the code, the most important functions seem to be src/macaron/build_spec_generator/build_spec_generator.py#gen_build_spec_for_purl , inside where we get a "session" from which we can query build data that macaron has inferred (this is the bit I should understand better). This session is passed to src/macaron/build_spec_generator/core.py#gen_generic_build_spec alongside the purl and patches, which then populates the base BaseBuildSpecDict, before looking up the ecosystem and calling resolve_fields. Back in gen_build_spec_for_purl, format for the output is chosen between RC buildspec and JSON, and then the output file is written. Is this high level understanding correct? Will look into the details more now, but from my understanding of the high level design it looks good!
81d6f60 to
75c1822
Compare
Signed-off-by: behnazh-w <behnaz.hassanshahi@oracle.com>
Signed-off-by: behnazh-w <behnaz.hassanshahi@oracle.com>
75c1822 to
5a67adf
Compare
Signed-off-by: behnazh-w <behnaz.hassanshahi@oracle.com>
5a67adf to
c3144f7
Compare
AbhinavPradeep
left a comment
There was a problem hiding this comment.
Looks good to me!
Summary
This PR adds basic support for Python projects to the
gen-build-specfeature in Macaron. It also introduces a new approach for generic specification generation.Description of changes