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

feat: allow stew build when package-mode is false #70

Merged
merged 2 commits into from
Dec 17, 2024
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
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
10 changes: 7 additions & 3 deletions coveo_stew/offline_publish.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,17 @@ 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()

# validate the wheelhouse; this will exit in error if something's amiss or result in a noop if all is right.
self._validate_package(f"{self.project.package.name}=={self.project.package.version}")
# if package mode is disabled, we expect the package to be missing.
if self.project.package.package_mode:
self._validate_package(f"{self.project.package.name}=={self.project.package.version}")

def _store_setup_dependencies_in_wheelhouse(
self, project: Optional[PythonProject] = None
Expand Down
Loading