HI Mike,

On 13/04/2020 17:49, Mike Kelsey wrote:
Hello!  In the EasyBlock discussions, I asked

   https://github.com/easybuilders/easybuild-easyblocks/issues/2024

how, in my own package-specific easyblock, I could get access to the
information put into the 'git_config' dictionary by my .eb file.  Sam Moors
(@smoors) pointed me at an example of show how to _fill_ 'git_config' in an
EasyConfig, which is well documented.

I haven't been able to find (given GitHub's limited search capability) an
instance in any existing EasyBlock of how to _access_ 'git_config'.  The
only place I even saw it referenced was in the top-level base easyblock.py,
but that's so far up the chain I can't figure out how to get to it.

If this is explicitly something that developer's EasyBlocks should _not_ do,
I think that should be added clearly to the documentation.  If it is
something that my g4cmp.py EasyBlock should be able to do, I would love to
understand how.

I'm sending this to the mailing list because Sam closed my discussion issue
and specifically requested that I use the mailing list rather than the
forum.

                                                -- Mike Kelsey
The git_config mechanism is not really intended to be accessed directly from easyblocks, but I see no problem in doing so (it's a stable feature, and the API from the point of view of an easyblock won't be changed imho).

In the EasyBlock class, the git_config dict is only used to obtain the source tarball, but the "parsed" data in it is not retained in the EasyBlock class itself.

You can still access it from an easyblock though, just like you can any easyconfig parameter, in this case via "self.cfg['sources']", which will give you the (raw) contents of the 'sources' easyconfig parameter (a list, where one of the items is a dict that has 'git_config' as a key).

So, assuming there's only one source: self.cfg['sources'][0]['git_config'] .

Disclaimer: I didn't test this, but it should work.

I hope this helps...

regards,

Kenneth

Reply via email to