diff --git a/src/nox_poetry/sessions.py b/src/nox_poetry/sessions.py index 7214cc1e..7bcc6cfb 100644 --- a/src/nox_poetry/sessions.py +++ b/src/nox_poetry/sessions.py @@ -98,7 +98,7 @@ def install(self, *args: str, **kwargs: Any) -> None: args_extras = [_split_extras(arg) for arg in args] if "." in [arg for arg, _ in args_extras]: - package = self.build_package(distribution_format=DistributionFormat.WHEEL) + package = self.build_package() def rewrite(arg: str, extras: Optional[str]) -> str: if arg != ".": @@ -120,7 +120,7 @@ def rewrite(arg: str, extras: Optional[str]) -> str: def installroot( self, *, - distribution_format: str, + distribution_format: str = DistributionFormat.WHEEL, extras: Iterable[str] = (), ) -> None: """Install the root package into a Nox session using Poetry. @@ -184,7 +184,9 @@ def export_requirements(self) -> Path: return path - def build_package(self, *, distribution_format: str) -> str: + def build_package( + self, *, distribution_format: str = DistributionFormat.WHEEL + ) -> str: """Build a distribution archive for the package. This function uses `poetry build`_ to build a wheel or sdist archive for diff --git a/src/nox_poetry/sessions.pyi b/src/nox_poetry/sessions.pyi index e0f187a3..c05fb848 100644 --- a/src/nox_poetry/sessions.pyi +++ b/src/nox_poetry/sessions.pyi @@ -21,10 +21,10 @@ Python = Optional[Union[str, Sequence[str], bool]] class _PoetrySession: def install(self, *args: str, **kwargs: Any) -> None: ... def installroot( - self, *, distribution_format: str, extras: Iterable[str] = ... + self, *, distribution_format: str = ..., extras: Iterable[str] = ... ) -> None: ... def export_requirements(self) -> Path: ... - def build_package(self, *, distribution_format: str) -> str: ... + def build_package(self, *, distribution_format: str = ...) -> str: ... class Session: poetry: _PoetrySession