Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
157 commits
Select commit Hold shift + click to select a range
130546c
bump version to 3.7.1dev
boegel Sep 25, 2018
43f1405
Merge pull request #2589 from boegel/develop
migueldiascosta Sep 25, 2018
fdb1fd9
stop relying on 'easy_install' in bootstrap script, use 'python -m ea…
boegel Sep 25, 2018
aec9541
fix templating of values in list_software function
boegel Sep 25, 2018
fd58fa8
Merge pull request #2591 from boegel/fix_list_software_templating
vanzod Sep 25, 2018
1a668ea
Merge pull request #2590 from boegel/fix_bootstrap_ubuntu1804
vanzod Sep 26, 2018
def03eb
lower required Lmod version to 6.5.1 (latest packaged version availab…
boegel Sep 26, 2018
86559ef
Merge pull request #2593 from boegel/lmod651
vanzod Sep 27, 2018
d1b57f7
generate .modulerc.lua when Lua syntax and Lmod >= 7.8 is used
boegel Sep 28, 2018
6f87f01
add & use DOT_MODULERC constant in ModuleGenerator class
boegel Sep 28, 2018
bcd3bfe
drop check for Lmod in ModuleGeneratorLua, since it forces to have a …
boegel Sep 28, 2018
2cc8029
fix broken test_modulerc which doesn't take into account modulerc in …
boegel Sep 28, 2018
a42f0b3
Merge pull request #2597 from boegel/modulerc_lua
vanzod Oct 1, 2018
4c0b0a6
fix composing of lib64 fallback paths in sanity check
boegel Oct 1, 2018
91bd9da
flesh out code to determine file_info in copy_easyconfigs
migueldiascosta Oct 2, 2018
aa2a4b9
fix lines too long
migueldiascosta Oct 2, 2018
723932e
Merge pull request #2604 from migueldiascosta/fix_newpr_labels
boegel Oct 2, 2018
10d2d89
Allow --force to use regex if --try-toolchain cannot map intelligently.
bartoldeman Oct 2, 2018
9ee91f9
@houndci-bot
bartoldeman Oct 2, 2018
795e2e9
enhance test for lib64 fallback to verify fix
boegel Oct 2, 2018
fb935bb
add support to modulerc method to also write modulerc file (WIP)
boegel Oct 2, 2018
b6d0a5e
Merge pull request #2602 from boegel/lib64_fallback_fix
vanzod Oct 2, 2018
3e745e1
also check for module wrappers in 'ModulesTool.exist' method
boegel Oct 2, 2018
5ede8e0
add support for disabling modules tool version check
boegel Oct 3, 2018
3283101
reword debug log message when skipping modules tool version check
boegel Oct 3, 2018
f0ea0a0
only check for Java/1.8 wrapper for sufficient recent Lmod versions
boegel Oct 3, 2018
06621bf
grab name of wrapped module in ModulesTool.module_wrapper_exists so w…
boegel Oct 4, 2018
525d92e
determine full module name of wrapped module based on available short…
boegel Oct 4, 2018
5ed037a
fix .modulerc created in test_exists when EnvironmentModulesC is used…
boegel Oct 4, 2018
5fdb1c9
fix undefined 'res' in Lmod.module_wrapper_exists
boegel Oct 4, 2018
69cf80e
fix check for EnvironmentModulesC + add missing header to .modulerc f…
boegel Oct 4, 2018
93fdcf4
take into account optional leading whitespace in module-version state…
boegel Oct 4, 2018
e32c6d2
Merge pull request #2610 from boegel/disable_modules_tool_version_check
akesandgren Oct 4, 2018
9ec0468
Merge branch 'develop' into write_modulerc
boegel Oct 4, 2018
efe71e1
add check to see whether .modulerc and wrapped file are in same direc…
boegel Oct 4, 2018
79134f7
Catch exception, so existing test cases and logic can be kept.
bartoldeman Oct 4, 2018
97347b6
Use positive logic and improve warning message, as per @boegel review.
bartoldeman Oct 4, 2018
0adba02
Check for correct exception, from @boegel's review.
bartoldeman Oct 5, 2018
be49bd6
Merge pull request #2605 from ComputeCanada/force-try-toolchain
Oct 5, 2018
b65e9e9
Merge pull request #2606 from boegel/module_wrapper_exist
vanzod Oct 5, 2018
e1161b5
also take into account --rebuild to overwrite existing .modulerc + en…
boegel Oct 6, 2018
32e6fc7
add trailing newline to module load message if it's not there yet
boegel Oct 6, 2018
39b66f1
add support for not indenting if/else body in ModuleGenerator.conditi…
boegel Oct 6, 2018
cbae134
fix & enhance toy test involving modloadmsg
boegel Oct 6, 2018
087c1d4
fix broken tests
boegel Oct 6, 2018
c618ee7
fix minor remarks by @damianam
boegel Oct 9, 2018
2f53e88
Fixed typo
damianam Oct 9, 2018
574da4c
Merge pull request #37 from damianam/write_modulerc
boegel Oct 9, 2018
681ee56
Merge pull request #2611 from boegel/write_modulerc
vanzod Oct 9, 2018
a7879c7
fix remaining failing tests
boegel Oct 10, 2018
a59e3fa
Merge pull request #2613 from boegel/modloadmsg_newline
damianam Oct 10, 2018
3f55633
retain all dependencies when determining dependency tree of a toolchain
boegel Oct 12, 2018
9f99264
fix test for get_dep_tree_of_toolchain
boegel Oct 12, 2018
9d894e6
Merge pull request #2617 from boegel/get_dep_tree_of_toolchain_retain…
Oct 13, 2018
78c6f00
Protect exts_lists from templating in dump method (since they are tem…
Oct 15, 2018
327f062
Protect exts_lists from templating in dump method (since they are tem…
Oct 15, 2018
2c46aa2
Tidy up
Oct 15, 2018
dbef801
Make sure new test is touched
Oct 15, 2018
fcf2ed5
Appease the hound
Oct 15, 2018
facbf09
Appease the hound
Oct 15, 2018
400009e
Revert Python test easyconfig update (yeb format not ready to test ag…
Oct 15, 2018
688d439
maintain alphabetical sorting for values of EXCLUDED_KEYS_REPLACE_TEM…
boegel Oct 15, 2018
c253144
Merge pull request #38 from boegel/limit_dump_templating
Oct 15, 2018
1429426
Merge pull request #2619 from ocaisa/limit_dump_templating
boegel Oct 15, 2018
b6aaac9
Merge branch 'develop' into 3.7.x
boegel Oct 15, 2018
2b5ba34
Merge pull request #2621 from ComputeCanada/fix_cuda_capability_detec…
Oct 16, 2018
c4b4efb
Merge branch 'develop' into 3.7.x
boegel Oct 16, 2018
13e121f
prepare release notes for eb371
migueldiascosta Oct 17, 2018
9150364
Merge pull request #38 from migueldiascosta/eb371
boegel Oct 17, 2018
01fb545
minor tweaks to EasyBuild v3.7.1 release notes + bump version
boegel Oct 17, 2018
7d43cd8
Merge pull request #2623 from boegel/eb371
vanzod Oct 17, 2018
4178725
stop testing with Lmod 6.6.3, testing with Lmod 6.5.1 is sufficient
boegel Oct 17, 2018
da3f86f
Merge pull request #2625 from easybuilders/3.7.x
boegel Oct 18, 2018
49519a8
bump version to 3.7.2dev
boegel Oct 18, 2018
6ff250f
Merge pull request #2626 from boegel/develop
vanzod Oct 18, 2018
4ada6ed
Merge pull request #2627 from boegel/travis_drop_lmod663
vanzod Oct 19, 2018
97ba947
Added pre-create-installdir option
vanzod Oct 19, 2018
e456972
Removed trailing space
vanzod Oct 19, 2018
eb98389
Fixed message to appease Kenneth
vanzod Oct 19, 2018
f2c6421
make --from-pr try to apply patch on target branch of PR, regardless …
boegel Oct 19, 2018
c335abe
don't hardcode develop in --from-pr support, use PR target branch ins…
boegel Oct 19, 2018
0bd27d0
Merge pull request #2629 from vanzod/skip_mk_instdir
boegel Oct 19, 2018
948d025
flesh out setting up of configuration into dedicated 'set_up_configur…
boegel Oct 23, 2018
3fd5e9e
move 'set_up_configuration' function to tools/options.py
boegel Oct 23, 2018
9f51680
add option to silence output generated by set_up_configuration function
boegel Oct 23, 2018
cae79ef
make build_option function produce a clearer error message when an un…
boegel Oct 23, 2018
9f8c107
add test for --pre-create-installdir
boegel Oct 23, 2018
5fc2125
Merge pull request #2637 from boegel/test_pre_create_installdir
vanzod Oct 23, 2018
2b4dab6
add tests to check whether EasyBuild can be used as a library, as lon…
boegel Oct 24, 2018
1c7e977
pass down arguments from main to set_up_configuration
boegel Oct 24, 2018
6f2ae12
clean error when 'eb' is cancelled by user
boegel Oct 26, 2018
d1e5ca7
make --from-pr follow --pr-target-account rather than hardcoding it t…
boegel Oct 26, 2018
596c351
Merge pull request #2631 from boegel/fix_from_pr
migueldiascosta Oct 26, 2018
aca7d92
Merge pull request #2638 from boegel/eb_as_library
bartoldeman Oct 26, 2018
9a8625d
add support for using PySlurm as backend for --job
boegel Oct 29, 2018
9463ba4
not PBS/pbs_python, but PySlurm
boegel Oct 30, 2018
41d1556
Merge pull request #2641 from boegel/keyboard_interrupt
akesandgren Oct 30, 2018
23771fd
add --job-deps-type configuration option to specify which type of job…
boegel Oct 31, 2018
3dc4616
pyslurm eexpects time_limit, not 'time'.
akesandgren Oct 31, 2018
4a3c2e0
Merge pull request #39 from akesandgren/pyslurm-ake
boegel Oct 31, 2018
ef28891
add support for Slurm job backend
boegel Nov 1, 2018
143d0e2
add test for using Slurm as job backend
boegel Nov 1, 2018
a928ba8
make sure sbatch & scontrol commands are available when using Slurm a…
boegel Nov 1, 2018
e1a1a88
remove implementation for using PySlurm as job backend
boegel Nov 1, 2018
4170fd0
replace http with https in template constants
orbsmiv Nov 1, 2018
9f31f5d
Remove GOOGLECODE_SOURCE constant
orbsmiv Nov 1, 2018
0daf74b
submit jobs that have dependencies to Slurm with --kill-on-invalid-de…
boegel Nov 1, 2018
34bcf84
don't pass down specific environment variables into submitted jobs
boegel Nov 1, 2018
4803c02
use os.lchmod rather than os.chmod in adjust_permissions function
boegel Nov 1, 2018
dfb05ab
use os.lstat rather than os.stat in adjust_permissions function
boegel Nov 1, 2018
095810a
fix broken tests due to changed adjust_permissions
boegel Nov 1, 2018
f8d0717
release all submitted SLURM jobs in one go
boegel Nov 1, 2018
dca490f
Merge pull request #2643 from boegel/job_env
akesandgren Nov 1, 2018
8598eb3
Merge branch 'develop' into pyslurm
boegel Nov 3, 2018
6cda8ef
fix lib64 fallback for 'lib'/'lib64' dirs entry in sanity_check_paths
boegel Nov 3, 2018
e0e345e
Revert "fix broken tests due to changed adjust_permissions"
boegel Nov 3, 2018
2ce34ed
revert back to using os.chmod, since os.lchmod is not supported on Linux
boegel Nov 3, 2018
7601b46
fix comment in test_sanity_check_paths_lib64
boegel Nov 3, 2018
fa72174
Merge pull request #2649 from boegel/lib_lib64_fallback_fix
akesandgren Nov 3, 2018
df456f0
change PGI F90 Fortran compiler to pgf90
boegel Nov 4, 2018
fd37e4d
fix broken tests for adjust_permissions
boegel Nov 4, 2018
ca784cb
deprecate 'skip_symlinks' argument for adjust_permissions function
boegel Nov 4, 2018
e72ea1f
add clarifying comment on lack of os.lchmod on Linux
boegel Nov 4, 2018
cc4b3d3
Merge pull request #2650 from boegel/pgf90
akesandgren Nov 4, 2018
5040647
Merge pull request #2642 from boegel/pyslurm
akesandgren Nov 4, 2018
9f5c584
'always skippped' -> 'never followed' w.r.t. symlinks in adjust_permi…
boegel Nov 4, 2018
e25f307
use --set-upstream-to in install-EasyBuild-develop.sh script to deal …
boegel Nov 4, 2018
5afe187
Merge pull request #2644 from boegel/lchmod
akesandgren Nov 5, 2018
7bf5b9d
fix permissions for install-EasyBuild-develop.sh script
boegel Nov 5, 2018
33bd75a
produce clearer deprecation warning
boegel Nov 5, 2018
32d5a7d
Merge pull request #2651 from boegel/fix_dev_script
Nov 5, 2018
7ec67cf
Reinstate GOOGLECODE_SOURCE template
orbsmiv Nov 5, 2018
f8b1d6d
use https in source_urls in gzip test easyconfigs
boegel Nov 6, 2018
a0963a8
Merge pull request #1 from boegel/https_sources
orbsmiv Nov 6, 2018
76c4674
fix checksum for gzip-1.4.eb test easyconfig in test_exts_list
boegel Nov 6, 2018
153e0d7
Merge pull request #2 from boegel/https_sources
orbsmiv Nov 6, 2018
347e3b7
Merge pull request #2648 from bear-software/https_sources
boegel Nov 6, 2018
49a95b9
add support for deprecating easyconfig files & toolchains
boegel Nov 7, 2018
1299929
fix broken tests due to tweaked output of log.deprecated
boegel Nov 7, 2018
3d54fc3
add support to log.deprecated to provide custom message for 'more info'
boegel Nov 7, 2018
b06e6a1
change expected type for 'deprecated' easyconfig parameter to a strin…
boegel Nov 7, 2018
1912560
changed easyconfig.update to be able to specify not to allow duplicat…
mboisson Nov 12, 2018
71ef335
appeasing hound
mboisson Nov 12, 2018
354d050
Merge pull request #2656 from boegel/deprecate
Nov 14, 2018
e770f58
fixed the allowed_duplicate for lists, and added tests
mboisson Nov 14, 2018
17af619
appeasing hound
mboisson Nov 14, 2018
eb23b01
fixing bug introduced in update
mboisson Nov 14, 2018
44dc7d0
fixing typo
mboisson Nov 14, 2018
245164d
fixing test for python 2.6
mboisson Nov 14, 2018
c2ae926
Merge pull request #2657 from ComputeCanada/update_without_dup
boegel Nov 14, 2018
797f917
fix order of keys in 'toolchain' value for dumped easyconfig file (na…
boegel Nov 15, 2018
e70e7fe
trivial code style fixes in format/one.py
boegel Nov 15, 2018
4fdcd23
ensure style check passes on dumped easyconfigs
boegel Nov 15, 2018
4a7b9d1
add support to write_file to prevent overwriting existing files unles…
boegel Nov 15, 2018
b299861
don't blindly overwrite existing easyconfig files with --try-*
boegel Nov 15, 2018
17fe86a
Merge pull request #2660 from boegel/fix_dump_toolchain_keys_order
Nov 15, 2018
b69f2b0
Merge branch 'develop' into fix-bug-tweak
boegel Nov 15, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ python: 2.6
env:
matrix:
# purposely specifying slowest builds first, to gain time overall
- LMOD_VERSION=6.6.3
- LMOD_VERSION=6.6.3 TEST_EASYBUILD_MODULE_SYNTAX=Tcl
- LMOD_VERSION=7.7.16
- LMOD_VERSION=7.7.16 TEST_EASYBUILD_MODULE_SYNTAX=Tcl
- LMOD_VERSION=6.5.1
- LMOD_VERSION=6.5.1 TEST_EASYBUILD_MODULE_SYNTAX=Tcl
- LMOD_VERSION=7.8.5
- LMOD_VERSION=7.8.5 TEST_EASYBUILD_MODULE_SYNTAX=Tcl
- ENV_MOD_VERSION=3.2.10 TEST_EASYBUILD_MODULES_TOOL=EnvironmentModulesC TEST_EASYBUILD_MODULE_SYNTAX=Tcl
- ENV_MOD_TCL_VERSION=1.147 TEST_EASYBUILD_MODULES_TOOL=EnvironmentModulesTcl TEST_EASYBUILD_MODULE_SYNTAX=Tcl
- ENV_MOD_VERSION=4.0.0 TEST_EASYBUILD_MODULE_SYNTAX=Tcl TEST_EASYBUILD_MODULES_TOOL=EnvironmentModules
Expand Down Expand Up @@ -102,11 +102,12 @@ script:
- EB_BOOTSTRAP_VERSION=$(grep '^EB_BOOTSTRAP_VERSION' $TRAVIS_BUILD_DIR/easybuild/scripts/bootstrap_eb.py | sed 's/[^0-9.]//g')
- EB_BOOTSTRAP_SHA256SUM=$(sha256sum $TRAVIS_BUILD_DIR/easybuild/scripts/bootstrap_eb.py | cut -f1 -d' ')
- EB_BOOTSTRAP_FOUND="$EB_BOOTSTRAP_VERSION $EB_BOOTSTRAP_SHA256SUM"
- EB_BOOTSTRAP_EXPECTED="20180916.01 7e7563787a8bab8c30efdbdf95df6ec8ed63230ebcd361fee7b9574cbe9e74ed"
- EB_BOOTSTRAP_EXPECTED="20180925.01 d29478d5131fbf560a3806ef2613dc24e653c2857967788aace05107f614913b"
- test "$EB_BOOTSTRAP_FOUND" = "$EB_BOOTSTRAP_EXPECTED" || (echo "Version check on bootstrap script failed $EB_BOOTSTRAP_FOUND" && exit 1)
# test bootstrap script
- python $TRAVIS_BUILD_DIR/easybuild/scripts/bootstrap_eb.py /tmp/$TRAVIS_JOB_ID/eb_bootstrap
# unset $PYTHONPATH to avoid mixing two EasyBuild 'installations' when testing bootstrapped EasyBuild module
- unset PYTHONPATH
# simply sanity check on bootstrapped EasyBuild module
- module use /tmp/$TRAVIS_JOB_ID/eb_bootstrap/modules/all; module load EasyBuild; eb --version
- module use /tmp/$TRAVIS_JOB_ID/eb_bootstrap/modules/all
- module load EasyBuild; eb --version
24 changes: 24 additions & 0 deletions RELEASE_NOTES
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,30 @@ For more detailed information, please see the git log.

These release notes can also be consulted at https://easybuild.readthedocs.io/en/latest/Release_notes.html.

v3.7.1 (October 18th 2018)
--------------------------

bugfix release
- various enhancements, including:
- generate .modulerc.lua when Lua syntax and Lmod >= 7.8 is used (#2597)
- allow --force to use regex if --try-toolchain can not map intelligently (#2605)
- add support for disabling modules tool version check (#2610)
- add support to ModuleGenerator.modulerc method to also write .modulerc file (#2611)
- check whether module file being wrapped exists in same directory as module wrapper when using Lmod 6.x (#2611)
- various bug fixes, including:
- stop relying on 'easy_install' in bootstrap script, use 'python -m easy_install' instead (#2590)
- fix templating of values in list_software function (#2591)
- fix composing of lib64 fallback paths in sanity check (#2602)
- determine file_info for all easyconfigs before any actual copying in copy_easyconfigs function (#2604)
- also check for module wrappers in 'ModulesTool.exist' method (#2606)
- add trailing newline to module load message if it's not there yet (#2613)
- retain all dependencies when determining dependency tree of a toolchain (#2617)
- protect exts_lists from templating in dump method (#2619)
- making CUDA capability detection more robust (#2621)
- other changes:
- lower required Lmod version to 6.5.1 (#2593)


v3.7.0 (September 25th 2018)
----------------------------

Expand Down
27 changes: 18 additions & 9 deletions easybuild/framework/easyblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
:author: Fotis Georgatos (Uni.Lu, NTUA)
:author: Damian Alvarez (Forschungszentrum Juelich GmbH)
:author: Maxime Boissonneault (Compute Canada)
:author: Davide Vanzo (Vanderbilt University)
"""

import copy
Expand Down Expand Up @@ -1122,8 +1123,12 @@ def make_module_extra(self, altroot=None, altversion=None):
value, type(value))
lines.append(self.module_generator.prepend_paths(key, value, allow_abs=self.cfg['allow_prepend_abs_path']))

if self.cfg['modloadmsg']:
lines.append(self.module_generator.msg_on_load(self.cfg['modloadmsg']))
modloadmsg = self.cfg['modloadmsg']
if modloadmsg:
# add trailing newline to prevent that shell prompt is 'glued' to module load message
if not modloadmsg.endswith('\n'):
modloadmsg += '\n'
lines.append(self.module_generator.msg_on_load(modloadmsg))

if self.cfg['modtclfooter']:
if isinstance(self.module_generator, ModuleGeneratorTcl):
Expand Down Expand Up @@ -1669,9 +1674,13 @@ def fetch_step(self, skip_checksums=False):
for mod_symlink_path in mod_symlink_paths:
pardirs.append(os.path.join(install_path('mod'), mod_symlink_path, mod_subdir))

self.log.info("Checking dirs that need to be created: %s" % pardirs)
for pardir in pardirs:
mkdir(pardir, parents=True)
# skip directory creation if pre-create-installdir is set to False
if build_option('pre_create_installdir'):
self.log.info("Checking dirs that need to be created: %s" % pardirs)
for pardir in pardirs:
mkdir(pardir, parents=True)
else:
self.log.info("Skipped installation dirs check per user request")

def checksum_step(self):
"""Verify checksum of sources and patches, if a checksum is available."""
Expand Down Expand Up @@ -2291,10 +2300,10 @@ def xs2str(xs):
# for library files in lib/, also consider fallback to lib64/ equivalent (and vice versa)
if not found and build_option('lib64_fallback_sanity_check'):
xs_alt = None
if all(x.startswith('lib/') for x in xs):
xs_alt = [os.path.join('lib64', *os.path.split(x)[1:]) for x in xs]
elif all(x.startswith('lib64/') for x in xs):
xs_alt = [os.path.join('lib', *os.path.split(x)[1:]) for x in xs]
if all(x.startswith('lib/') or x == 'lib' for x in xs):
xs_alt = [os.path.join('lib64', *x.split(os.path.sep)[1:]) for x in xs]
elif all(x.startswith('lib64/') or x == 'lib64' for x in xs):
xs_alt = [os.path.join('lib', *x.split(os.path.sep)[1:]) for x in xs]

if xs_alt:
self.log.info("%s not found at %s in %s, consider fallback locations: %s",
Expand Down
2 changes: 2 additions & 0 deletions easybuild/framework/easyconfig/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,8 @@

# OTHER easyconfig parameters
'buildstats': [None, "A list of dicts with build statistics", OTHER],
'deprecated': [False, "String specifying reason why this easyconfig file is deprecated "
"and will be archived in the next major release of EasyBuild", OTHER],
}


Expand Down
75 changes: 63 additions & 12 deletions easybuild/framework/easyconfig/easyconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@
from easybuild.tools.toolchain.toolchain import TOOLCHAIN_CAPABILITIES, TOOLCHAIN_CAPABILITY_CUDA
from easybuild.tools.toolchain.utilities import get_toolchain, search_toolchain
from easybuild.tools.utilities import quote_py_str, remove_unwanted_chars
from easybuild.tools.version import VERSION
from easybuild.toolchains.compiler.cuda import Cuda

_log = fancylogger.getLogger('easyconfig.easyconfig', fname=False)
Expand Down Expand Up @@ -384,6 +385,9 @@ def __init__(self, path, extra_options=None, build_specs=None, validate=True, hi
self.build_specs = build_specs
self.parse()

# check whether this easyconfig file is deprecated, and act accordingly if so
self.check_deprecated(self.path)

# perform validations
self.validation = build_option('validate') and validate
if self.validation:
Expand Down Expand Up @@ -442,15 +446,22 @@ def copy(self):

return ec

def update(self, key, value):
def update(self, key, value, allow_duplicate=True):
"""
Update a string configuration value with a value (i.e. append to it).
"""
prev_value = self[key]
if isinstance(prev_value, basestring):
self[key] = '%s %s ' % (prev_value, value)
if allow_duplicate or value not in prev_value:
self[key] = '%s %s ' % (prev_value, value)
elif isinstance(prev_value, list):
self[key] = prev_value + value
if allow_duplicate:
self[key] = prev_value + value
else:
for item in value:
# add only those items that aren't already in the list
if item not in prev_value:
self[key] = prev_value + [item]
else:
raise EasyBuildError("Can't update configuration value for %s, because it's not a string or list.", key)

Expand Down Expand Up @@ -534,6 +545,26 @@ def parse(self):
# indicate that this is a parsed easyconfig
self._config['parsed'] = [True, "This is a parsed easyconfig", "HIDDEN"]

def check_deprecated(self, path):
"""Check whether this easyconfig file is deprecated."""

depr_msgs = []

deprecated = self['deprecated']
if deprecated:
if isinstance(deprecated, basestring):
depr_msgs.append("easyconfig file '%s' is marked as deprecated:\n%s\n" % (path, deprecated))
else:
raise EasyBuildError("Wrong type for value of 'deprecated' easyconfig parameter: %s", type(deprecated))

if self.toolchain.is_deprecated():
depr_msgs.append("toolchain '%(name)s/%(version)s' is marked as deprecated" % self['toolchain'])

if depr_msgs:
depr_maj_ver = int(str(VERSION).split('.')[0]) + 1
more_info_depr_ec = "(see also http://easybuild.readthedocs.org/en/latest/Deprecated-easyconfigs.html)"
self.log.deprecated(', '.join(depr_msgs), '%s.0' % depr_maj_ver, more_info=more_info_depr_ec)

def validate(self, check_osdeps=True):
"""
Validate this easyonfig
Expand Down Expand Up @@ -759,9 +790,12 @@ def all_dependencies(self):

return self._all_dependencies

def dump(self, fp):
def dump(self, fp, overwrite=True, backup=False):
"""
Dump this easyconfig to file, with the given filename.

:param overwrite: overwrite existing file at specified location without use of --force
:param backup: create backup of existing file before overwriting it
"""
orig_enable_templating = self.enable_templating

Expand Down Expand Up @@ -797,7 +831,7 @@ def dump(self, fp):
ectxt = autopep8.fix_code(ectxt, options=autopep8_opts)
self.log.debug("Dumped easyconfig after autopep8 reformatting: %s", ectxt)

write_file(fp, ectxt.strip())
write_file(fp, ectxt, overwrite=overwrite, backup=backup, verbose=backup)

self.enable_templating = orig_enable_templating

Expand Down Expand Up @@ -1615,16 +1649,19 @@ def clean_up_easyconfigs(paths):
write_file(path, ectxt, forced=True)


def copy_easyconfigs(paths, target_dir):
def det_file_info(paths, target_dir):
"""
Copy easyconfig files to specified directory, in the 'right' location and using the filename expected by robot.
Determine useful information on easyconfig files relative to a target directory,
before any actual operation (e.g. copying) is performed

:param paths: list of paths to copy to git working dir
:param paths: list of paths to easyconfig files
:param target_dir: target directory
:return: dict with useful information on copied easyconfig files (corresponding EasyConfig instances, paths, status)
:return: dict with useful information on easyconfig files (corresponding EasyConfig instances, paths, status)
relative to a target directory
"""
file_info = {
'ecs': [],
'paths': [],
'paths_in_repo': [],
'new': [],
'new_folder': [],
Expand All @@ -1634,6 +1671,7 @@ def copy_easyconfigs(paths, target_dir):
for path in paths:
ecs = process_easyconfig(path, validate=False)
if len(ecs) == 1:
file_info['paths'].append(path)
file_info['ecs'].append(ecs[0]['ec'])

soft_name = file_info['ecs'][-1].name
Expand All @@ -1646,14 +1684,27 @@ def copy_easyconfigs(paths, target_dir):
file_info['new'].append(new_file)
file_info['new_folder'].append(new_folder)
file_info['new_file_in_existing_folder'].append(new_file and not new_folder)

copy_file(path, target_path, force_in_dry_run=True)

file_info['paths_in_repo'].append(target_path)

else:
raise EasyBuildError("Multiple EasyConfig instances obtained from easyconfig file %s", path)

return file_info


def copy_easyconfigs(paths, target_dir):
"""
Copy easyconfig files to specified directory, in the 'right' location and using the filename expected by robot.

:param paths: list of paths to copy to git working dir
:param target_dir: target directory
:return: dict with useful information on copied easyconfig files (corresponding EasyConfig instances, paths, status)
"""
file_info = det_file_info(paths, target_dir)

for path, target_path in zip(file_info['paths'], file_info['paths_in_repo']):
copy_file(path, target_path, force_in_dry_run=True)

if build_option('cleanup_easyconfigs'):
clean_up_easyconfigs(file_info['paths_in_repo'])

Expand Down
4 changes: 2 additions & 2 deletions easybuild/framework/easyconfig/format/format.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@
DEPENDENCY_PARAMETERS = ['builddependencies', 'dependencies', 'hiddendependencies']

# values for these keys will not be templated in dump()
EXCLUDED_KEYS_REPLACE_TEMPLATES = ['description', 'easyblock', 'homepage', 'name', 'toolchain', 'version'] \
+ DEPENDENCY_PARAMETERS
EXCLUDED_KEYS_REPLACE_TEMPLATES = ['description', 'easyblock', 'exts_list', 'homepage', 'name', 'toolchain',
'version'] + DEPENDENCY_PARAMETERS

# ordered groups of keys to obtain a nice looking easyconfig file
GROUPED_PARAMS = [
Expand Down
10 changes: 6 additions & 4 deletions easybuild/framework/easyconfig/format/one.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,8 @@ def _find_defined_params(self, ecfg, keyset, default_values, templ_const, templ_
# dependency easyconfig parameters were parsed, so these need special care to 'unparse' them
if key in DEPENDENCY_PARAMETERS:
valstr = [dump_dependency(d, ecfg['toolchain']) for d in val]
elif key == 'toolchain':
valstr = "{'name': '%(name)s', 'version': '%(version)s'}" % ecfg[key]
else:
valstr = quote_py_str(ecfg[key])

Expand Down Expand Up @@ -287,9 +289,9 @@ def extract_comments(self, rawtxt):
Inline comments on items of iterable values are also extracted.
"""
self.comments = {
'above' : {}, # comments for a particular parameter definition
'header' : [], # header comment lines
'inline' : {}, # inline comments
'above': {}, # comments for a particular parameter definition
'header': [], # header comment lines
'inline': {}, # inline comments
'iter': {}, # (inline) comments on elements of iterable values
'tail': [],
}
Expand Down Expand Up @@ -410,7 +412,7 @@ def retrieve_blocks_in_spec(spec, only_blocks, silent=False):

if 'dependencies' in block:
for dep in block['dependencies']:
if not dep in [b['name'] for b in blocks]:
if dep not in [b['name'] for b in blocks]:
raise EasyBuildError("Block %s depends on %s, but block was not found.", name, dep)

dep = [b for b in blocks if b['name'] == dep][0]
Expand Down
28 changes: 14 additions & 14 deletions easybuild/framework/easyconfig/templates.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,23 +80,23 @@
# constant templates that can be used in easyconfigs
TEMPLATE_CONSTANTS = [
# source url constants
('APACHE_SOURCE', 'http://archive.apache.org/dist/%(namelower)s',
('APACHE_SOURCE', 'https://archive.apache.org/dist/%(namelower)s',
'apache.org source url'),
('BITBUCKET_SOURCE', 'http://bitbucket.org/%(bitbucket_account)s/%(namelower)s/get',
('BITBUCKET_SOURCE', 'https://bitbucket.org/%(bitbucket_account)s/%(namelower)s/get',
'bitbucket.org source url (namelower is used if bitbucket_account easyconfig parameter is not specified)'),
('BITBUCKET_DOWNLOADS', 'http://bitbucket.org/%(bitbucket_account)s/%(namelower)s/downloads',
('BITBUCKET_DOWNLOADS', 'https://bitbucket.org/%(bitbucket_account)s/%(namelower)s/downloads',
'bitbucket.org downloads url (namelower is used if bitbucket_account easyconfig parameter is not specified)'),
('CRAN_SOURCE', 'http://cran.r-project.org/src/contrib',
('CRAN_SOURCE', 'https://cran.r-project.org/src/contrib',
'CRAN (contrib) source url'),
('FTPGNOME_SOURCE', 'http://ftp.gnome.org/pub/GNOME/sources/%(namelower)s/%(version_major_minor)s',
('FTPGNOME_SOURCE', 'https://ftp.gnome.org/pub/GNOME/sources/%(namelower)s/%(version_major_minor)s',
'http download for gnome ftp server'),
('GITHUB_SOURCE', 'https://github.com/%(github_account)s/%(name)s/archive',
'GitHub source URL (namelower is used if github_account easyconfig parameter is not specified)'),
('GITHUB_LOWER_SOURCE', 'https://github.com/%(github_account)s/%(namelower)s/archive',
'GitHub source URL (lowercase name, namelower is used if github_account easyconfig parameter is not specified)'),
('GNU_SAVANNAH_SOURCE', 'http://download-mirror.savannah.gnu.org/releases/%(namelower)s',
('GNU_SAVANNAH_SOURCE', 'https://download-mirror.savannah.gnu.org/releases/%(namelower)s',
'download.savannah.gnu.org source url'),
('GNU_SOURCE', 'http://ftpmirror.gnu.org/gnu/%(namelower)s',
('GNU_SOURCE', 'https://ftpmirror.gnu.org/gnu/%(namelower)s',
'gnu.org source url'),
('GOOGLECODE_SOURCE', 'http://%(namelower)s.googlecode.com/files',
'googlecode.com source url'),
Expand All @@ -106,19 +106,19 @@
'pypi source url'), # e.g., Cython, Sphinx
('PYPI_LOWER_SOURCE', 'https://pypi.python.org/packages/source/%(nameletterlower)s/%(namelower)s',
'pypi source url (lowercase name)'), # e.g., Greenlet, PyZMQ
('R_SOURCE', 'http://cran.r-project.org/src/base/R-%(version_major)s',
('R_SOURCE', 'https://cran.r-project.org/src/base/R-%(version_major)s',
'cran.r-project.org (base) source url'),
('SOURCEFORGE_SOURCE', 'http://download.sourceforge.net/%(namelower)s',
('SOURCEFORGE_SOURCE', 'https://download.sourceforge.net/%(namelower)s',
'sourceforge.net source url'),
('XORG_DATA_SOURCE', 'http://xorg.freedesktop.org/archive/individual/data/',
('XORG_DATA_SOURCE', 'https://xorg.freedesktop.org/archive/individual/data/',
'xorg data source url'),
('XORG_LIB_SOURCE', 'http://xorg.freedesktop.org/archive/individual/lib/',
('XORG_LIB_SOURCE', 'https://xorg.freedesktop.org/archive/individual/lib/',
'xorg lib source url'),
('XORG_PROTO_SOURCE', 'http://xorg.freedesktop.org/archive/individual/proto/',
('XORG_PROTO_SOURCE', 'https://xorg.freedesktop.org/archive/individual/proto/',
'xorg proto source url'),
('XORG_UTIL_SOURCE', 'http://xorg.freedesktop.org/archive/individual/util/',
('XORG_UTIL_SOURCE', 'https://xorg.freedesktop.org/archive/individual/util/',
'xorg util source url'),
('XORG_XCB_SOURCE', 'http://xorg.freedesktop.org/archive/individual/xcb/',
('XORG_XCB_SOURCE', 'https://xorg.freedesktop.org/archive/individual/xcb/',
'xorg xcb source url'),

# TODO, not urgent, yet nice to have:
Expand Down
Loading