Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard committed Oct 2, 2023
1 parent a7dd266 commit be7663c
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 18 deletions.
15 changes: 7 additions & 8 deletions conda_build/conda_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
from conda.auxlib.packaging import ( # noqa: F401
_get_version_from_git_tag as get_version_from_git_tag,
)
from conda.base.context import context, determine_target_prefix
from conda.base.context import context, determine_target_prefix, reset_context
from conda.base.context import non_x86_machines as non_x86_linux_machines # noqa: F401
from conda.base.context import reset_context
from conda.core.package_cache import ProgressiveFetchExtract # noqa: F401
from conda.exceptions import ( # noqa: F401
CondaError,
Expand All @@ -24,15 +23,12 @@
PaddingError,
UnsatisfiableError,
)
from conda.exports import ArgumentParser # noqa: F401
from conda.exports import CondaSession # noqa: F401
from conda.exports import EntityEncoder # noqa: F401
from conda.exports import VersionOrder # noqa: F401
from conda.exports import _toposort # noqa: F401
from conda.exports import get_index # noqa: F401
from conda.exports import ( # noqa: F401
ArgumentParser, # noqa: F401
Channel,
Completer,
CondaSession, # noqa: F401
EntityEncoder, # noqa: F401
FileMode,
InstalledPackages,
MatchSpec,
Expand All @@ -43,12 +39,15 @@
TemporaryDirectory,
TmpDownload,
Unsatisfiable,
VersionOrder, # noqa: F401
_toposort, # noqa: F401
add_parser_channels,
add_parser_prefix,
display_actions,
download,
execute_actions,
execute_plan,
get_index, # noqa: F401
handle_proxy_407,
hashsum_file,
human_bytes,
Expand Down
16 changes: 10 additions & 6 deletions conda_build/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -1752,18 +1752,20 @@ def has_prefix_files(self):

def ignore_prefix_files(self):
ret = self.get_value("build/ignore_prefix_files", False)
if type(ret) not in (list, bool):
if not isinstance(ret, (list, bool)):
raise RuntimeError(
"build/ignore_prefix_files should be boolean or a list of paths "
"(optionally globs)"
)
if sys.platform == "win32":
if type(ret) is list and any("\\" in i for i in ret):
if isinstance(ret, list) and any("\\" in i for i in ret):
raise RuntimeError(
"build/ignore_prefix_files paths must use / "
"as the path delimiter on Windows"
)
return expand_globs(ret, self.config.host_prefix) if type(ret) is list else ret
return (
expand_globs(ret, self.config.host_prefix) if isinstance(ret, list) else ret
)

def always_include_files(self):
files = ensure_list(self.get_value("build/always_include_files", []))
Expand All @@ -1782,18 +1784,20 @@ def ignore_verify_codes(self):

def binary_relocation(self):
ret = self.get_value("build/binary_relocation", True)
if type(ret) not in (list, bool):
if not isinstance(ret, (list, bool)):
raise RuntimeError(
"build/binary_relocation should be boolean or a list of paths "
"(optionally globs)"
)
if sys.platform == "win32":
if type(ret) is list and any("\\" in i for i in ret):
if isinstance(ret, list) and any("\\" in i for i in ret):
raise RuntimeError(
"build/binary_relocation paths must use / "
"as the path delimiter on Windows"
)
return expand_globs(ret, self.config.host_prefix) if type(ret) is list else ret
return (
expand_globs(ret, self.config.host_prefix) if isinstance(ret, list) else ret
)

def include_recipe(self):
return self.get_value("build/include_recipe", True)
Expand Down
8 changes: 4 additions & 4 deletions conda_build/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,15 @@
from conda_build.exceptions import BuildLockError # noqa
from conda_build.os_utils import external # noqa

from .conda_interface import Dist # noqa
from .conda_interface import StringIO # noqa
from .conda_interface import cc_conda_build # noqa
from .conda_interface import context # noqa
from .conda_interface import ( # noqa
CondaHTTPError,
Dist, # noqa
MatchSpec,
StringIO, # noqa
TemporaryDirectory,
VersionOrder,
cc_conda_build, # noqa
context, # noqa
download,
get_conda_channel,
hashsum_file,
Expand Down

0 comments on commit be7663c

Please sign in to comment.