poetry-plugin-export
poetry-plugin-export copied to clipboard
`poetry export -f requirements.txt` creates deprecated format URI for private git dependencies
- [x] I am on the latest Poetry version.
- [x] I have searched the issues of this repo and believe that this is not a duplicate.
- [x] If an exception occurs when executing a command, I executed it again in debug mode (
-vvv
option).
- OS version and name: OSX Catalina (python 3.7 from homebrew)
- Poetry version: 1.0.8
Issue
After exporting with poetry export -f requirements.txt --without-hashes -o foo.txt
running pip install -r foo.txt
gives warnings like the one below from private git dependencies.
Obtaining [REDACTED] from [email protected][REDACTED]
DEPRECATION: This form of VCS requirement is being deprecated: [email protected][REDACTED]
pip 21.0 will remove support for this functionality. A possible replacement is git+https://[email protected]/..., git+ssh://[email protected]/..., or the insecure git+git://[email protected]/.... You can find discussion regarding this at https://github.com/pypa/pip/issues/7554.
How did you add the dependency?
poetry
just prefixes the dependency with git+
I'm pretty sure I just added the line
REDACTED = {git = "[email protected]:REDACTED.git"}
manually to pyproject.toml, if I just prefix that with ssh://
then poetry install
itself fails with Command '['git', 'clone', 'ssh://[email protected]:REDACTED', '/var/folders/ym/675v9ms93qs0pl79xm2zsgrr0000gn/T/pypoetry-git-REDACTEDdcrj1q5y']' returned non-zero exit status 128.
Edit: just tried adding the dependency again with poetry add git+ssh://[email protected]:REDACTED.git
and ended up with the exact same dependency line in pyproject.toml
as before.
Right.
If conformance with pip
is something favoured by poetry
, all git urls should be regulated.
I will wait for what the maintainers have to say on this before trying to fix anything.
@SanketDG: We would really appreciate your contribution. So go on :+1:
I would suggest you have a look at https://github.com/python-poetry/poetry/blob/bc9acdbcf9082c311ff2545225e00347acf31fd8/poetry/packages/vcs_dependency.py#L83-L88 to get an idea of how to fix it most probably in https://github.com/python-poetry/poetry/blob/bc9acdbcf9082c311ff2545225e00347acf31fd8/poetry/utils/exporter.py#L73-L83
fin swimmer
@finswimmer The issue is not in the exporter, but rather in add
where the protocol information is lost.
But if the ssh://
(with or without git+
prefix) protocol is added back in manually it doesn't work because the git clone
command poetry generates fails.
@SanketDG: As @rambo said, I guess how ssh://
url's are handled by poetry add
are due to the point, that you can easily copy&paste from github, gitlab etc.
I think fixing the output of poetry export
is enough here.
fin swimmer
I thinks fixing the output of
poetry export
is enough here.
Agreed.