Skip to content

Commit

Permalink
deprecate poetry.core.masonry.builder (not a core functionality, on…
Browse files Browse the repository at this point in the history
…ly used in `poetry build`) (#682)
  • Loading branch information
radoering authored Jan 27, 2024
1 parent 5639997 commit e2a3b85
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 1 deletion.
10 changes: 10 additions & 0 deletions src/poetry/core/masonry/builder.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
from __future__ import annotations

import warnings

from typing import TYPE_CHECKING


Expand All @@ -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
Expand Down
7 changes: 6 additions & 1 deletion tests/masonry/test_builder.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import shutil
import warnings

from contextlib import contextmanager
from pathlib import Path
Expand All @@ -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:
Expand Down

0 comments on commit e2a3b85

Please sign in to comment.