diff --git a/coveo_stew/metadata/poetry_api.py b/coveo_stew/metadata/poetry_api.py index cf935f3..9c0181a 100644 --- a/coveo_stew/metadata/poetry_api.py +++ b/coveo_stew/metadata/poetry_api.py @@ -55,6 +55,7 @@ def __init__( dependencies: Mapping[str, Any] = None, dev_dependencies: Mapping[str, Any] = None, group: Mapping[str, Any] = None, + package_mode: bool = True, **extra: Any, ) -> None: self.name: Final[str] = name @@ -62,6 +63,7 @@ def __init__( self.authors: Final[Iterable[str]] = authors self.version: Final[str] = version self.description: Final[str] = description + self.package_mode: Final[bool] = package_mode deps = dependencies_factory(dependencies) dev_deps = dependencies_factory(dev_dependencies) diff --git a/coveo_stew/offline_publish.py b/coveo_stew/offline_publish.py index bf023cb..e99eba1 100644 --- a/coveo_stew/offline_publish.py +++ b/coveo_stew/offline_publish.py @@ -80,8 +80,10 @@ def perform_offline_install(self, *, quiet: bool = False) -> None: if not self.project.lock_path.exists(): raise LockNotFound("Project isn't locked; can't proceed.") - # build the wheels for the current project - self.project.build(self.wheelhouse) + # build the wheels for the current project unless `package-mode: false` is specified. + # ref: https://python-poetry.org/docs/basic-usage/#operating-modes + if self.project.package.package_mode: + self.project.build(self.wheelhouse) self._store_setup_dependencies_in_wheelhouse() self._store_dependencies_in_wheelhouse()