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

Transitive dependency causes Dependency walk failed at #306

Open
absalukaskosina opened this issue Nov 5, 2024 · 0 comments
Open

Transitive dependency causes Dependency walk failed at #306

absalukaskosina opened this issue Nov 5, 2024 · 0 comments

Comments

@absalukaskosina
Copy link

We have a common library with following setup (shorten and redacted):
pyproject.toml

[tool.poetry]
name = "commons"
version = "1.2.25"
readme = "README.md"
packages = [{ include = "commons", from = "src" }]

[[tool.poetry.source]]
name = "PyPI"
priority = "primary"

[[tool.poetry.source]]
name = "jfrog"
url = "company_frog"
priority = "supplemental"


[tool.poetry.dependencies]
python = "~3.10"
numpy = [
   {version = ">=2.1.2", markers = "sys_platform != 'darwin'"},
   {version = "<2.0.0", markers = "sys_platform == 'darwin'"}
]

The reason for this is that one of our services uses Ultralytics with following PR , so in order to make it work, we had to limit Numpy for MacOS.

And second project use as dependency with following setup:

[tool.poetry]
name = "service-project"
version = "1.2.0"
readme = "README.md"

[[tool.poetry.packages]]
include = "service"
from = "src"

[[tool.poetry.source]]
name = "PyPI"
priority = "primary"

[[tool.poetry.source]]
name = "jfrog"
url = "company_frog"
priority = "supplemental"

[tool.poetry.dependencies]
python = "~3.10"
commons = "^1.2.25"

Generally poetry install works and we have no problem in development and testing.

The problem starts when we try to export requirements for docker image using

poetry export --without-hashes --format=requirements.txt --without dev,research --with-credentials > requirements.txt

Which will cause

  Stack trace:
   1  ~/.local/pipx/venvs/poetry/lib/python3.10/site-packages/poetry_plugin_export/walker.py:125 in get_project_dependencies
       123│         )
       124│
     → 125│     nested_dependencies = walk_dependencies(
       126│         dependencies=project_requires,
       127│         packages_by_name=packages_by_name,

  RuntimeError
  Dependency walk failed at numpy (>=1.21.4)

Is there any way how it is possible to make export plugin work with following setup?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant