Hi Mike,

On 09/05/2020 05:08, Mike Kelsey wrote:
Hi, all!  I'm continuing to work on the "git_config for extensions" issue
(my Framework PR #3294), now working to pass a 'sources' dictionary through
instead of making 'git_config' a special case.

What I'm attempting, is to factor out the code inside the loop over sources
in fetch_sources(), and put that into a separate function which can be
called also from fetch_extension_sources().  At one point in this block, the
checksum for the source is retrieved by calling get_checksum_for():

        self.get_checksum_for(checksums, filename=filename, index=index)

The filename argument doesn't seem to be used for anything, and I am
wondering if I could safely leave it out.  Is the filename there for "future
expansion"?  Or is it a relic of past code?  I did a search, and it seems
like it's only called from other functions in easyblock.py.

Looks like the 'get_checksum_for' method was originally defined like that, with the 'filename' argument there, but unused, see https://github.com/easybuilders/easybuild-framework/commit/1eaa7b74191f790291f8148fd14b3febcd473de6 .The checksum lookup is purely done based on the ['index'] value.

If you're up for it, I think we should:

* clean up all calls to 'get_checksum_for' to not pass a value to 'filename';

* deprecate the use of 'filename' in 'get_checksum_for' (if it's anything else than None, call self.log.deprecated with an appropriate message).


regards,

Kenneth

                                                -- Mike

Reply via email to