Skip to content

Poetry inheriting issue for git-client on github.com #3222

@rienafairefr

Description

@rienafairefr
  • 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 version and name: Linux Mint 20, Py3.8.2 virtualenv

  • Poetry version: 1.1.2

  • Link of a Gist with the contents of your pyproject.toml file:

Issue

While installing or locking, if the github git repo is wrong (e.g. returns a 404 in a browser), then poetry (sometimes) shows an authentication error and ask for the username for that url.

Resolving dependencies...
   1: fact: actions-gateway is 0.7.0
   1: derived: actions-gateway
Username for 'https://github.com':

The pyproject.toml has a git dependency like

Flask-Pika = { git = "https://github.com/rienafairefr/flask_pika.git", rev= "b2b4d68186c52ae034b39f4fb56fe86786b3a055"}

The typo is hard to see, it should be flask-pika instead of flask_pika

If the command is run without verbose output, then the "Username for 'https://github.com':" is sometimes shown only for a fraction of a second, so the command may never terminate and it's hard to know why.

Not sure poetry can or should mitigate the problem that comes from a lower level.

The problem comes (pretty sure) from github.com returning a 401 when it should return a 404:

GET /inexistent-user/inexistent-repo/info/refs?service=git-upload-pack
Host github.com
User-Agent: git/inexistent-version

gives us

HTTP/1.1 401 Authorization Required
Server: GitHub Babel 2.0

This makes the git client (which is called in a subprocess by poetry) to ask for authentication.

setting the GIT_ASKPASS variable to false while caling git is an option, the credentials to use for a git dependency should be provided by poetry, not leaving git to figure it out by itself

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions