Poetry cannot properly parse URL with Gitlab [deploy tokens]
See original GitHub issue- 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: Ubuntu 18.04
- Poetry version: 1.0.3
- Link of a Gist with the contents of your pyproject.toml file:
Issue
Poetry cannot properly parse URL with gitlab deploy tokens. The project is hosted on a internal hosted Gitlab server.
The same git URL worked before, but I am not sure since when it is failing.
Command I ran:
poetry add "git+https://<token-name>:<token-key>@<my-org-self-hosted-gitlab-url>/<repo-path>/<repo-name>.git" -vvv
Output
[ValueError]
Invalid git url "git+https://<token-name>:<token-key>@<my-org-self-hosted-gitlab-url>/<repo-path>/<repo-name>.git"
Traceback (most recent call last):
File "/home/binbin/.poetry/lib/poetry/_vendor/py3.7/clikit/console_application.py", line 131, in run
status_code = command.handle(parsed_args, io)
File "/home/binbin/.poetry/lib/poetry/_vendor/py3.7/clikit/api/command/command.py", line 120, in handle
status_code = self._do_handle(args, io)
File "/home/binbin/.poetry/lib/poetry/_vendor/py3.7/clikit/api/command/command.py", line 171, in _do_handle
return getattr(handler, handler_method)(args, io, self)
File "/home/binbin/.poetry/lib/poetry/_vendor/py3.7/cleo/commands/command.py", line 92, in wrap_handle
return self.handle()
File "/home/binbin/.poetry/lib/poetry/console/commands/add.py", line 89, in handle
packages, allow_prereleases=self.option('allow-prereleases')
File "/home/binbin/.poetry/lib/poetry/console/commands/init.py", line 294, in _determine_requirements
requires = self._parse_requirements(requires)
File "/home/binbin/.poetry/lib/poetry/console/commands/init.py", line 371, in _parse_requirements
parsed = ParsedUrl.parse(requirement)
File "/home/binbin/.poetry/lib/poetry/vcs/git.py", line 118, in parse
raise ValueError('Invalid git url "{}"'.format(url))
Issue Analytics
- State:
- Created 4 years ago
- Reactions:8
- Comments:22 (3 by maintainers)
Top Results From Across the Web
PyPI packages in the Package Registry - GitLab Docs
This problem is due to how pip registers and stores your tokens during commands executions. To workaround this issue, you can use a...
Read more >Dependency Scanning - GitLab Docs
Dependency Scanning cannot detect software dependencies that are pre-bundled into the container's base image. To identify pre-bundled dependencies, ...
Read more >Use Deploy tokens to read and write to the GitLab Package ...
Problem to solve. Deploy Tokens allow you to access your group and project's repositories and container registries.
Read more >Poetry's pyproject.toml support for dependency scanning.
Problem to solve Add Python Poetry support to Dependency Scanning, ... Dependency Scanning CI jobs successfully scans Poetry projects having ...
Read more >How to deploy Python packages to Gitlab Package Registry ...
Generate a token in gitlab that can read and write to package repository. Publish the package poetry publish --repository my-gitlab -u ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Same here. This is a major blocker now.
@carlos-lm
Unfortunately, gitlab deploy token url does not work when one wants to use a command
poetry add
. We solved a problem by adding it straight topyproject.toml
and bypassingpoetry add
:Error in our case is:
Installing using pip:
works just fine