feat: compile with mypyc and add install scripts#58
Conversation
- Switch build backend to setuptools + mypyc; compile all modules except __init__.py (avoids __path__ init bug with compiled packages) - Add mypy config: mypy_path, ignore_missing_imports, yaml override - Fix type errors: narrow Status|None in agent.py, annotate model_id - Update CI: matrix build (ubuntu/macos/windows), release job updates README version and uploads platform-native wheels - Add install.sh (macOS/Linux) and install.ps1 (Windows) to install the latest release wheel via uv tool install - Add Makefile targets: build, clean; scope ty check to src/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
There was a problem hiding this comment.
3 issues found across 9 files
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="README.md">
<violation number="1" location="README.md:18">
P1: Pin the PowerShell install script URL to a release tag/commit instead of `main` before piping to `iex` to avoid executing mutable remote code.</violation>
</file>
<file name="install.sh">
<violation number="1" location="install.sh:17">
P2: `aarch64` is normalized to `arm64`, which breaks Linux ARM wheel matching (`manylinux`/`musllinux` wheels are tagged `aarch64`).</violation>
<violation number="2" location="install.sh:35">
P1: The script assumes `uv` is installed; the documented one-line installer will fail on fresh systems without a prerequisite check or guidance.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| esac | ||
|
|
||
| case "${ARCH}" in | ||
| arm64|aarch64) ARCH_TAG="arm64" ;; |
There was a problem hiding this comment.
P2: aarch64 is normalized to arm64, which breaks Linux ARM wheel matching (manylinux/musllinux wheels are tagged aarch64).
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At install.sh, line 17:
<comment>`aarch64` is normalized to `arm64`, which breaks Linux ARM wheel matching (`manylinux`/`musllinux` wheels are tagged `aarch64`).</comment>
<file context>
@@ -0,0 +1,36 @@
+esac
+
+case "${ARCH}" in
+ arm64|aarch64) ARCH_TAG="arm64" ;;
+ x86_64) ARCH_TAG="x86_64" ;;
+ *) echo "Unsupported architecture: ${ARCH}"; exit 1 ;;
</file context>
- Add interactive check in install.sh and install.ps1 - If uv is not found, ask user and install it automatically - Improve formatting of 'From source' section in README Co-authored-by: kowyo-bot <258374017+kowyo-bot@users.noreply.github.com>
…rectory Pin install script URLs to v0.12.0 instead of main to avoid executing mutable remote code via iex/bash. Move install.ps1 and install.sh into a scripts/ directory for better project organization. Also update CI release workflow to auto-bump the version tag in both install script URLs in README.md on new releases. Co-authored-by: kowyo-bot <258374017+kowyo-bot@users.noreply.com>
There was a problem hiding this comment.
1 issue found across 1 file (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/install.sh">
<violation number="1" location="scripts/install.sh:10">
P2: The default reply value conflicts with `[Y/n]`: pressing Enter now defaults to `n` and aborts instead of installing `uv`.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
| if ! command -v uv &>/dev/null; then | ||
| echo "'uv' is required but not installed." | ||
| read -r -p "Would you like to install uv now? [Y/n] " REPLY </dev/tty | ||
| if [[ "${REPLY:-n}" =~ ^[Yy]$ ]]; then |
There was a problem hiding this comment.
P2: The default reply value conflicts with [Y/n]: pressing Enter now defaults to n and aborts instead of installing uv.
Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At scripts/install.sh, line 10:
<comment>The default reply value conflicts with `[Y/n]`: pressing Enter now defaults to `n` and aborts instead of installing `uv`.</comment>
<file context>
@@ -7,7 +7,7 @@ API_URL="https://api.github.com/repos/${REPO}/releases/latest"
echo "'uv' is required but not installed."
read -r -p "Would you like to install uv now? [Y/n] " REPLY </dev/tty
- if [[ "${REPLY:-y}" =~ ^[Yy]$ ]]; then
+ if [[ "${REPLY:-n}" =~ ^[Yy]$ ]]; then
echo "Installing uv..."
curl -LsSf https://astral.sh/uv/install.sh | sh
</file context>
| if [[ "${REPLY:-n}" =~ ^[Yy]$ ]]; then | |
| if [[ "${REPLY:-y}" =~ ^[Yy]$ ]]; then |
| if ! command -v uv &>/dev/null; then | ||
| echo "'uv' is required but not installed." | ||
| read -r -p "Would you like to install uv now? [Y/n] " REPLY </dev/tty | ||
| if [[ "${REPLY:-n}" =~ ^[Yy]$ ]]; then |
There was a problem hiding this comment.
🔴 install.sh default reply is 'n' but prompt convention [Y/n] implies default is 'Y'
On line 10, ${REPLY:-n} sets the default to n when the user presses Enter without typing anything. However, the prompt on line 9 uses the [Y/n] convention (capital Y), which universally signals that pressing Enter should accept (i.e., default to 'Y'). As a result, a user who presses Enter expecting to proceed with installation will instead get the "Aborting" message. Compare with the PowerShell version (scripts/install.ps1:7) which correctly handles the empty-input case by checking $reply -eq "" first.
| if [[ "${REPLY:-n}" =~ ^[Yy]$ ]]; then | |
| if [[ "${REPLY:-Y}" =~ ^[Yy]$ ]]; then | |
Was this helpful? React with 👍 or 👎 to provide feedback.
- Default uv install prompt from [Y/n] to [Y/n] requiring explicit y/Y - Add || true to grep pipelines in install.sh to prevent set -euo pipefail from silently exiting when no platform-specific wheel is found Co-authored-by: kowyo-bot <258374017+kowyo-bot@users.noreply.github.com>
There was a problem hiding this comment.
2 issues found across 2 files (changes from recent commits).
Prompt for AI agents (unresolved issues)
Check if these issues are valid — if so, understand the root cause of each and fix them. If appropriate, use sub-agents to investigate and fix each issue separately.
<file name="scripts/install.ps1">
<violation number="1" location="scripts/install.ps1:7">
P2: This change breaks the `[Y/n]` default behavior: empty input is no longer treated as consent, so pressing Enter aborts installation unexpectedly.</violation>
</file>
<file name="scripts/install.sh">
<violation number="1" location="scripts/install.sh:39">
P2: `|| true` on the asset-fetch pipeline hides real curl/API failures and can produce a misleading "No compatible wheel found" error instead of failing at the fetch step.</violation>
</file>
Reply with feedback, questions, or to request a fix. Tag @cubic-dev-ai to re-run a review.
Co-authored-by: kowyo-bot <258374017+kowyo-bot@users.noreply.github.com>
* feat: compile with mypyc and add install scripts - Switch build backend to setuptools + mypyc; compile all modules except __init__.py (avoids __path__ init bug with compiled packages) - Add mypy config: mypy_path, ignore_missing_imports, yaml override - Fix type errors: narrow Status|None in agent.py, annotate model_id - Update CI: matrix build (ubuntu/macos/windows), release job updates README version and uploads platform-native wheels - Add install.sh (macOS/Linux) and install.ps1 (Windows) to install the latest release wheel via uv tool install - Add Makefile targets: build, clean; scope ty check to src/ Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> * feat: prompt and auto-install uv if missing in install scripts - Add interactive check in install.sh and install.ps1 - If uv is not found, ask user and install it automatically - Improve formatting of 'From source' section in README Co-authored-by: kowyo-bot <258374017+kowyo-bot@users.noreply.github.com> * chore: pin install script URLs to release tag and move to scripts/ directory Pin install script URLs to v0.12.0 instead of main to avoid executing mutable remote code via iex/bash. Move install.ps1 and install.sh into a scripts/ directory for better project organization. Also update CI release workflow to auto-bump the version tag in both install script URLs in README.md on new releases. Co-authored-by: kowyo-bot <258374017+kowyo-bot@users.noreply.github.com> * fix: script * fix(scripts): require explicit confirmation and prevent silent grep exit - Default uv install prompt from [Y/n] to [Y/n] requiring explicit y/Y - Add || true to grep pipelines in install.sh to prevent set -euo pipefail from silently exiting when no platform-specific wheel is found Co-authored-by: kowyo-bot <258374017+kowyo-bot@users.noreply.github.com> * fix(scripts): force reinstall to handle already-installed mini Co-authored-by: kowyo-bot <258374017+kowyo-bot@users.noreply.github.com> --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com> Co-authored-by: kowyo-bot <258374017+kowyo-bot@users.noreply.github.com>
Compile the package with mypyc for native performance and streamline installation.
Build
uv_buildtosetuptools+mypycType fixes
agent.py: annotateworking_status/thinking_statusasStatus | Nonemodels.py: annotatemodel_idasstr | Noneat first assignmentCI
Install scripts
install.sh: macOS/Linux — detects arch, prefers native wheel, falls back to pure Pythoninstall.ps1: Windows — same logic viaInvoke-RestMethodMakefile
build(uv build --wheel) andcleantargetsty checktosrc/to excludesetup.py