Poetry: Add Personal Access Token Authentication Support

Created on 25 Apr 2020  路  4Comments  路  Source: python-poetry/poetry

  • [X] I have searched the issues of this repo and believe that this is not a duplicate.
  • [X] I have searched the documentation and believe that my question is not covered.

Feature Request

I'm using personal access token for installing private git repositories. However, It isn't supported by poetry.

You can see the error below.

$ poetry add git+https://MY_TOKEN:[email protected]/efe/my-private-repository.git

[ValueError]
Could not parse version constraint: //MY_TOKEN:[email protected]/efe/my-private-repository.git

add [-D|--dev] [--git GIT] [--path PATH] [-E|--extras EXTRAS] [--optional] [--python PYTHON] [--platform PLATFORM] [--allow-prereleases] [--dry-run] [--] <name> (<name>)...
Bug Duplicate

Most helpful comment

$ poetry add git+https://MY_TOKEN:[email protected]/efe/[email protected]

[ValueError]
Invalid git url "git+https://MY_TOKEN:[email protected]/efe/[email protected]"
```

Facing the same issue on 1.1.0.

All 4 comments

Hello @efe ,

thanks for reporting. However, this was reported earlier in #2062 and should be fixed once #2169 is merged.

fin swimmer

@finswimmer Sorry, I was using an old release of Poetry. But, The bug still exists. I'd like you to re-open the issue.

I've updated Poetry to the latest version which is 1.0.5. poetry add command still gives an error. However, The description is different in this case.

$ poetry add git+https://MY_TOKEN:[email protected]/efe/[email protected]

[ValueError]
Invalid git url "git+https://MY_TOKEN:[email protected]/efe/[email protected]"

If I remove the version,

$ poetry add git+https://MY_TOKEN:[email protected]/efe/my-private-repository.git

[CalledProcessError]
Command '['git', 'clone', 'https://MY_TOKEN/[email protected]/efe/my-private-repository.git', '/var/folders/qf/f1j5ss4n6ll0nkvrx_pzvrnr0000gn/T/pypoetry-git-my-private-repository8wyivpr2']' returned non-zero exit status 128.

Also, Deploy key auth and Personal access token auth are different methods. They have different paths.

  • Personal access token auth path:
    git+https://MY_TOKEN:[email protected]/efe/my-private-repository.git
  • Deploy key auth path:
    git+https://TOKEN_NAME:[email protected]/efe/my-private-repository.git

BTW, my token is an alphanumeric string.

Hello @efe,

the PR I've linked isn't merged until now. So it's not included in any release of poetry. I'm still searching for a source where it is described how a deployment key looks like and what characters are allowed. Do you know any source?

fin swimmer

$ poetry add git+https://MY_TOKEN:[email protected]/efe/[email protected]

[ValueError]
Invalid git url "git+https://MY_TOKEN:[email protected]/efe/[email protected]"
```

Facing the same issue on 1.1.0.

Was this page helpful?
0 / 5 - 0 ratings