I have 2 python projects A and B
Previously, when I have to set up my development environment on a fresh computer the workflow was:
Now I can edit A and B and push the changes to git without having to rerun setup on A and B every time.
Now, I want to integrate poetry into my workflow. Ideally I want to be able to git clone A
and run poetry install A
and have it mirror my above setup and but I am having trouble installing B through A's setup while still keeping B editable. Based on this thread it seems like sharing venv between two project is not possible.
My stopgap workaround is:
B = {path = "../B/"}
)I really don't like this workflow since A's pyproject.toml now only works on my computer. I looked through issue threads and poetry documentation and could not find solution dealing with this situation. Any and all advises are greatly appreciated.
A's pyproject.toml
[tool.poetry.dependencies]
python = "^3.7"
# B = {git = "https://repo.com/myrepo/B.git"}
B = {path = "../B/"}
Edit: I realized that if I install B before A and edited pyproject before installing A I can prevent 2 installation of B
I'm not sure if this solves your problem but you might be able to use one venv for two projects (is that what you want?) by creating the virtual environment first and then install both project's dependencies in it.
I can't verify it now but something like this might help:
# create the virtual environment and activate
$ python3 -mvenv .venv
$ . .venv/bin/activate
# install dependencies of both projects in it
$ cd B
$ poetry install
$ cd ../A
$ poetry install