Skip to content

Commit

Permalink
Remove string concatenations
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard committed Nov 1, 2023
1 parent 533d268 commit a5235c4
Show file tree
Hide file tree
Showing 11 changed files with 14 additions and 17 deletions.
6 changes: 3 additions & 3 deletions conda_build/_load_setup_py_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,18 +140,18 @@ def setup(**kw):
parser.add_argument("setup_file", help="path or filename of setup.py file")
parser.add_argument(
"--from-recipe-dir",
help=("look for setup.py file in recipe " "dir (as opposed to work dir)"),
help="look for setup.py file in recipe dir (as opposed to work dir)",
default=False,
action="store_true",
)
parser.add_argument(
"--recipe-dir",
help=("(optional) path to recipe dir, where " "setup.py should be found"),
help="(optional) path to recipe dir, where setup.py should be found",
)

parser.add_argument(
"--permit-undefined-jinja",
help=("look for setup.py file in recipe " "dir (as opposed to work dir)"),
help="look for setup.py file in recipe dir (as opposed to work dir)",
default=False,
action="store_true",
)
Expand Down
2 changes: 1 addition & 1 deletion conda_build/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ def convert(
)
elif package_file.endswith(".whl"):
raise RuntimeError(
"Conversion from wheel packages is not " "implemented yet, stay tuned."
"Conversion from wheel packages is not implemented yet, stay tuned."
)
else:
raise RuntimeError("cannot convert: %s" % package_file)
Expand Down
2 changes: 1 addition & 1 deletion conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -4090,7 +4090,7 @@ def handle_anaconda_upload(paths, config):
prompter = "$ "
if not upload or anaconda is None:
no_upload_message = (
"# If you want to upload package(s) to anaconda.org later, type:\n" "\n"
"# If you want to upload package(s) to anaconda.org later, type:\n\n"
)
no_upload_message += (
"\n"
Expand Down
2 changes: 1 addition & 1 deletion conda_build/cli/main_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,7 @@ def parse_args(args):
)
p.add_argument(
"--stats-file",
help=("File path to save build statistics to. Stats are " "in JSON format"),
help="File path to save build statistics to. Stats are in JSON format",
)
p.add_argument(
"--extra-deps",
Expand Down
2 changes: 1 addition & 1 deletion conda_build/cli/main_render.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def get_render_parser():
p.add_argument(
"--output",
action="store_true",
help="Output the conda package filename which would have been " "created",
help="Output the conda package filename which would have been created",
)
p.add_argument(
"--python",
Expand Down
4 changes: 2 additions & 2 deletions conda_build/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -868,11 +868,11 @@ def clean(self, remove_folders=True):
rm_rf(os.path.join(self.build_folder, "prefix_files"))
else:
print(
"\nLeaving build/test directories:" "\n Work:\n",
"\nLeaving build/test directories:\n Work:\n",
self.work_dir,
"\n Test:\n",
self.test_dir,
"\nLeaving build/test environments:" "\n Test:\nsource activate ",
"\nLeaving build/test environments:\n Test:\nsource activate ",
self.test_prefix,
"\n Build:\nsource activate ",
self.build_prefix,
Expand Down
2 changes: 1 addition & 1 deletion conda_build/inspect_pkg.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ def inspect_linkages(
if len(deps) > 1:
deps_str = [str(dep) for dep in deps]
get_logger(__name__).warn(
"Warning: %s comes from multiple " "packages: %s",
"Warning: %s comes from multiple packages: %s",
path,
comma_join(deps_str),
)
Expand Down
2 changes: 1 addition & 1 deletion conda_build/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ def ensure_valid_fields(meta):
pin_depends = meta.get("build", {}).get("pin_depends", "")
if pin_depends and pin_depends not in ("", "record", "strict"):
raise RuntimeError(
"build/pin_depends must be 'record' or 'strict' - " "not '%s'" % pin_depends
f"build/pin_depends must be 'record' or 'strict' - not '{pin_depends}'"
)


Expand Down
2 changes: 1 addition & 1 deletion conda_build/skeletons/cran.py
Original file line number Diff line number Diff line change
Expand Up @@ -387,7 +387,7 @@ def add_parser(repos):
"--use-noarch-generic",
action="store_true",
dest="use_noarch_generic",
help=("Mark packages that do not need compilation as `noarch: generic`"),
help="Mark packages that do not need compilation as `noarch: generic`",
)
cran.add_argument(
"--use-rtools-win",
Expand Down
5 changes: 1 addition & 4 deletions conda_build/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,6 @@ def directory_size_slow(path):


def directory_size(path):
""" """
try:
if on_win:
command = 'dir /s "{}"' # Windows path can have spaces
Expand Down Expand Up @@ -716,9 +715,7 @@ def merge_tree(
existing = [f for f in new_files if isfile(f)]

if existing and not clobber:
raise OSError(
"Can't merge {} into {}: file exists: " "{}".format(src, dst, existing[0])
)
raise OSError(f"Can't merge {src} into {dst}: file exists: {existing[0]}")

locks = []
if locking:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_api_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1398,7 +1398,7 @@ def test_recursion_layers(testing_config):
@pytest.mark.sanity
@pytest.mark.skipif(
sys.platform != "win32",
reason=("spaces break openssl prefix " "replacement on *nix"),
reason="spaces break openssl prefix replacement on *nix",
)
def test_croot_with_spaces(testing_metadata, testing_workdir):
testing_metadata.config.croot = os.path.join(testing_workdir, "space path")
Expand Down

0 comments on commit a5235c4

Please sign in to comment.