Poetry: Specify a different python version for development

Created on 24 Oct 2018  路  2Comments  路  Source: python-poetry/poetry

  • [x] I have searched the issues of this repo and believe that this is not a duplicate.

Issue

I'm building a package for Python ^3.5, but in the develpment dependencies i use black which requires ^3.6. So the dependencies resolving is failling.

[tool.poetry.dependencies]
python = "^3.5"
toml = "^0.10.0"
psycopg2 = "^2.7"
tornado = "^5.1"

[tool.poetry.dev-dependencies]
black = "^18.3-alpha.0"
pylint = "^2.1"
flake8 = "^3.6"
mypy = "^0.641.0"
$ poetry install
Creating virtualenv rephacheck-py3.7 in /home/nicolas/Projets/ubicast/rephacheck/.venv
Updating dependencies
Resolving dependencies... (16.1s)

[SolverProblemError]
The current supported Python versions are ^3.5
Because no versions of black match >18.3-alpha.0,<18.3a1 || >18.3a1,<18.3a2 || >18.3a2,<18.3a3 || >18.3a3,<18.3a4 || >18.3a4,<18.4a0 || >18.4a0,<18.4a1 || >18.4a1,<18.4a2
|| >18.4a2,<18.4a3 || >18.4a3,<18.4a4 || >18.4a4,<18.5b0 || >18.5b0,<18.5b1 || >18.5b1,<18.6b0 || >18.6b0,<18.6b1 || >18.6b1,<18.6b2 || >18.6b2,<18.6b3 || >18.6b3,<18.6b4
|| >18.6b4,<18.9b0 || >18.9b0,<19.0
 and black (18.3a0) requires Python >=3.6, black is forbidden.
And because black (18.3a1) requires Python >=3.6
 and black (18.3a2) requires Python >=3.6, black is forbidden.
And because black (18.3a3) requires Python >=3.6
 and black (18.3a4) requires Python >=3.6, black is forbidden.
And because black (18.4a0) requires Python >=3.6
 and black (18.4a1) requires Python >=3.6, black is forbidden.
And because black (18.4a2) requires Python >=3.6
 and black (18.4a3) requires Python >=3.6, black is forbidden.
And because black (18.4a4) requires Python >=3.6
 and black (18.5b0) requires Python >=3.6, black is forbidden.
And because black (18.5b1) requires Python >=3.6
 and black (18.6b0) requires Python >=3.6, black is forbidden.
And because black (18.6b1) requires Python >=3.6
 and black (18.6b2) requires Python >=3.6, black is forbidden.
And because black (18.6b3) requires Python >=3.6
 and black (18.6b4) requires Python >=3.6, black is forbidden.
So, because black (18.9b0) requires Python >=3.6
 and rephacheck depends on black (^18.3-alpha.0), version solving failed.

If we could add python = ^3.6 in the [tool.poetry.dev-dependencies] section that would be just used for dependecies resolving, it would be nice.

What do you think of it?

Most helpful comment

You just have to specify black like this:

[tool.poetry.dev-dependencies]
black = {version = "^18.3-alpha.0", python = "^3.6"}

and it should resolve properly.

All 2 comments

You just have to specify black like this:

[tool.poetry.dev-dependencies]
black = {version = "^18.3-alpha.0", python = "^3.6"}

and it should resolve properly.

I didn't know we could do that! I confirm that it works. Thank you very much.

Was this page helpful?
0 / 5 - 0 ratings