tweak easybuild.easyblocks package declaration to better support custom easyblocks repo#617
Conversation
…om easyblocks repo
|
Refer to this link for build results (access rights to CI server needed): This pull request is now ready for review/testing. Please try and find someone who can tackle this; contact @boegel if you're not sure what to do. |
|
Does this also deal with the case where a custom easyblock repository has a custom |
|
In that case, there's no problem, since the path to the custom easyblock repo will be first in the Python search path anyway: |
|
ok, yes, this works because you use |
|
please add some kind of integration test for this. |
…m easyblocks repo
|
Refer to this link for build results (access rights to CI server needed): See https://jenkins1.ugent.be/job/easybuild-easyblocks-pr-builder/981/console for more details. Please fix the reported issues by pushing additional commits to the branch corresponding with this pull request; contact @boegel if you're not sure what to do. |
|
Current implementation of the test doesn't work when an The problem is that that repo gets precedence over whichever repo is listed first through |
|
Refer to this link for build results (access rights to CI server needed): This pull request is now ready for review/testing. Please try and find someone who can tackle this; contact @boegel if you're not sure what to do. |
|
Worked around possible complications from Since the |
|
You've only fixed this in the tests, so, in real world situations this issue will still pop up? |
|
In real world situations, we need something like Setting this up via The changes here are orthogonal to that though, and are still required to make things work as expected. |
|
So the first 'untweaked' testcase is also broken in master? |
|
@JensTimmerman: not sure what you mean here... If you use |
|
My question is: if you take the unittest before you tweaked it to actually work with a workaround, does that also fail on the current master branch of easybuild? |
|
The unit test tests whether custom easyblocks can overrule an existing easyblock, so yes, it would fail on master. Making that possible is exactly the point of this PR. |
|
BTW, the workaround for the failing test is in the test itself (I basically avoid running into an |
|
Can you then please add a test that also tests the current behaviour? Where you can just add an easyblock to the path, and see that it's picked up? |
|
@JensTimmerman: it's doing that (too) already, see https://github.com/hpcugent/easybuild-easyblocks/pull/617/files#diff-6c1ff9f6cc8975b3ffa9e414bddf0e10R148 |
|
I guess it's fine then |
|
documentation will be updated along with easybuilders/easybuild-framework#1301 Thanks for the review @JensTimmerman! |
…s_repo tweak easybuild.easyblocks package declaration to better support custom easyblocks repo
Using
extend_pathto 'flatten' the easyblocks namespace results in better support for custom easyblocks repos, i.e. easyblocks that override existing easyblocks can be put in place easily.This does require adding an (empty)
__init__.pyfile in each letter-subdir.There's one special case: because the R easyblock clashes with the
easybuild.easyblocks.r, an ickyfrom ... import *needs to be put in place in ther/__init__.pyfile...For custom easyblock repos, including the following in the
easybuild/easyblocks/__init__.pyfile should suffice with this in place:Although a custom easyblocks repo may not include letter-subdirs, the
extend_pathloop still needs to be there, because only the first__init__.pythere appears in the Python search path is actually executed.Preliminary testing shows this works as intended (see below). A unit test will be added to confirm this (and make sure we don't break it).
The reason this works is because
extend_pathbasically scanssys.path, and thus considers alleasybuild/easyblockspackage directories that are included in the Python search path...@JensTimmerman: please review?