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

24.9 Removals #5441

Merged
merged 5 commits into from
Aug 6, 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
18 changes: 0 additions & 18 deletions conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,6 @@
CONDA_PACKAGE_EXTENSIONS,
env_var,
glob,
on_linux,
on_mac,
on_win,
shutil_move_more_retrying,
Expand Down Expand Up @@ -3583,23 +3582,6 @@ def tests_failed(
raise CondaBuildUserError("TESTS FAILED: " + os.path.basename(pkg))


@deprecated(
"24.7",
"24.9",
addendum="`patchelf` is an explicit conda-build dependency on Linux so it will always be installed.",
)
def check_external():
if on_linux:
patchelf = external.find_executable("patchelf")
if patchelf is None:
raise CondaBuildUserError(
f"Did not find 'patchelf' in: {os.pathsep.join(external.dir_paths)} "
f"'patchelf' is necessary for building conda packages on Linux with "
f"relocatable ELF libraries. You can install patchelf using conda install "
f"patchelf."
)


def build_tree(
recipe_list: Iterable[str | MetaData],
config: Config,
Expand Down
2 changes: 1 addition & 1 deletion conda_build/deprecations.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def constant(

def __getattr__(name: str) -> Any:
if name == constant:
warnings.warn(message, category, stacklevel=2 + stack)
warnings.warn(message, category, stacklevel=3 + stack)
return value

if super_getattr:
Expand Down
15 changes: 2 additions & 13 deletions conda_build/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@

from . import utils
from .config import Config, get_or_merge_config
from .deprecations import deprecated
from .exceptions import (
CondaBuildException,
CondaBuildUserError,
Expand Down Expand Up @@ -55,7 +54,6 @@
)

if TYPE_CHECKING:
from pathlib import Path
from typing import Any, Literal, Self

OutputDict = dict[str, Any]
Expand Down Expand Up @@ -855,21 +853,12 @@ def build_string_from_metadata(metadata):
return build_str


@deprecated(
"24.7", "24.9", addendum="Use `conda.base.context.locate_prefix_by_name` instead."
)
def _get_env_path(
env_name_or_path: str | os.PathLike | Path,
) -> str | os.PathLike | Path:
return (
def _get_dependencies_from_environment(env_name_or_path):
path = (
env_name_or_path
if isdir(env_name_or_path)
else locate_prefix_by_name(env_name_or_path)
)


def _get_dependencies_from_environment(env_name_or_path):
path = _get_env_path(env_name_or_path)
# construct build requirements that replicate the given bootstrap environment
# and concatenate them to the build requirements from the recipe
bootstrap_metadata = get_installed_packages(path)
Expand Down
20 changes: 20 additions & 0 deletions news/5441-24.9-removals
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
### Enhancements

* <news item>

### Bug fixes

* <news item>

### Deprecations

* Remove `conda_build.build.check_external`. `patchelf` is an explicit conda-build dependency on Linux so it will always be installed. (#5441)
* Remove `conda_build.metadata._get_env_path`. Use `conda.base.context.locate_prefix_by_name` instead. (#5441)

### Docs

* <news item>

### Other

* <news item>
17 changes: 1 addition & 16 deletions tests/test_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from typing import TYPE_CHECKING

import pytest
from conda.common.compat import on_linux, on_win
from conda.common.compat import on_win

from conda_build import api, build
from conda_build.exceptions import CondaBuildUserError
Expand Down Expand Up @@ -338,21 +338,6 @@ def test_guess_interpreter(
assert build.guess_interpreter(script) == interpreter


def test_check_external():
with pytest.deprecated_call():
build.check_external()


@pytest.mark.skipif(not on_linux, reason="pathelf is only available on Linux")
def test_check_external_user_error(mocker: MockerFixture) -> None:
mocker.patch(
"conda_build.os_utils.external.find_executable",
return_value=None,
)
with pytest.raises(CondaBuildUserError):
build.check_external()


@pytest.mark.parametrize("readme", ["README.md", "README.rst", "README"])
def test_copy_readme(testing_metadata: MetaData, readme: str):
testing_metadata.meta["about"]["readme"] = readme
Expand Down
Loading