Skip to content

Commit 5f993d0

Browse files
committed
pep8 fixes
1 parent 47485f2 commit 5f993d0

File tree

3 files changed

+16
-13
lines changed

3 files changed

+16
-13
lines changed

lib/spack/spack/binary_distribution.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# "Patrick Gartung (FNAL)"
33

44
import os
5+
import re
56
import platform
67
import tarfile
78
import yaml
@@ -17,8 +18,6 @@
1718
import spack.fetch_strategy as fs
1819
import spack.relocate
1920
from contextlib import closing
20-
import platform
21-
import re
2221

2322

2423
def prepare():
@@ -175,8 +174,8 @@ def build_tarball(spec, outdir, force=False, rel=False, key=None):
175174
# Sign the packages.
176175
# spack gpg sign [--key key] tarfile_path
177176
# spack gpg sign [--key key] tarfile_path + '/spec.yaml'
178-
# if key == None:
179-
# keys = Gpg.signing_keys()
177+
if key == None:
178+
keys = Gpg.signing_keys()
180179
# if len(keys) == 1:
181180
# key = keys[0]
182181
# elif not keys:
@@ -255,10 +254,10 @@ def extract_tarball(spec, filename):
255254
with closing(tarfile.open(tarfile_path, 'r')) as tar:
256255
tar.extractall(path=join_path(installpath, '..'))
257256

258-
# os.remove(tarfile_path)
259-
#os.remove(tarfile_path + '.asc')
260-
# os.remove(specfile_path)
261-
#os.remove(specfile_path + '.asc')
257+
#os.remove(tarfile_path)
258+
os.remove(tarfile_path + '.asc')
259+
#os.remove(specfile_path)
260+
os.remove(specfile_path + '.asc')
262261

263262

264263
def prelocate_package(spec):

lib/spack/spack/cmd/buildcache.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def setup_parser(subparser):
4444

4545
create = subparsers.add_parser('create')
4646
create.add_argument('-r', '--rel', action='store_true',
47-
help="make all rpaths relative before creating tarballs.")
47+
help="make all rpaths relative" +
48+
" before creating tarballs.")
4849
create.add_argument('-f', '--force', action='store_true',
4950
help="overwrite tarball if it exists.")
5051
create.add_argument('-d', '--directory', metavar='directory',
@@ -143,8 +144,9 @@ def listspecs(args):
143144
tty.msg("buildcache spec(s) matching %s \n" % pkg)
144145
for spec in sorted(specs):
145146
if re.search("^" + re.escape(pkg), str(spec)):
146-
tty.msg('run "spack buildcache install /%s" to install %s\n' %
147-
(spec.dag_hash(7), spec.format()))
147+
tty.msg('run "spack buildcache install /%s"' %
148+
spec.dag_hash(7) + ' to install %s\n' %
149+
spec.format())
148150
else:
149151
tty.msg("buildcache specs ")
150152
for spec in sorted(specs):

lib/spack/spack/relocate.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def get_relative_rpaths(path_name, orig_dir, orig_rpaths):
3737
rel_rpaths.add(rpath)
3838
return rel_rpaths
3939

40+
4041
def modify_macho_object(path_name, old_dir, new_dir, relative):
4142
"""
4243
Modify MachO binaries by changing rpaths,and id and dependency lib paths.
@@ -96,8 +97,8 @@ def modify_macho_object(path_name, old_dir, new_dir, relative):
9697
if relative:
9798
id = '@rpath/%s' % os.path.basename(idpath)
9899
for rpath in rpaths:
99-
if re.match(old_dir,rpath):
100-
rel=os.path.relpath(rpath,start=os.path.dirname(path_name))
100+
if re.match(old_dir, rpath):
101+
rel = os.path.relpath(rpath, start=os.path.dirname(path_name))
101102
nrpaths.append('@loader_path/%s' % rel)
102103
else:
103104
nrpaths.append(rpath)
@@ -214,6 +215,7 @@ def relocate_binary(path_name, old_dir, new_dir, patchelf_executable):
214215
else:
215216
tty.die("Relocation not implemented for %s" % platform.system())
216217

218+
217219
def prelocate_binary(path_name, old_dir, patchelf_executable):
218220
"""
219221
Change RPATHs in given elf or mach-o file to relative

0 commit comments

Comments
 (0)