Skip to content

Commit

Permalink
feat: allow stew build when package-mode is false
Browse files Browse the repository at this point in the history
  • Loading branch information
jonapich committed Dec 17, 2024
1 parent c9220ff commit b82ca3c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions coveo_stew/metadata/poetry_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,15 @@ 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
self.safe_name: Final[str] = name.replace("-", "_")
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)
Expand Down
6 changes: 4 additions & 2 deletions coveo_stew/offline_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()

Expand Down

0 comments on commit b82ca3c

Please sign in to comment.