diff --git a/conda_build/build.py b/conda_build/build.py index fa62a238d3..1d66cf114f 100644 --- a/conda_build/build.py +++ b/conda_build/build.py @@ -75,7 +75,6 @@ env_path_backup_var_exists, get_conda_channel, get_rc_urls, - pkgs_dirs, prefix_placeholder, reset_context, root_dir, @@ -3420,18 +3419,6 @@ def test( # folder destination _extract_test_files_from_package(metadata) - # When testing a .tar.bz2 in the pkgs dir, clean_pkg_cache() will remove it. - # Prevent this. When https://github.com/conda/conda/issues/5708 gets fixed - # I think we can remove this call to clean_pkg_cache(). - in_pkg_cache = ( - not hasattr(recipedir_or_package_or_metadata, "config") - and os.path.isfile(recipedir_or_package_or_metadata) - and recipedir_or_package_or_metadata.endswith(CONDA_PACKAGE_EXTENSIONS) - and os.path.dirname(recipedir_or_package_or_metadata) in pkgs_dirs[0] - ) - if not in_pkg_cache: - environ.clean_pkg_cache(metadata.dist(), metadata.config) - copy_test_source_files(metadata, metadata.config.test_dir) # this is also copying tests/source_files from work_dir to testing workdir diff --git a/conda_build/environ.py b/conda_build/environ.py index 7ef1b2a33d..5afcf93c4d 100644 --- a/conda_build/environ.py +++ b/conda_build/environ.py @@ -41,6 +41,7 @@ reset_context, root_dir, ) +from .deprecations import deprecated # these are things that we provide env vars for more explicitly. This list disables the # pass-through of variant values to env vars for these keys. @@ -1214,6 +1215,7 @@ def remove_existing_packages(dirs, fns, config): utils.rm_rf(entry) +@deprecated("3.28.0", "4.0.0") def clean_pkg_cache(dist, config): locks = [] diff --git a/news/5031-post-conda-5708-cleanup b/news/5031-post-conda-5708-cleanup new file mode 100644 index 0000000000..f698066c97 --- /dev/null +++ b/news/5031-post-conda-5708-cleanup @@ -0,0 +1,19 @@ +### Enhancements + +* Remove unnecessary cache clearing from `conda_buidl.build.test`. (#5031) + +### Bug fixes + +* + +### Deprecations + +* Mark `conda_build.environ.clean_pkg_cache` as pending deprecation. (#5031) + +### Docs + +* + +### Other + +*