Style fixes for v0.16.2 release
This commit is contained in:
parent
818664d55a
commit
80f0c78f00
8 changed files with 22 additions and 12 deletions
|
@ -198,7 +198,9 @@ def _raise_error(executable, exe_spec):
|
|||
def _bootstrap_config_scopes():
|
||||
tty.debug('[BOOTSTRAP CONFIG SCOPE] name=_builtin')
|
||||
config_scopes = [
|
||||
spack.config.InternalConfigScope('_builtin', spack.config.config_defaults)
|
||||
spack.config.InternalConfigScope(
|
||||
'_builtin', spack.config.config_defaults
|
||||
)
|
||||
]
|
||||
for name, path in spack.config.configuration_paths:
|
||||
platform = spack.architecture.platform().name
|
||||
|
|
|
@ -119,8 +119,8 @@ def location(parser, args):
|
|||
if args.build_dir:
|
||||
# Out of source builds have build_directory defined
|
||||
if hasattr(pkg, 'build_directory'):
|
||||
# build_directory can be either absolute or relative to the stage path
|
||||
# in either case os.path.join makes it absolute
|
||||
# build_directory can be either absolute or relative to the
|
||||
# stage path in either case os.path.join makes it absolute
|
||||
print(os.path.normpath(os.path.join(
|
||||
pkg.stage.path,
|
||||
pkg.build_directory
|
||||
|
|
|
@ -492,7 +492,9 @@ def target_ranges(self, spec, single_target_fn):
|
|||
|
||||
def conflict_rules(self, pkg):
|
||||
for trigger, constraints in pkg.conflicts.items():
|
||||
trigger_id = self.condition(spack.spec.Spec(trigger), name=pkg.name)
|
||||
trigger_id = self.condition(
|
||||
spack.spec.Spec(trigger), name=pkg.name
|
||||
)
|
||||
self.gen.fact(fn.conflict_trigger(trigger_id))
|
||||
|
||||
for constraint, _ in constraints:
|
||||
|
|
|
@ -258,7 +258,8 @@ def use_store(store_or_path):
|
|||
"""Use the store passed as argument within the context manager.
|
||||
|
||||
Args:
|
||||
store_or_path: either a Store object ot a path to where the store resides
|
||||
store_or_path: either a Store object ot a path to where the
|
||||
store resides
|
||||
|
||||
Returns:
|
||||
Store object associated with the context manager's store
|
||||
|
|
|
@ -39,7 +39,9 @@ def test_undevelop(tmpdir, config, mock_packages, mutable_mock_env_path):
|
|||
assert not after.satisfies('dev_path=*')
|
||||
|
||||
|
||||
def test_undevelop_nonexistent(tmpdir, config, mock_packages, mutable_mock_env_path):
|
||||
def test_undevelop_nonexistent(
|
||||
tmpdir, config, mock_packages, mutable_mock_env_path
|
||||
):
|
||||
# setup environment
|
||||
envdir = tmpdir.mkdir('env')
|
||||
with envdir.as_cwd():
|
||||
|
|
|
@ -943,7 +943,8 @@ def _source_single_file(file_and_args, environment):
|
|||
concatenate_on_success, dump_environment,
|
||||
])
|
||||
output = shell(
|
||||
source_file_arguments, output=str, env=environment, ignore_quotes=True
|
||||
source_file_arguments, output=str, env=environment,
|
||||
ignore_quotes=True
|
||||
)
|
||||
environment = json.loads(output)
|
||||
|
||||
|
|
|
@ -92,8 +92,8 @@ def __call__(self, *args, **kwargs):
|
|||
ignore_errors (int or list): A list of error codes to ignore.
|
||||
If these codes are returned, this process will not raise
|
||||
an exception even if ``fail_on_error`` is set to ``True``
|
||||
ignore_quotes (bool): If False, warn users that quotes are not needed
|
||||
as Spack does not use a shell. Defaults to False.
|
||||
ignore_quotes (bool): If False, warn users that quotes are not
|
||||
needed as Spack does not use a shell. Defaults to False.
|
||||
input: Where to read stdin from
|
||||
output: Where to send stdout
|
||||
error: Where to send stderr
|
||||
|
@ -168,12 +168,14 @@ def streamify(arg, mode):
|
|||
istream, close_istream = streamify(input, 'r')
|
||||
|
||||
if not ignore_quotes:
|
||||
quoted_args = [arg for arg in args if re.search(r'^"|^\'|"$|\'$', arg)]
|
||||
quoted_args = [
|
||||
arg for arg in args if re.search(r'^"|^\'|"$|\'$', arg)
|
||||
]
|
||||
if quoted_args:
|
||||
tty.warn(
|
||||
"Quotes in command arguments can confuse scripts like"
|
||||
" configure.",
|
||||
"The following arguments may cause problems when executed:",
|
||||
"These arguments may cause problems when executed:",
|
||||
str("\n".join([" " + arg for arg in quoted_args])),
|
||||
"Quotes aren't needed because spack doesn't use a shell. "
|
||||
"Consider removing them.",
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
# Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
|
||||
# Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
|
||||
# Spack Project Developers. See the top-level COPYRIGHT file for details.
|
||||
#
|
||||
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
|
||||
|
|
Loading…
Reference in a new issue