-
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
Poetry is not using Dulwich to read the global git config (particularly the insteadOf option) #5934
Comments
insteadOf
)insteadOf
)
insteadOf
)
To mimick the behaviour of C Git, poetry probably wants to call |
It's not clear to me whether it should be poetry's responsibility or dulwich's responsibility to find and use your git configuration. If poetry is the right place then I think the change you want is something like this: - client, path = get_transport_and_path(url, **kwargs)
+ config = StackedConfig.default()
+ client, path = get_transport_and_path(url, config=config, **kwargs) (plus adding the import). But I could believe that dulwich ought to have defaulted to doing that if no |
Oh I see we have crossing updates and I imagine @jelmer is more likely to be right! |
get_transport_and_path() currently defaults to not consulting any config if none is specified; we could default to consulting StackedConfig.default() instead, but I suspect that might lead to confusion since we'd be ignoring the repo-specific config. Open to be persuaded to change this :) |
Your implicit proposed fix seems reasonable to me, @fredrikaverpil perhaps you'd like to test and if all is well put together an MR - client, path = get_transport_and_path(url, **kwargs)
+ config = local.get_config_stack()
+ client, path = get_transport_and_path(url, config=config, **kwargs) |
@dimbleby I feel like I'm not entirely sure what I'm doing as I haven't explored both codebases (poetrys, dulwichs) enough - but I would be happy to give that a try - absolutely. |
@dimbleby @jelmer @neersighted #5935 works for my use case. 👍 This resulted in two failing tests. Looks like they all need to be treated the same way though, asserting that this new config object is part of the function call. This is the GHA workflow I used in my private org/repos to verify this with, which runs
|
Poetry 1.2.0rc2 does not appear to be respecting the global git config (at least with regards to insteadOf). |
@geoffgscott you might have to open a new issue and provide more details. It works for me, and I'm on 1.2.0 now. |
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).Issue
It doesn't seem like poetry is using Dulwich to read the global git config. Should it not do this?
I'm using Poetry in GitHub Actions with private repos and would like to rely on rewriting URLs with
insteadOf
:Dulwich recently added support for rewriting URLs 🎉 (PR here) this - but this is not picked up by poetry.
I initially raised this with the Dulwich maintainers in jelmer/dulwich#983 but they concluded the issue seems to reside with Poetry.
What is the intent here...?
Cc @neersighted (as we chatted briefly about this in discord)
The text was updated successfully, but these errors were encountered: