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

Dev dependencies into main dependencies poetry cfg #574

Open
Olegt0rr opened this issue Jul 20, 2022 · 2 comments
Open

Dev dependencies into main dependencies poetry cfg #574

Olegt0rr opened this issue Jul 20, 2022 · 2 comments

Comments

@Olegt0rr
Copy link

Olegt0rr commented Jul 20, 2022

Since test dependencies is located in [tool.poetry.dependencies], poetry trying to resolve they. Even they are optional.

eyeD3/pyproject.toml

Lines 65 to 72 in 3c073bb

# Test extra
pytest = {version = "^6.2.1", optional = true}
coverage = {version = "^5.3.1", optional = true, extras = ["toml"]}
pytest-cov = {version = "^2.10.1", optional = true}
tox = {version = "^3.20.1", optional = true}
factory-boy = {version = "^3.1.0", optional = true}
flake8 = {version = "^3.8.4", optional = true}
check-manifest = {version = "^0.45", optional = true}

So. Let's get any application with coverage v6...

[tool.poetry.dev-dependencies]
coverage = "^6"

Try to add eyed3:

poetry add eyed3

And get exception:

  SolverProblemError

  Because no versions of coverage match >5.3.1,<5.4 || >5.4,<5.5 || >5.5,<6.0.0
   and coverage (5.3.1) depends on coverage (5.3.1), coverage (>=5.3.1,<5.4 || >5.4,<5.5 || >5.5,<6.0.0) requires coverage (5.3.1).
  And because coverage (5.4) depends on coverage (5.4)
   and coverage (5.5) depends on coverage (5.5), coverage (>=5.3.1,<6.0.0) requires coverage (5.3.1 || 5.4 || 5.5).
  Because no versions of eyed3 match >0.9.6,<0.10.0
   and eyed3 (0.9.6) depends on coverage (>=5.3.1,<6.0.0), eyed3 (>=0.9.6,<0.10.0) requires coverage (>=5.3.1,<6.0.0).
  Thus, eyed3 (>=0.9.6,<0.10.0) requires coverage (5.3.1 || 5.4 || 5.5).
  So, because App depends on both eyed3 (^0.9.6) and coverage (^6), version solving failed.

To avoid this behaviour eyed3 should locate dev dependencies into [tool.poetry.dev-dependencies] instead of [tool.poetry.dependencies].

@nicfit
Copy link
Owner

nicfit commented Oct 7, 2022

I do use [tool.poetry.dev-dependencies] for release tools, but the coverage is part of an test extras, not the main eyeD3 deps.

@ping
Copy link

ping commented Mar 19, 2023

@nicfit I'm not familiar how the dependencies are setup but coverage is indeed getting installed by default.

$ python3 -m pip install eyed3 
Collecting eyed3
  Using cached eyed3-0.9.7-py3-none-any.whl (246 kB)
Collecting filetype<2.0.0,>=1.0.7
  Using cached filetype-1.2.0-py2.py3-none-any.whl (19 kB)
Collecting coverage[toml]<6.0.0,>=5.3.1
  Using cached coverage-5.5-cp310-cp310-macosx_10_14_x86_64.whl (207 kB)
Collecting deprecation<3.0.0,>=2.1.0
  Using cached deprecation-2.1.0-py2.py3-none-any.whl (11 kB)
Collecting toml
  Using cached toml-0.10.2-py2.py3-none-any.whl (16 kB)
Collecting packaging
  Using cached packaging-23.0-py3-none-any.whl (42 kB)
Installing collected packages: filetype, toml, packaging, coverage, deprecation, eyed3
Successfully installed coverage-5.5 deprecation-2.1.0 eyed3-0.9.7 filetype-1.2.0 packaging-23.0 toml-0.10.2

[notice] A new release of pip available: 22.2.1 -> 23.0.1
[notice] To update, run: pip install --upgrade pip

How can I not get coverage installed as part of eyed3 since you mention that is part of test extras?

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

3 participants