Skip to content

Commit

Permalink
apply review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
radoering committed Oct 12, 2024
1 parent a1b5458 commit acf37b4
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions src/poetry/core/masonry/builders/builder.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from functools import cached_property
from pathlib import Path
from typing import TYPE_CHECKING
from typing import Any


if TYPE_CHECKING:
Expand All @@ -28,12 +27,7 @@
class Builder:
format: str | None = None

def __init__(
self,
poetry: Poetry,
ignore_packages_formats: bool = False,
executable: Path | None = None,
) -> None:
def __init__(self, poetry: Poetry, executable: Path | None = None) -> None:
from poetry.core.masonry.metadata import Metadata

if not poetry.is_package_mode:
Expand All @@ -44,7 +38,6 @@ def __init__(
self._poetry = poetry
self._package = poetry.package
self._path: Path = poetry.pyproject_path.parent
self._ignore_packages_formats = ignore_packages_formats
self._excluded_files: set[str] | None = None
self._executable = Path(executable or sys.executable)
self._meta = Metadata.from_package(self._package)
Expand All @@ -53,8 +46,8 @@ def __init__(
def _module(self) -> Module:
from poetry.core.masonry.utils.module import Module

packages: list[dict[str, Any]] = []
includes: list[dict[str, Any]] = []
packages: list[dict[str, str | dict[str, str]]] = []
includes: list[dict[str, str | dict[str, str]]] = []
for source_list, target_list, default in [
(self._package.packages, packages, ["sdist", "wheel"]),
(self._package.include, includes, ["sdist"]),
Expand All @@ -66,11 +59,7 @@ def _module(self) -> Module:
if not isinstance(formats, list):
formats = [formats]

if (
self.format
and self.format not in formats
and not self._ignore_packages_formats
):
if self.format and self.format not in formats:
continue

target_list.append({**item, "format": formats})
Expand Down

0 comments on commit acf37b4

Please sign in to comment.