diff --git a/src/poetry/core/masonry/builders/builder.py b/src/poetry/core/masonry/builders/builder.py index cf41ad5d7..c9d7b1f0f 100644 --- a/src/poetry/core/masonry/builders/builder.py +++ b/src/poetry/core/masonry/builders/builder.py @@ -58,11 +58,7 @@ def __init__( if not isinstance(formats, list): formats = [formats] - if ( - formats - and self.format - and self.format not in formats - ): + if formats and self.format and self.format not in formats: continue packages.append(p) @@ -71,11 +67,7 @@ def __init__( for include in self._package.include: formats = include.get("format", []) - if ( - formats - and self.format - and self.format not in formats - ): + if formats and self.format and self.format not in formats: continue includes.append(include) diff --git a/src/poetry/core/masonry/builders/sdist.py b/src/poetry/core/masonry/builders/sdist.py index ef5f99fd1..036d532be 100644 --- a/src/poetry/core/masonry/builders/sdist.py +++ b/src/poetry/core/masonry/builders/sdist.py @@ -13,8 +13,8 @@ from pprint import pformat from tarfile import TarInfo from typing import TYPE_CHECKING -from typing import Iterator from typing import Dict +from typing import Iterator from typing import List from typing import Optional from typing import Set @@ -63,7 +63,7 @@ def __init__( self, poetry: "Poetry", executable: Optional[Path] = None, - target_dir: Optional[Path] = None + target_dir: Optional[Path] = None, ) -> None: super().__init__(poetry, executable=executable) self._target_dir = target_dir @@ -243,7 +243,9 @@ def setup_py(self) -> Iterator[Path]: def build_pkg_info(self) -> bytes: return self.get_metadata_content().encode() - def find_packages(self, include: "PackageInclude") -> Tuple[Optional[str], List[str], Dict[str, List[str]]]: + def find_packages( + self, include: "PackageInclude" + ) -> Tuple[Optional[str], List[str], Dict[str, List[str]]]: """ Discover subpackages and data.