@@ -191,6 +191,19 @@ def __init__(self, ec, logfile=None):
191
191
self .cfg = ec
192
192
else :
193
193
raise EasyBuildError ("Value of incorrect type passed to EasyBlock constructor: %s ('%s')" , type (ec ), ec )
194
+
195
+ # are we running in developer mode?
196
+ self .developer = build_option ('developer' )
197
+
198
+ # This is needed in case custom easyblocks do a reparse of the EC file (e.g. quantum espresso)
199
+ if self .developer and not self .version .endswith ('-dev' ):
200
+ old_vers = ec ['version' ]
201
+ new_vers = old_vers + '-dev'
202
+ ec ['version' ] = new_vers
203
+ for key in ['short_mod_name' , 'full_mod_name' ]:
204
+ prev = getattr (ec , key )
205
+ new = prev .replace (f'/{ old_vers } ' , f'/{ new_vers } ' )
206
+ setattr (ec , key , new )
194
207
195
208
# modules interface with default MODULEPATH
196
209
self .modules_tool = self .cfg .modules_tool
@@ -2792,15 +2805,29 @@ def extract_step(self):
2792
2805
"""
2793
2806
Unpack the source files.
2794
2807
"""
2795
- for src in self .src :
2796
- self .log .info ("Unpacking source %s" % src ['name' ])
2797
- srcdir = extract_file (src ['path' ], self .builddir , cmd = src ['cmd' ],
2798
- extra_options = self .cfg ['unpack_options' ], change_into_dir = False )
2799
- change_dir (srcdir )
2800
- if srcdir :
2801
- self .src [self .src .index (src )]['finalpath' ] = srcdir
2808
+ developer_pth = self .developer
2809
+ if developer_pth :
2810
+ if self .start_dir :
2811
+ dst_name = self .start_dir
2802
2812
else :
2803
- raise EasyBuildError ("Unpacking source %s failed" , src ['name' ])
2813
+ dst_name = os .path .basename (developer_pth )
2814
+ dest = os .path .join (self .builddir , dst_name )
2815
+ copy_dir (
2816
+ developer_pth , dest ,
2817
+ ignore = lambda pth ,elem : [_ for _ in elem if _ in ['.git' , '.svn' , '.hg' ]]
2818
+ )
2819
+ self .cfg ['start_dir' ] = dest
2820
+ self .log .info ("Content of develop path %s copied to %s (new start_dir)" , developer_pth , dest )
2821
+ else :
2822
+ for src in self .src :
2823
+ self .log .info ("Unpacking source %s" % src ['name' ])
2824
+ srcdir = extract_file (src ['path' ], self .builddir , cmd = src ['cmd' ],
2825
+ extra_options = self .cfg ['unpack_options' ], change_into_dir = False )
2826
+ change_dir (srcdir )
2827
+ if srcdir :
2828
+ self .src [self .src .index (src )]['finalpath' ] = srcdir
2829
+ else :
2830
+ raise EasyBuildError ("Unpacking source %s failed" , src ['name' ])
2804
2831
2805
2832
def patch_step (self , beginpath = None , patches = None ):
2806
2833
"""
@@ -4192,6 +4219,12 @@ def skip_step(self, step, skippable):
4192
4219
skip_test_step = build_option ('skip_test_step' )
4193
4220
skipsteps = self .cfg ['skipsteps' ]
4194
4221
4222
+ developer_skip = (
4223
+ FETCH_STEP ,
4224
+ PATCH_STEP ,
4225
+ EXTENSIONS_STEP ,
4226
+ )
4227
+
4195
4228
# under --skip, sanity check is not skipped
4196
4229
cli_skip = self .skip and step != SANITYCHECK_STEP
4197
4230
@@ -4227,6 +4260,9 @@ def skip_step(self, step, skippable):
4227
4260
elif skip_test_step and step == TEST_STEP :
4228
4261
self .log .info ("Skipping %s step as requested via skip-test-step" , step )
4229
4262
skip = True
4263
+ elif self .developer and step in developer_skip :
4264
+ self .log .info ("Skipping %s step because of --developer" , step )
4265
+ skip = True
4230
4266
4231
4267
else :
4232
4268
msg = "Not skipping %s step (skippable: %s, skip: %s, skipsteps: %s, module_only: %s, force: %s, "
0 commit comments