Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use wheel as default for installroot and build_package #265

Merged
merged 2 commits into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions src/nox_poetry/sessions.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 != ".":
Expand All @@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/nox_poetry/sessions.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down