Repository navigation
Description
With --force-generate, a project that has its own package installed editable in its environment can't be deployed. rsconnect rejects the editable line, and the error says the package is outside the deployment directory even though it is the deployment directory.
This is the default layout for a uv packaged project: uv sync installs the project itself as an editable package, so uv pip freeze emits -e file:///path/to/project.
Repro
uv init --package myproj && cd myproj
uv add flask
uv add --dev "rsconnect-python @ git+https://github.com/posit-dev/rsconnect-python@main"
printf 'from flask import Flask\napp = Flask(__name__)\n' > app.py
uv run rsconnect write-manifest api . --force-generate -x .venvOn main, rsconnect freezes the environment it runs in, so the repro installs it into the project. With #920, a globally installed rsconnect (e.g. uv tool install) selects the project .venv and fails the same way.
Error: Error creating environment: Editable dependencies outside the deployment directory cannot be installed on Connect:
-e /path/to/myproj
Provide a requirements file that installs them from a package index, a VCS URL, or a relative path inside the deployment directory.
The same happens with an editable package in a subdirectory of the deployment directory (pip install -e ./localpkg). pip freeze and uv pip freeze write editables as absolute paths, and is_unbundleable_editable (rsconnect/subprocesses/inspect_environment.py) treats every absolute path as unbundleable without checking whether it falls inside the deployment directory.
Context
- The check was added by Fix dependency filtering and require pip 20.3 for inspection #909 (for pip freeze filtering drops any line containing "rsconnect" but keeps local editable installs #899) and is on
main, not in 1.32.0. - This isn't a regression in outcome. 1.32.0 passed the absolute
-e file:///...line to Connect, and the Connect build then failed withDistribution not found at: file:///.... Now it fails earlier, with a misleading message. - fix: inspect the project Python environment #920 (Inspect the project's Python environment instead of the CLI's (support uv tool install) #889) makes this more common: rsconnect now inspects the project
.venvautomatically, including when installed withuv tool install, so anyuv init --packageproject hits it. - Related: Unable to specify the installation of the current directory, which causes a ModuleNotFoundError #456 (installing the deployed project itself on Connect).
Expected
Editables inside the deployment directory are bundled with the content, so they shouldn't be rejected as unreachable. Options:
- Rewrite editables inside the deployment directory to a relative path (
.or./localpkg), which Connect can install from the bundle. - Or drop the deployed project's own editable line, and still reject editables that are actually outside the directory.
At minimum, the error shouldn't say "outside the deployment directory" for a path inside it.
Found during manual QA of #920 against a local Posit Connect.
Activity