Skip to content

Commit

Permalink
Deprecate conda_build.environ.clean_pkg_cache (#5031)
Browse files Browse the repository at this point in the history
  • Loading branch information
kenodegard authored Oct 11, 2023
1 parent e8c935a commit d9bc44d
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 13 deletions.
13 changes: 0 additions & 13 deletions conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@
env_path_backup_var_exists,
get_conda_channel,
get_rc_urls,
pkgs_dirs,
prefix_placeholder,
reset_context,
root_dir,
Expand Down Expand Up @@ -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

Expand Down
2 changes: 2 additions & 0 deletions conda_build/environ.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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 = []

Expand Down
19 changes: 19 additions & 0 deletions news/5031-post-conda-5708-cleanup
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
### Enhancements

* Remove unnecessary cache clearing from `conda_buidl.build.test`. (#5031)

### Bug fixes

* <news item>

### Deprecations

* Mark `conda_build.environ.clean_pkg_cache` as pending deprecation. (#5031)

### Docs

* <news item>

### Other

* <news item>

0 comments on commit d9bc44d

Please sign in to comment.