-
Notifications
You must be signed in to change notification settings - Fork 2.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Shifting dependency from remote git to local editable does not work #5743
Comments
There are more issues related to local development, such as #2725, but I haven't found one matching my exact use case. |
I was suggested a workaround: remove the virtual environment and re-install. This works! I will definitely use it. But still find it prone to errors:
|
If you are still experiencing the issue with the latest code, I'd recommend you do the following.
Install Poetry from VCSpipx install --force --suffix=@git 'poetry @ git+https://github.com/python-poetry/poetry.git' |
Thanks for your support @abn, this worked as intended! I'm still wondering if it's a result of the If it's still useful, I'll leave two gists below: And the output from running the application: # right after installing
$ poetry@git run python myapp.py
Hello World from git tag
# change to local file and modify it
$ echo 'print("Hello world from local dev")' > ../my-lib/mylib/mylib.py
$ poetry@git run python myapp.py
Hello world from local dev # <--- working as intended!
# modify again
$ echo 'print("Hello world from local dev 2")' > ../mylib/mylib/mylib.py
$ poetry@git run python myapp.py
Hello world from local dev 2 # <--- working as intended!
|
I see that So I omitted that parameter in $ poetryx install
Creating virtualenv myapp in /home/duarte/dev/experiments/xpoetry/myapp/.venv
Installing dependencies from lock file
Package operations: 1 install, 0 updates, 0 removals
• Installing mylib (0.1.1 cad773c)
Installing the current project: myapp (0.1.0)
$ poetryx run python myapp.py
Hello World from git tag # <--- original print, as intended
$ vim pyproject.toml
$ cat pyproject.toml | grep mylib
mylib = {path = "../mylib", develop=true}
$ vim pyproject.toml
$ poetryx install
Installing dependencies from lock file
Warning: poetry.lock is not consistent with pyproject.toml. You may be getting improper dependencies. Run `poetry lock [--no-update]` to fix it.
Package operations: 0 installs, 1 update, 0 removals
• Updating mylib (0.1.1 cad773c -> 0.1.1 /home/duarte/dev/experiments/xpoetry/mylib)
Installing the current project: myapp (0.1.0)
$ echo 'print("Hello world from local dev")' > ../mylib/mylib/mylib.py
$ poetryx run python myapp.py
Hello world from local dev # <--- changed as intended!
$ echo 'print("Hello world from local dev 2")' > ../mylib/mylib/mylib.py
$ poetryx run python myapp.py # <--- changed as intended!
Hello world from local dev 2 |
I just installed |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
I am on the latest Poetry version.
I have searched the issues of this repo and believe that this is not a duplicate.
If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).OS: Windows 10 but using WSL with Ubuntu 20.04,4 LTS:
Poetry version: 1.1.3:
pyproject.toml file:
Issue
I have some libraries and applications: the applications import the libraries, which are hosted on git. While debugging a library, I'd like to use a local version temporarily in editable mode, such that I can quickly get the changes and test them.
However, this does not work as expected.
When shifting to files and develop and re-installing, poetry reads the new files and all the messages seem to indicate a successful change, but when running the application the changes are not there.
Strangely, changing from remote git to to local mode without the development flag, works as expected, but not really fit for my workflow.
Reproduction
Removing the virtual env and re-installing:
Strangely, if we just shift from remote git to local (not editable) it works, but is not editable:
The text was updated successfully, but these errors were encountered: