Skip to content

fix: import without the uv Python module - #938

Merged
tdstein merged 2 commits into
mainfrom
fix-optional-uv-module
Nov 9, 2026
Merged

tdstein merged 2 commits into
mainfrom
fix-optional-uv-module

Conversation

@tdstein

@tdstein tdstein commented Nov 9, 2026 •

Copy link
Copy Markdown
Collaborator

rsconnect 1.33.0 doesn't import when the uv executable is installed without its Python module. On conda-forge, uv ships only the binary, so the 1.33.0 feedstock build fails its import rsconnect test with ModuleNotFoundError: No module named 'uv' (conda-forge/rsconnect-python-feedstock#62).

_uv_bin() now imports uv when it's called. If the module is missing, it returns "uv" from PATH, which is the fallback it already used when the bundled binary is missing. #920 added the top-level import that caused this.

Tests:

  • test_cli_imports_without_uv_module imports rsconnect.main in a subprocess with the uv module blocked. It fails on 1.33.0 and passes with this change.
  • test_uv_freeze_filters_distributions_and_rewrites_editable_file_urls now also covers freezing an environment with uv from PATH when the module is missing.
  • Tests that simulated a missing bundled binary now patch uv.find_uv_bin directly, since rsconnect.environment no longer has a uv attribute.

Stacked on #937, which adds back the [Unreleased] changelog section.

🤖 Generated with Claude Code

@tdstein
tdstein added this pull request to stack #939 November 9, 2026 18:53
tdstein added a commit that referenced this pull request Nov 9, 2026
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
PR Preview Action v1.8.2
Preview removed because the pull request was closed.
2026-11-09 19:35 UTC

@github-actions

github-actions Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

☂️ Python Coverage

current status: ✅

Overall Coverage

Lines Covered Coverage Threshold Status
11190 9964 89% 0% 🟢

New Files

No new covered files...

Modified Files

File Coverage Status
rsconnect/environment.py 94% 🟢
TOTAL 94% 🟢

updated for commit: 286ab94 by action🐍

Base automatically changed from rearm-1.33.1.dev1 to main November 9, 2026 19:34
tdstein and others added 2 commits November 9, 2026 14:34
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tdstein
tdstein force-pushed the fix-optional-uv-module branch from 1cd2638 to 286ab94 Compare November 9, 2026 19:34
@tdstein
tdstein enabled stacked auto-merge (squash) November 9, 2026 19:35
@tdstein
tdstein disabled stacked auto-merge November 9, 2026 19:35
@tdstein
tdstein merged commit 75c98ee into main Nov 9, 2026
26 checks passed
@tdstein
tdstein deleted the fix-optional-uv-module branch November 9, 2026 19:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants