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.lock lacks section [package.source] for sub-dependencies #1663

Closed
3 tasks done
weatherfrog opened this issue Dec 3, 2019 · 4 comments
Closed
3 tasks done

poetry.lock lacks section [package.source] for sub-dependencies #1663

weatherfrog opened this issue Dec 3, 2019 · 4 comments
Labels
kind/bug Something isn't working as expected

Comments

@weatherfrog
Copy link

weatherfrog commented Dec 3, 2019

  • 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

Issue

Consider the following scenario:

  • pyproject.toml has package1 as a git dependency
  • package1 has the git URL of package2 as a dependency in setup.py

Then, after poetry install, the file poetry.lock will lack a [package.source]section for package2 and, hence, consecutive builds will fail.

How to reproduce the issue

Create the following files:

🏄 tree
.
├── package1
│   └── setup.py
├── package2
│   └── setup.py
└── project
    └── pyproject.toml


🏄 cat project/pyproject.toml 
[tool.poetry]
name = "MyProject"
version = "0.0.0"
description = ""
authors=[]

[tool.poetry.dependencies]
python = "^3.6"
package1 = {git = "../package1"}


🏄 cat package1/setup.py 
from setuptools import setup

setup(
    name='package1',
    version="1.0.0",
    install_requires=[
        "package2@git+file://../package2",
    ],
)


🏄 cat package2/setup.py 
from setuptools import setup

setup(
    name='package2',
    version="1.0.0",
)

Then run

cd package1
git init && git add -A && git commit -m "init"
cd ..

cd package2
git init && git add -A && git commit -m "init"
cd ..

cd project
python3 -m virtualenv -p python3 venv
source venv/bin/activate
pip install pip --upgrade
pip install poetry==0.12.17
poetry install

In the resulting poetry.lock, the second [[package]]
section (for package2) lacks a [package.source] subsection:

🏄 cat poetry.lock

[[package]]
category = "main"
description = ""
name = "package1"
optional = false
python-versions = "*"
version = "1.0.0"

[package.dependencies]
package2 = "*"

[package.source]
reference = "cda2190bb927d91a9013736e2a8c7b527258d3fd"
type = "git"
url = "../package1"

[[package]]
category = "main"
description = ""
name = "package2"
optional = false
python-versions = "*"
version = "0.0.0"

# :-(  no section [package.source] 

[...]
@weatherfrog weatherfrog added the kind/bug Something isn't working as expected label Dec 3, 2019
@finswimmer
Copy link
Member

finswimmer commented Dec 4, 2019

Hello @weatherfrog ,

thanks a lot for reporting. Could you please check if this also happens with latest preview release?

fin swimmer

@weatherfrog
Copy link
Author

@finswimmer I tried. But the above example fails with

[CalledProcessError]
Command '['git', 'clone', 'file://../package2', '/tmp/pypoetry-git-package2as9e91kn']' returned non-zero exit status 128.

Maybe I'd have to use git+https urls rather than referencing git repos on the file system...

@weatherfrog
Copy link
Author

^ I guess I ran into #1746.

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

2 participants