Skip to content

fix(python-setup): pass requirements.lock relative to the venv dir (macOS 'Application Support') - #403

Open
lion24 wants to merge 1 commit into
Fincept-Corporation:mainfrom
lion24:fix/macos-uv-lock-path-spaces
Open

lion24 wants to merge 1 commit into
Fincept-Corporation:mainfrom
lion24:fix/macos-uv-lock-path-spaces

Conversation

@lion24

@lion24 lion24 commented Oct 16, 2026 •

Copy link
Copy Markdown

Scope gate (required)

  • This PR closes an issue that carries the good-first-issue, help-wanted, or scope:approved label. (Issue opened, waiting for a maintainer to label it.)
  • I confirmed the scope with a maintainer on the issue before writing code.
  • This PR is from a topic branch (not main on my fork).
  • This PR makes one logical change. It does not bundle unrelated fixes.
  • I did not run Black / autopep8 / isort / clang-format / Prettier on files I did not otherwise modify.
  • Diff is minimal — no reformatting of surrounding lines that are unrelated to the change.

Linked issue (required — use Closes #NNN or Fixes #NNN):

Closes #404

What does this PR do?

It fixes first-time setup on macOS, which currently always fails at Analytics Core with uv exited with code 2, so Analytics Full never runs.

The install dir is ~/Library/Application Support/com.fincept.terminal. The pinned uv 0.7.12 can't open a lock file passed by a path containing a space (error: File not found: '/Users/<me>/Library/Application'). --python and pip compile -o paths with the same space are fine, and the arguments already go to uv as a QStringList. The issue has a minimal repro.

The install steps now run uv from the venv directory and pass requirements.lock as a bare file name, so the space never reaches uv. uv is pinned with checksums, so this avoids a uv bump.

Type of change

  • Bug fix
  • New feature / screen
  • Performance improvement
  • Refactoring (with linked issue)
  • Documentation (see CONTRIBUTING — docs-only PRs allowed only for genuine errors)
  • Build / config change

Changes made

fincept-qt/src/python/PythonSetupManager.cpp (+11 / -2):

  • StepOptions: new optional working_dir. start_step calls QProcess::setWorkingDirectory only when it's set, so every other step is unchanged.
  • lane_install_core: runs from the venv dir and passes -c requirements.lock.
  • lane_install_full: runs from the venv dir and passes -r requirements.lock when not in fallback mode. The fallback still uses the bundled requirements file.

How to test

  1. On macOS, start with an install dir where setup has failed at Analytics Core, or a fresh one.
  2. Build (cmake --build --preset macos-release) and launch, or click Retry Setup.
  3. Analytics Core and Analytics Full complete. The log shows uv pip install ... -c requirements.lock finishing OK.

Architecture / code-quality checklist

  • Builds without errors on my target platform (Windows / macOS / Linux) — state which below
  • UI thread is never blocked (no waitForFinished() on main thread) — see CLAUDE.md P1
  • Timers start/stop in showEvent() / hideEvent() — see P3 (n/a)
  • No raw QProcess for Python — used PythonRunner::instance().run() — see P4 (uses the existing start_step path)
  • No print() in Python scripts — used logger.info / logger.warning — see P14 (n/a)
  • No sensitive data (API keys, credentials) committed
  • DataHub rules (D1–D5) respected if touching data flow (n/a)
  • Tested manually on: macOS (Apple Silicon). Not tested on Windows or Linux.

Screenshots / logs

Before:

[PythonSetup] uv failed after 12 ms (kind=1 exit=2): error: File not found: `/Users/<me>/Library/Application`
[PythonSetup] [venv-numpy2] Installing the analytics core — uv exited with code 2.

After: setup completes, with Analytics Core and Analytics Full installed.

On macOS the install dir is under ~/Library/Application Support, and
uv 0.7.12 fails to read a lock file given by a path containing a space:

  uv pip install ... -c "/Users/x/Library/Application Support/com.fincept.terminal/venv-numpy2/requirements.lock"
  error: File not found: `/Users/x/Library/Application`

so the Analytics Core lane exits with code 2 and setup cannot complete.

Add an optional StepOptions::working_dir, run the core and full uv
installs from the venv directory, and pass the lock as the bare file
name. Other steps and the fallback path are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01DEHQTP7Ncz2n7m82sqyxon
@github-actions

Copy link
Copy Markdown
Contributor

Hi @lion24 — thanks for the PR!

Our automated scope gate flagged the following:

❌ No scope-approved linked issue. This PR must close an issue that carries one of: good-first-issue, help-wanted, scope:approved. Link it in the PR body with Closes #NNN or via GitHub's "Linked issues" sidebar.

Please read CONTRIBUTING.md. Once an issue with the appropriate label exists and is linked here, re-run this check by pushing an empty commit or editing the PR description. A maintainer can also bypass this gate by adding the scope:approved label to this PR.

PRs that remain unresolved for 7 days will be closed automatically.

@github-actions github-actions Bot added the needs-scope-approval Auto-applied by pr-gate.yml to PRs that fail the scope gate. label Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-scope-approval Auto-applied by pr-gate.yml to PRs that fail the scope gate.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[BUG] macOS: setup fails at Analytics Core — uv can't read requirements.lock under "Application Support"

1 participant