-
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
Git dependency install with insteadOf URL fails with poetry>2 #10167
Comments
Sounds like you'll want to report this to dulwich |
I was not sure whether to report this in python-poetry/poetry, python-poetry/poetry-core or dulwich. I spend some time trying to understand in the source code where the URL / auth resolution is coming from, but could not figure it out. In the end, I was not sure whether this is an issue introduced with v2, as there still seems to be a fallback to the legacy git clone in src/poetry/vcs/git/backend.py:247. I am happy to create an issue in dulwich though. |
Handling of git config all happens in dulwich, it is much more likely that you can be helped from there than from here |
@dimbleby Created the issue in dulwich. Should we close this, or await feedback over there? |
if it were me I would think that one open issue was enough. But so long as you eventually close things out you will be far ahead of most folk who show up here...! |
I've the same problem even if I set system-git-client to true |
After spending some time wrestling with this issue (and various SSH and git configurations) it seems that reverting to
quickly fixed / delayed the issue for me. NB I could only reproduce the issue on linux machines, not locally on MacOS |
I had a similar issue, but instead of rewriting from SSH to HTTPS, I'm rewriting from SSH to SSH (because I need to use a different SSH key), and it stopped working with Poetry>2. I figured out that the rewrite must match the URL in the lockfile, which has changed in Poetry>2. So in my case I had to change the git config command from this:
To this:
Notice that the URL now includes the |
I had a similar issue and I was able to resolve it by using |
Description
When installing a private Git dependencies of a project, with a global Git configuration that uses
url.insteadOf
the install fails with adulwich
error. This is a setup in GitLab CI pipelines to install dependencies from internal Git repositories without setting up / deploying to additional PyPI repositories.See Poetry runtime logs for full traceback.
In the CI pipeline the Git URL replacement is configured in the
before_script
section using:When reproducing the issue manually, poetry prompts for a host key verification which indicates that SSH is used for cloning the package instead of HTTPS as configured in the gitconfig.
When selecting no, the full traceback from the Poetry runtime logs is visible.
Workarounds
Downgrade to poetry < 2
Poetry Installation Method
pipx
Operating System
Ubuntu 22.04
Poetry Version
Poetry (version 2.0.1)
Poetry Configuration
Python Sysconfig
sysconfig.log
Example pyproject.toml
Poetry Runtime Logs
poetry-runtime.log
The text was updated successfully, but these errors were encountered: