Skip to content

Commit

Permalink
Remove more changes ported over from conda#5402
Browse files Browse the repository at this point in the history
  • Loading branch information
beeankha committed Jul 11, 2024
1 parent 4baf293 commit 63daddf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 15 deletions.
1 change: 0 additions & 1 deletion conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -1647,7 +1647,6 @@ def post_process_files(m: MetaData, initial_prefix_files):
# The post processing may have deleted some files (like easy-install.pth)
current_prefix_files = utils.prefix_files(prefix=host_prefix)
new_files = sorted(current_prefix_files - initial_prefix_files)

"""
if m.noarch == 'python' and m.config.subdir == 'win-32':
# Delete any PIP-created .exe launchers and fix entry_points.txt
Expand Down
21 changes: 7 additions & 14 deletions conda_build/os_utils/external.py
Original file line number Diff line number Diff line change
@@ -1,56 +1,49 @@
# Copyright (C) 2014 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause

from __future__ import annotations

import os
import stat
from glob import glob
from os.path import expanduser, isfile, join

from conda.base.context import context

from ..deprecations import deprecated
from ..utils import on_win

_DIR_PATHS: list[str] = []
deprecated.constant("24.7", "24.9", "dir_paths", _DIR_PATHS)


def find_executable(executable, prefix=None, all_matches=False):
# dir_paths is referenced as a module-level variable
# in other code
global _DIR_PATHS
global dir_paths
result = None
if on_win:
_DIR_PATHS = [
dir_paths = [
join(context.root_prefix, "Scripts"),
join(context.root_prefix, "Library\\mingw-w64\\bin"),
join(context.root_prefix, "Library\\usr\\bin"),
join(context.root_prefix, "Library\\bin"),
]
if prefix:
_DIR_PATHS[0:0] = [
dir_paths[0:0] = [
join(prefix, "Scripts"),
join(prefix, "Library\\mingw-w64\\bin"),
join(prefix, "Library\\usr\\bin"),
join(prefix, "Library\\bin"),
]
else:
_DIR_PATHS = [
dir_paths = [
join(context.root_prefix, "bin"),
]
if prefix:
_DIR_PATHS.insert(0, join(prefix, "bin"))
dir_paths.insert(0, join(prefix, "bin"))

_DIR_PATHS.extend(os.environ["PATH"].split(os.pathsep))
dir_paths.extend(os.environ["PATH"].split(os.pathsep))
if on_win:
exts = (".exe", ".bat", "")
else:
exts = ("",)

all_matches_found = []
for dir_path in _DIR_PATHS:
for dir_path in dir_paths:
for ext in exts:
path = expanduser(join(dir_path, executable + ext))
if isfile(path):
Expand Down

0 comments on commit 63daddf

Please sign in to comment.