-
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
NotGitRepository
error when installing multiple packages from one git repository
#6958
Comments
NotGitRepository
error when installing multiple packages from one git repository on a non-default branchNotGitRepository
error when installing multiple packages from one git repository
Based on the error message you provided, it looks like the package you are trying to install requires a git repository, but the installation process is unable to find one at the specified location: To fix this error, you will need to first determine the root cause of the problem. This may involve examining the package's code, as well as the installation process, to identify any issues. It may also be helpful to consult the documentation for the package, or seek help from the package's maintainers or the community. Once you have determined the cause of the error, you can then take the appropriate steps to fix it. This may involve modifying the package's code, changing the way it is installed, or taking some other action. |
We are also seeing this issue with a docker build that depends on multiple packages from the same git repository. I suspect that as more and more people adopt the monorepo strategy that is now quite well supported by poetry. None of the workarounds presented here worked for us, we had to manually serialize the installation of the packages to avoid the race condition. |
@danieldanciu can you describe the following ?
Did you run a |
Are there any workarounds for this? I have multiple misc modules in a utilities repo and I'd really like to use a few of them in other projects. |
@pdarulewski I think that the root issue is in the way poetry clone multiple dependencies in parallel. The fix could be something that disable parallel install for dependencies that comes from the same repository. poetry/src/poetry/installation/executor.py Lines 71 to 77 in 6e94298
You could try to totally disable parallel installer with:
as stated here #7949 (comment) |
@gnuletik yes, I think so too, I guess I've had other errors related to the |
This would be a great fix! We also use monorepos to handle private python packages and end up with this issue. Turning parallelism off can increase the build time x10 for a large project... |
Setting the parallel to false didn't work in my case. |
Does anyone have any ideas on how to better consistently reproduce this? I can reproduce it sometimes locally, but not always, which is making fixing it a pain. @gnuletik I was able to reproduce it a few times with your repos, but not every time (even after deleting the environment). *edit: I seem to be able to reproduce it more consistently running |
I see a few possible ways forward, but can I ask: what is the expected behavior? Suppose the following monorepo structure:
and another repo that wants to use
which is
When the user installs
|
The 1. option with throwing error is probably breaking change for us. We are using monorepo approach for storing microservices APIs. Then in other projects, we combine package releases (tags) based on deployment. With throwing error, monorepo approach will not be suitable anymore. |
Fair! It sounds like a separate clone per parallel install is a sensible default then? ie. each package is completely separate. Perhaps people with very large monorepos use other tooling to handle reducing redundancy with multiple clones anyway? |
Maybe git worktree can solve both problems? |
Multiple installs from the same git repository causes arace condition when the repository is cloned. This commit only allows one operation per repository to be executed by the parallel workers. Any extra operation will be performed serially. Since the git repository is cached after the first operation, this is blazingly fast. Resolves: python-poetry#6958
Multiple installs from the same git repository causes arace condition when the repository is cloned. This commit only allows one operation per repository to be executed by the parallel workers. Any extra operation will be performed serially. Since the git repository is cached after the first operation, this is blazingly fast. Resolves: python-poetry#6958
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. |
-vvv
option) and have included the output below.Issue
It seems that a race condition occurs when installing two packages:
Repro:
It fails with
NB: output of
poetry install -vvv
can be found here: https://gist.github.com/gnuletik/ddcb05ff3467f022f9d3540f379763dfPlease note that subsequent calls may succeed but a fresh install (after a
poetry env remove --all
) always fails.The text was updated successfully, but these errors were encountered: