-
Notifications
You must be signed in to change notification settings - Fork 4
Release v0.4.2 #12
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
Merged
Merged
Release v0.4.2 #12
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
640a0bd
[gobby-#14510] chore: bump version to 0.4.2
joshwilhelmi fc7d6a4
[gobby-#14511] ci: skip voice tests in main pytest jobs
joshwilhelmi 6897464
[gobby-#14512] fix: ship web UI in published wheel + DB-aware CLI config
joshwilhelmi 9904616
[gobby-#14512] fix: lazy-import setuptools in build_backend wrapper
joshwilhelmi 7b301c1
[gobby-#14513] fix: rename ~/.gobby/.mcp.json to mcp-servers.json
joshwilhelmi 2efe164
[gobby-#14514] feat: custom embedding url, model, and dim in gobby in…
joshwilhelmi fe3a589
[gobby-#14515] fix: honor custom embedding endpoints
joshwilhelmi 3528ab8
[gobby-#14516] docs: update changelog for 0.4.2
joshwilhelmi File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| include build_backend/__init__.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,127 @@ | ||
| """PEP 517 build backend wrapper. | ||
|
|
||
| Wraps setuptools.build_meta to stage the web UI into the wheel. | ||
|
|
||
| Before every wheel/sdist build: | ||
| 1. Honor ``GOBBY_SKIP_UI_BUILD=1`` to skip npm, while still requiring staged | ||
| UI assets for wheel builds. | ||
| 2. If ``web/`` has ``package.json`` and ``npm`` is on PATH, run | ||
| ``npm ci && npm run build`` in ``web/`` to produce ``web/dist/``. | ||
| 3. Copy ``web/dist/`` into ``src/gobby/ui/web/dist/`` so the | ||
| ``ui/web/dist/**/*`` package-data glob picks the assets up. | ||
| 4. Verify built wheels contain ``gobby/ui/web/dist/index.html`` so release | ||
| artifacts cannot silently ship without the production UI. | ||
|
|
||
| Editable installs skip the UI build entirely; the dev workflow uses | ||
| ``gobby ui dev`` against ``web/`` directly. | ||
| """ | ||
|
|
||
| from __future__ import annotations | ||
|
|
||
| import logging | ||
| import os | ||
| import shutil | ||
| import subprocess # nosec B404 | ||
| import zipfile | ||
| from pathlib import Path | ||
| from typing import Any | ||
|
|
||
| logger = logging.getLogger(__name__) | ||
|
|
||
|
|
||
| def _orig() -> Any: | ||
| """Lazy-import setuptools.build_meta. | ||
|
|
||
| Kept lazy so importing this module (e.g., from tests that only exercise | ||
| `_stage_ui`) does not require setuptools to be installed at runtime. | ||
| """ | ||
| from setuptools import build_meta | ||
|
|
||
| return build_meta | ||
|
|
||
|
|
||
| def __getattr__(name: str) -> Any: | ||
| """Forward PEP 517 hook attributes to setuptools.build_meta on first access.""" | ||
| if name in { | ||
| "get_requires_for_build_wheel", | ||
| "get_requires_for_build_sdist", | ||
| "get_requires_for_build_editable", | ||
| "prepare_metadata_for_build_wheel", | ||
| "prepare_metadata_for_build_editable", | ||
| }: | ||
| return getattr(_orig(), name) | ||
| raise AttributeError(f"module {__name__!r} has no attribute {name!r}") | ||
|
|
||
|
|
||
| _REPO_ROOT = Path(__file__).resolve().parent.parent | ||
| _WEB_SRC = _REPO_ROOT / "web" | ||
| _DIST_SRC = _WEB_SRC / "dist" | ||
| _WHEEL_DEST = _REPO_ROOT / "src" / "gobby" / "ui" / "web" / "dist" | ||
| _WHEEL_UI_INDEX = "gobby/ui/web/dist/index.html" | ||
|
|
||
|
|
||
| def _stage_ui() -> None: | ||
| if os.environ.get("GOBBY_SKIP_UI_BUILD") == "1": | ||
| logger.info("GOBBY_SKIP_UI_BUILD=1 - skipping UI build step") | ||
| return | ||
|
|
||
| have_source = (_WEB_SRC / "package.json").exists() | ||
| have_npm = shutil.which("npm") is not None | ||
|
|
||
| if have_source and have_npm: | ||
| logger.info("Building web UI in %s", _WEB_SRC) | ||
| subprocess.run(["npm", "ci"], cwd=_WEB_SRC, check=True) # nosec B603 B607 | ||
| subprocess.run(["npm", "run", "build"], cwd=_WEB_SRC, check=True) # nosec B603 B607 | ||
|
|
||
| if not _DIST_SRC.exists(): | ||
| if _WHEEL_DEST.exists(): | ||
| logger.info("web/dist not available; reusing pre-staged %s", _WHEEL_DEST) | ||
| return | ||
| logger.warning( | ||
| "web/dist not found and npm build not possible - wheel UI asset verification will fail." | ||
| ) | ||
| return | ||
|
|
||
| if _WHEEL_DEST.exists(): | ||
| shutil.rmtree(_WHEEL_DEST) | ||
| _WHEEL_DEST.parent.mkdir(parents=True, exist_ok=True) | ||
| shutil.copytree(_DIST_SRC, _WHEEL_DEST) | ||
| logger.info("Staged web UI assets at %s", _WHEEL_DEST) | ||
|
|
||
|
|
||
| def _verify_wheel_contains_ui(wheel_path: Path) -> None: | ||
| with zipfile.ZipFile(wheel_path) as wheel: | ||
| if _WHEEL_UI_INDEX not in wheel.namelist(): | ||
| raise RuntimeError( | ||
| f"Built wheel is missing {_WHEEL_UI_INDEX}; build web/dist before publishing." | ||
| ) | ||
|
|
||
|
|
||
| def build_wheel( | ||
| wheel_directory: str, | ||
| config_settings: dict[str, Any] | None = None, | ||
| metadata_directory: str | None = None, | ||
| ) -> str: | ||
| _stage_ui() | ||
| wheel_name = str(_orig().build_wheel(wheel_directory, config_settings, metadata_directory)) | ||
| wheel_path = Path(wheel_name) | ||
| if not wheel_path.is_absolute(): | ||
| wheel_path = Path(wheel_directory) / wheel_path | ||
| _verify_wheel_contains_ui(wheel_path) | ||
| return wheel_name | ||
|
|
||
|
|
||
| def build_sdist( | ||
| sdist_directory: str, | ||
| config_settings: dict[str, Any] | None = None, | ||
| ) -> str: | ||
| _stage_ui() | ||
| return str(_orig().build_sdist(sdist_directory, config_settings)) | ||
|
|
||
|
|
||
| def build_editable( | ||
| wheel_directory: str, | ||
| config_settings: dict[str, Any] | None = None, | ||
| metadata_directory: str | None = None, | ||
| ) -> str: | ||
| return str(_orig().build_editable(wheel_directory, config_settings, metadata_directory)) | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add timeouts to npm subprocess calls in
_stage_ui().These build-critical external calls currently have no timeout, so a network/npm stall can block CI/release indefinitely.
Suggested fix
📝 Committable suggestion
🤖 Prompt for AI Agents