Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Poetry 1.1.2 does not export dependency url for nested git dependencies #3115

Closed
2 of 3 tasks
marns93 opened this issue Oct 7, 2020 · 6 comments
Closed
2 of 3 tasks
Labels
kind/bug Something isn't working as expected

Comments

@marns93
Copy link

marns93 commented Oct 7, 2020

  • 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).

Issue

Regarding to the PR #3089 the dependencies are not exported correctly.
The exception does not occur anymore, but the git url of the nested git dependency is missing in the requirements.txt.

$ poetry export -f requirements.txt --without-hashes
flake8==3.8.4
mccabe==0.6.1
peppercorn==0.6
pycodestyle==2.6.0
pyflakes==2.2.0
sampleproject-mm @ git+ssh://git@github.com/moneymeets/sampleproject.git@83068b995c2f94b0d51333b932b1a939084e9ef7
sampleproject==2.0.0

The output of the export command in the sampleproject repository is as expected.

poetry export -f requirements.txt --without-hashes
flake8==3.8.4
mccabe==0.6.1
peppercorn==0.6
pycodestyle==2.6.0
pyflakes==2.2.0
sampleproject @ git+ssh://git@github.com/pypa/sampleproject.git@52966defd6a61e97295b0bb82cd3474ac3e11c7a

You can reproduce this issue with the linked pyproject.toml.

@marns93 marns93 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Oct 7, 2020
@marns93
Copy link
Author

marns93 commented Oct 7, 2020

@abn Could you please have a look?

abn added a commit to abn/poetry that referenced this issue Oct 7, 2020
abn pushed a commit to abn/poetry that referenced this issue Oct 7, 2020
abn pushed a commit to abn/poetry that referenced this issue Oct 7, 2020
abn pushed a commit to abn/poetry that referenced this issue Oct 9, 2020
@rugleb
Copy link

rugleb commented Oct 12, 2020

I have a similar problem in version 1.1.2.

In ad_strategies project I have next dependencies:

[tool.poetry.dependencies]
python = "^3.8"
ad_ml = { git = "ssh://git@git.ucb.local:7999/ad/ad_ml.git", tag = "v0.6.0" }

In ad_scores package I need ad_strategies package:

[tool.poetry.dependencies]
python = "^3.8"
ad_strategies = { git = "ssh://git@git.ucb.local:7999/ad/ad_strategies.git", tag = "v0.3.0" }

Result of poetry export -f requirements.txt --without-hashes command in ad_scores package is:

ad-ml==0.6.0
ad_strategies @ git+ssh://git@git.ucb.local:7999/ad/ad_strategies.git@v0.3.0

and it wrong, I expect:

ad-ml @ git+ssh://git@git.ucb.local:7999/ad/ad_ml.git@v0.6.0
ad_strategies @ git+ssh://git@git.ucb.local:7999/ad/ad_strategies.git@v0.3.0

Sorry for my English

@abn
Copy link
Member

abn commented Oct 12, 2020

Can you please try the fix at #3119.

Using pipx

pipx install --suffix=@3119 'poetry @ git+https://github.com/python-poetry/poetry.git@refs/pull/3119/head'

Using a container (podman | docker)

podman run --rm -i --entrypoint bash python:3.8 <<EOF
set -e
python -m pip install -q git+https://github.com/python-poetry/poetry.git@refs/pull/3119/head
python -m poetry new foobar
pushd foobar
sed -i /pytest/d pyproject.toml
python -m poetry add 'git+ssh://git@github.com/moneymeets/sampleproject.git#83068b995c2f94b0d51333b932b1a939084e9ef7'
python -m poetry export -f requirements.txt --without-hashes
EOF

Note: The container example will require authorised pubkeys or the dependency references to be updated to anonymous ssh urls or https urls.

@johnpaulett
Copy link

I'm having a similar issue with nested relative path local dependencies on poetry 1.1.2:

...
mypkg.common==0.0.1
mypkg.sdk @ ../../libs/sdk
mypkg.logger==0.0.1
...

It appears that poetry@3119 fixes it:

...
mypkg.common @ /tmp/mypkg/libs/py/common; python_version >= "3.8" and python_version < "3.9"
mypkg.sdk @ /tmp/mypkg/libs/py/sdk; python_version >= "3.8" and python_version < "3.9"
mypkg.logger @ /tmp/mypkg/libs/py/logger; python_version >= "3.8" and python_version < "3.9"
...

Not a problem, but interestingly, many lines now include the python_version restrictions (all of my internal dependencies and many third party libraries).

abn pushed a commit to abn/poetry that referenced this issue Oct 13, 2020
abn pushed a commit to abn/poetry that referenced this issue Oct 13, 2020
abn pushed a commit that referenced this issue Oct 14, 2020
@zyv
Copy link
Contributor

zyv commented Oct 14, 2020

Closing this, since the problem is finally resolved in #3119.

abn pushed a commit to abn/poetry that referenced this issue Oct 14, 2020
@abn abn removed the status/triage This issue needs to be triaged label Mar 3, 2022
Copy link

github-actions bot commented Mar 2, 2024

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

5 participants