Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate unused conda_build.build.have_prefix_files #5199

Merged
merged 3 commits into from
Feb 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>
Loading