Repository navigation
Make editable installs work for local projects, and document them (refs #338) - #468
Open
federicocabrera1978-svg wants to merge 1 commit into
Open
federicocabrera1978-svg wants to merge 1 commit into
federicocabrera1978-svg wants to merge 1 commit into
Conversation
Local projects passed as 'file://' dependencies are copied into the virtualenv, so later changes in the project are never seen, not even with --check-updates (which only applies to PyPI dependencies). The recommended way is to install them in editable mode, but '--pip-options=--editable' (and '--uv-pip-options=--editable') didn't work, as the options were put after the dependency and pip/uv got '--editable' without its value. Now the options go before the dependency. Also, --check-updates added an empty 'pypi' entry to the dependencies when there were none from PyPI, which made fades to not find the already created virtualenv. Documented in the README how to use local projects in editable mode.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #338.
As suggested in the issue comment, instead of re-creating the virtualenv when a local project changes, this recommends installing it in editable mode. While testing that, I found a few glitches:
--pip-options=--editabledidn't work: the options were put after the dependency, so pip gotpip install file:///path --editableand failed with "--editable option requires 1 argument". The same happened with--uv-pip-options=--editable. Now the options go before the dependency, in bothPipManagerandUvManager.--check-updatesadded an emptypypientry to the dependencies when there were no PyPI ones (e.g. only afile://dependency), which made fades not find the already created virtualenv and create a new one. Nowcheck_pypi_updatesreturns the dependencies untouched in that case.file://dependencies are copied into the virtualenv (so--check-updatesdoesn't see later changes), and how to use them in editable mode (--pip-options=--editable, or-d "-e file:///..."when there are other dependencies too).Tests: added tests for options that need the dependency (pip and uv) and for
check_pypi_updateswithout PyPI dependencies; adjusted the existing option tests to the new order. Full suite passes (369 tests), flake8/pydocstyle clean. Also checked manually with a real local project: editable installs pick up changes without re-creating the venv.Note (not changed here): since pip options are not part of the venv cache key, if a non-editable venv for the same
file://dependency already exists,--pip-options=--editablewill reuse it. Using-d "-e file:///..."avoids that, as it's a different dependency.