summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
authorAdam J. Stewart <ajstewart426@gmail.com>2016-06-22 15:22:42 -0500
committerAdam J. Stewart <ajstewart426@gmail.com>2016-06-22 15:22:42 -0500
commitd566510a400e1067b8662dfdb00d3d3ec7e43b2f (patch)
tree81fd2e81ff567f6935c90aa70155a4f0d34f9f26 /var
parent3f4bf04dde0b28425f7de5642c7211799bda8264 (diff)
downloadspack-d566510a400e1067b8662dfdb00d3d3ec7e43b2f.tar.gz
spack-d566510a400e1067b8662dfdb00d3d3ec7e43b2f.tar.bz2
spack-d566510a400e1067b8662dfdb00d3d3ec7e43b2f.tar.xz
spack-d566510a400e1067b8662dfdb00d3d3ec7e43b2f.zip
Flake8 and url_for_version fixes
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/hdf5/package.py27
1 files changed, 17 insertions, 10 deletions
diff --git a/var/spack/repos/builtin/packages/hdf5/package.py b/var/spack/repos/builtin/packages/hdf5/package.py
index 74fc006fe9..51a5823aa5 100644
--- a/var/spack/repos/builtin/packages/hdf5/package.py
+++ b/var/spack/repos/builtin/packages/hdf5/package.py
@@ -70,7 +70,8 @@ class Hdf5(Package):
raise RuntimeError(msg)
if '+threadsafe' in spec and ('+cxx' in spec or '+fortran' in spec):
- raise RuntimeError("cannot use variant +threadsafe with either +cxx or +fortran")
+ msg = 'cannot use variant +threadsafe with either +cxx or +fortran'
+ raise RuntimeError(msg)
def install(self, spec, prefix):
self.validate(spec)
@@ -185,24 +186,30 @@ HDF5 version {version} {version}
if not success:
print "Produced output does not match expected output."
print "Expected output:"
- print '-'*80
+ print '-' * 80
print expected
- print '-'*80
+ print '-' * 80
print "Produced output:"
- print '-'*80
+ print '-' * 80
print output
- print '-'*80
+ print '-' * 80
raise RuntimeError("HDF5 install check failed")
shutil.rmtree(checkdir)
def url_for_version(self, version):
- v = str(version)
+ base_url = "http://www.hdfgroup.org/ftp/HDF5/releases"
if version == Version("1.2.2"):
- return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + v + ".tar.gz"
+ return "{0}/hdf5-{1}.tar.gz".format(base_url, version)
+ elif version < Version("1.6.6"):
+ return "{0}/hdf5-{1}/hdf5-{2}.tar.gz".format(
+ base_url, version.up_to(2), version)
elif version < Version("1.7"):
- return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + version.up_to(2) + "/hdf5-" + v + ".tar.gz"
+ return "{0}/hdf5-{1}/hdf5-{2}/src/hdf5-{2}.tar.gz".format(
+ base_url, version.up_to(2), version)
elif version < Version("1.10"):
- return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + v + "/src/hdf5-" + v + ".tar.gz"
+ return "{0}/hdf5-{1}/src/hdf5-{1}.tar.gz".format(
+ base_url, version)
else:
- return "http://www.hdfgroup.org/ftp/HDF5/releases/hdf5-" + version.up_to(2) + "/hdf5-" + v + "/src/hdf5-" + v + ".tar.gz"
+ return "{0}/hdf5-{1}/hdf5-{2}/src/hdf5-{2}.tar.gz".format(
+ base_url, version.up_to(2), version)