Skip to content

Commit

Permalink
Deprecate unused conda_build.build.have_prefix_files (#5199)
Browse files Browse the repository at this point in the history
Co-authored-by: Jannis Leidel <jannis@leidel.info>
Co-authored-by: Bianca Henderson <beeankha@gmail.com>
  • Loading branch information
3 people committed Feb 27, 2024
1 parent cc7bb53 commit 9b04330
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 25 deletions.
27 changes: 2 additions & 25 deletions conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
)
from .config import Config
from .create_test import create_all_test_files
from .deprecations import deprecated
from .exceptions import CondaBuildException, DependencyNeedsBuildingError
from .index import _delegated_update_index, get_build_index
from .metadata import FIELDS, MetaData
Expand Down Expand Up @@ -184,6 +185,7 @@ def prefix_replacement_excluded(path):
return False


@deprecated("24.3", "24.5")
def have_prefix_files(files, prefix):
"""
Yields files that contain the current prefix in them, and modifies them
Expand Down Expand Up @@ -1231,31 +1233,6 @@ def get_files_with_prefix(m, replacements, files_in, prefix):
end - start,
)
)
"""
# Keeping this around just for a while.
files_with_prefix2 = sorted(have_prefix_files(files_in, prefix))
end = time.time()
print("INFO :: Time taken to do replacements (prefix only) was: {}".format(end - start))
ignore_files = m.ignore_prefix_files()
ignore_types = set()
if not hasattr(ignore_files, "__iter__"):
if ignore_files is True:
ignore_types.update((FileMode.text.name, FileMode.binary.name))
ignore_files = []
if (not m.get_value('build/detect_binary_files_with_prefix', True) and
not m.get_value('build/binary_has_prefix_files', None)):
ignore_types.update((FileMode.binary.name,))
# files_with_prefix is a list of tuples containing (prefix_placeholder, file_type, file_path)
ignore_files.extend(
f[2] for f in files_with_prefix2 if f[1] in ignore_types and f[2] not in ignore_files)
files_with_prefix2 = [f for f in files_with_prefix2 if f[2] not in ignore_files]
end2 = time.time()
print("INFO :: Time taken to do replacements (prefix only) was: {}".format(end2 - start2))
files1 = set([f for _, _, f in files_with_prefix])
files2 = set([f for _, _, f in files_with_prefix2])
assert not (files2 - files1), "New ripgrep prefix search missed the following files:\n{}\n".format(files2 - files1)
"""
return sorted(files_with_prefix)


Expand Down
19 changes: 19 additions & 0 deletions news/5199-deprecate-have_prefix_files
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* <news item>

### Bug fixes

* <news item>

### Deprecations

* Mark `conda_build.build.have_prefix_files` as deprecated. (#5199)

### Docs

* <news item>

### Other

* <news item>

0 comments on commit 9b04330

Please sign in to comment.