Skip to content

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

Closed

Description

@marns93
  • 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.

Activity

  1. added
    kind/bugSomething isn't working as expected
    status/triageThis issue needs to be triaged
    on Oct 7, 2020
  2. marns93 commented on Oct 7, 2020

    @marns93
    Author

    @abn Could you please have a look?

  3. added 4 commits that reference this issue on Oct 7, 2020
    15bfdbe
    01da8ad
    689a949
    2ca46d0
  4. rugleb commented on Oct 12, 2020

    @rugleb

    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

  5. abn commented on Oct 12, 2020

    @abn
    Member

    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.

  6. johnpaulett commented on Oct 12, 2020

    @johnpaulett

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

  7. added 3 commits that reference this issue on Oct 13, 2020
    c09db50
    9854506
    04967db
  8. zyv commented on Oct 14, 2020

    @zyv
    Contributor

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

  9. added a commit that references this issue on Oct 14, 2020
    2974d40
  10. added a commit that references this issue on Feb 26, 2024
    02307ba
  11. github-actions commented on Mar 2, 2024

    @github-actions

    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.

  12. locked as resolved and limited conversation to collaborators on Mar 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugSomething isn't working as expected

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions