poetry install fails when a git repository with an ssh URL
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: 0.12.17
- Link of a Gist with the contents of your pyproject.toml file: https://gist.github.com/thedrow/171e9e178499677f5838530e545c04fe
Issue
I’m getting the following error when executing poetry install
:
[EnvCommandError]
Command ['/home/omer/.cache/pypoetry/virtualenvs/bootsteps-py3.7/bin/python', '-m', 'pip', 'install', '-e', '/home/omer/Documents/Projects/bootsteps'] errored with the following return code 1, and out
put:
Obtaining file:///home/omer/Documents/Projects/bootsteps
ERROR: Command errored out with exit status 1:
command: /home/omer/.cache/pypoetry/virtualenvs/bootsteps-py3.7/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/home/omer/Documents/Projects/bootsteps/setup.py'"'"'; __file__
='"'"'/home/omer/Documents/Projects/bootsteps/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file_
_, '"'"'exec'"'"'))' egg_info
cwd: /home/omer/Documents/Projects/bootsteps/
Complete output (1 lines):
error in bootsteps setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Invalid URL given
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
There are no further details.
Issue Analytics
- State:
- Created 4 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Poetry add/install using ssh+git fails - Stack Overflow
I am trying to add depedency from git to poetry using SSH ( I am not interested in HTTPS version). The but I...
Read more >Commands | Documentation | Poetry - Python dependency ...
The install command reads the pyproject.toml file from the current project, resolves the dependencies, and installs them. poetry install. If there is a...
Read more >Poetry - The Blue Book
Poetry is a command line program that helps you declare, manage and install dependencies of Python projects, ensuring you have the right stack...
Read more >Installing Private Python Packages - Read the Docs
You need to create a personal access token with the repo scope. Check the GitHub documentation on how to create a personal token....
Read more >PyPI packages in the Package Registry - GitLab Docs
The GitLab PyPI repository supports the following CLI commands: twine upload : Upload a package to the registry. pip install : Install a...
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 FreeTop 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
Top GitHub Comments
@sdispater I have the same issue. It’s only reproducible if you actually have a Python package folder (
project_name/__init__.py
) to go along with thepyproject.toml
, otherwise the installation won’t complain. I put a boiled-down version of @thedrow’spyproject.toml
here. The only relevant line isIs that really the correct way to specify git dependencies accessible only via SSH, not HTTPS? Didn’t find anything on that in the docs, and putting something starting with e.g.
ssh://
makes the subsequentgit clone
performed by poetry fail (cf. below). Would be good to have for dependencies between private repos, though.Looking at the
setup.py
generated bypoetry build
, the issue seems to be that this is what poetry put forinstall_requires
:So clearly it expected something starting with
https://
in which case thegit+
prefix would’ve made sense. So for this line to be correct, you would need to putssh://
in front of the line inpyproject.toml
, but, as I said above, then poetry’s owngit clone
fails with:IMHO it would be best if poetry understood
ssh://
URLs and stripped thessh://
before doing its own cloning.Hello @smheidrich,
the dependency is described correct. But you have to make sure you have the necessary ssh-key(s) on your pc. This is what I get when trying to clone the repository:
And that’s the reason why a
poetry install
fails as well.fin swimmer