From e3e0f6a6af8bdb82c9ab3f237872ad844bbf9b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Randy=20D=C3=B6ring?= <30527984+radoering@users.noreply.github.com> Date: Sun, 14 Jan 2024 11:31:10 +0100 Subject: [PATCH] deprecate `poetry.core.masonry.builder` (not a core functionality, only used in `poetry build`) --- src/poetry/core/masonry/builder.py | 10 ++++++++++ tests/masonry/test_builder.py | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/src/poetry/core/masonry/builder.py b/src/poetry/core/masonry/builder.py index d31ce627d..ed9e78f6e 100644 --- a/src/poetry/core/masonry/builder.py +++ b/src/poetry/core/masonry/builder.py @@ -1,5 +1,7 @@ from __future__ import annotations +import warnings + from typing import TYPE_CHECKING @@ -9,6 +11,14 @@ from poetry.core.poetry import Poetry +warnings.warn( + "poetry.core.masonry.builder is deprecated. Its functionality has been moved" + "from poetry-core to poetry (poetry.console.commands.build).", + DeprecationWarning, + stacklevel=2, +) + + class Builder: def __init__(self, poetry: Poetry) -> None: from poetry.core.masonry.builders.sdist import SdistBuilder diff --git a/tests/masonry/test_builder.py b/tests/masonry/test_builder.py index 69822d35a..e6495f9dd 100644 --- a/tests/masonry/test_builder.py +++ b/tests/masonry/test_builder.py @@ -1,6 +1,7 @@ from __future__ import annotations import shutil +import warnings from contextlib import contextmanager from pathlib import Path @@ -10,7 +11,11 @@ import pytest from poetry.core.factory import Factory -from poetry.core.masonry.builder import Builder + + +with warnings.catch_warnings(): + warnings.filterwarnings("ignore", category=DeprecationWarning) + from poetry.core.masonry.builder import Builder if TYPE_CHECKING: