77from functools import cached_property
88from pathlib import Path
99from typing import TYPE_CHECKING
10- from typing import Any
1110
1211
1312if TYPE_CHECKING :
2827class Builder :
2928 format : str | None = None
3029
31- def __init__ (
32- self ,
33- poetry : Poetry ,
34- ignore_packages_formats : bool = False ,
35- executable : Path | None = None ,
36- ) -> None :
30+ def __init__ (self , poetry : Poetry , executable : Path | None = None ) -> None :
3731 from poetry .core .masonry .metadata import Metadata
3832
3933 if not poetry .is_package_mode :
@@ -44,7 +38,6 @@ def __init__(
4438 self ._poetry = poetry
4539 self ._package = poetry .package
4640 self ._path : Path = poetry .pyproject_path .parent
47- self ._ignore_packages_formats = ignore_packages_formats
4841 self ._excluded_files : set [str ] | None = None
4942 self ._executable = Path (executable or sys .executable )
5043 self ._meta = Metadata .from_package (self ._package )
@@ -53,8 +46,8 @@ def __init__(
5346 def _module (self ) -> Module :
5447 from poetry .core .masonry .utils .module import Module
5548
56- packages : list [dict [str , Any ]] = []
57- includes : list [dict [str , Any ]] = []
49+ packages : list [dict [str , str | dict [ str , str ] ]] = []
50+ includes : list [dict [str , str | dict [ str , str ] ]] = []
5851 for source_list , target_list , default in [
5952 (self ._package .packages , packages , ["sdist" , "wheel" ]),
6053 (self ._package .include , includes , ["sdist" ]),
@@ -66,11 +59,7 @@ def _module(self) -> Module:
6659 if not isinstance (formats , list ):
6760 formats = [formats ]
6861
69- if (
70- self .format
71- and self .format not in formats
72- and not self ._ignore_packages_formats
73- ):
62+ if self .format and self .format not in formats :
7463 continue
7564
7665 target_list .append ({** item , "format" : formats })
0 commit comments