Repository navigation
Conversation
|
☂️ Python Coverage
Overall Coverage
New FilesNo new covered files... Modified Files
|
There was a problem hiding this comment.
so if I understand this correctly, previously a local editable install made the Connect build fail with a clear error. Now the line is removed, so the build succeeds and the content fails later with an ImportError at runtime. Is that behavior really better?
Yeah I agree with your assessment. If the dependency isn't resolvable on Connect, then it should fail-fast. There are types of editable installs which can be resolved on Connect. Such as, git+http references, and local directly resolutions. We should allow those deps and should error when the dep isn't resolvable. |
Parse requirement names with packaging instead of regexes, and classify editable targets with urlsplit. Editable installs of rsconnect-python itself are dropped like other rsconnect-python requirements. Editables are now checked for every requirements source, including user-provided files. Absolute paths, file: URLs, and relative paths that leave the deployment directory raise an error; relative paths inside the bundle, such as uv workspace members, are allowed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| requirement = Requirement(line.strip()) | ||
| except InvalidRequirement: | ||
| return False | ||
| return canonicalize_name(requirement.name) == "rsconnect-python" |
There was a problem hiding this comment.
Why not have a list of packages to expunge instead of a if and helper for each one?
Also this seems now wrong because we publish this package both as rsconnect and rsconnect-python so now the rsconnect dependency would slip throw
There was a problem hiding this comment.
🤖 Addressed:
- There's now a single
excluded_distributions = {"rsconnect", "rsconnect-python"}set instead of per-package checks. Requirement lines, editable installs, and thepip freeze --excludearguments all use it (019dbd3). - Both published names are filtered, so
rsconnectno longer slips through (e89efee). Tests coverrsconnect==…,RSCONNECT @ …, andrsconnect.python, and check that look-alikes such asmy-rsconnect-utilsare kept.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
| from typing import Callable, List, Optional, cast | ||
| from urllib.parse import parse_qs, urlsplit | ||
|
|
||
| from packaging.requirements import InvalidRequirement, Requirement |
There was a problem hiding this comment.
the inspector runs in the users venv so putting things outside of the standard library here could crash the inspection.
There was a problem hiding this comment.
would it be possible to replace the packaging calls with standard library code?
There was a problem hiding this comment.
🤖 #889 removes this constraint. The inspector will run on the CLI's own interpreter, where packaging is always installed, and receive the project's interpreter as --python. The project's interpreter only gets asked for three things, and none of them imports rsconnect or its dependencies:
- its Python version:
<python> -I -c "import sys; print(...)" - its pip version:
<python> -m pip --version(optional; we fall back when pip is missing) - its installed packages:
<python> -m pip freeze, oruv pip freeze --python <python>
I ran all three in a venv with neither rsconnect nor packaging, and they work. That also fixes the related uv tool install problem, where the project's venv doesn't have rsconnect at all.
Until #889 lands, the risk from this PR is small. The inspector runs as <python> -m rsconnect..., so rsconnect must already be installed there. packaging is a declared dependency of the released 1.32.0, so a normal install already brings it along. The only setups that newly break are rsconnect importable without its dependencies (--no-deps, PYTHONPATH, a source checkout) on Python ≥ 3.11. On Python ≤ 3.10 the inspector already fails there on toml. Given that, I'd rather keep packaging than write stdlib code to parse requirements.
…connect-python_899-38c6ab791ff8ed78 # Conflicts: # docs/CHANGELOG.md
Summary
Requirement filtering matched any line containing
rsconnect, and local editables were bundled even though Connect can't install them.Evidence
my-rsconnect-utils==0.1anddemo @ file:///work/rsconnect-demowere silently dropped.-e /Users/me/localpkgwas bundled and failed on Connect.After: Unrelated packages are kept. Local editables fail during inspection, and the error lists each offending line.
test_pip_compatibility.pypassed against pip 20.2.4, 20.3, and 26.3.Merge Danger
Door: two-way
Publishing environments with pip < 20.3 can no longer generate requirements. They can upgrade pip or supply a requirements file. Connect's installer is unaffected. Deploys that used to upload unreachable editables now fail early instead of on the server.
Blast Radius: deployments
Closes #899
Closes #916
🤖 Generated with Claude Code