Poetry: Failed to run `poetry develop` if extras defined

Created on 27 Jul 2018  ·  2Comments  ·  Source: python-poetry/poetry

  • [x] I am on the latest Poetry version.
  • [x] I have searched the issues of this repo and believe that this is not a duplicate.
  • [x] If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: MacOS
  • Poetry version: 0.11.3
  • Part of pyproject.toml:
[tool.poetry.dependencies]
python = "~3.6"

dataclasses = { version = "0.*", python = "~3.6" }
kafka-python = { version = "^1.3.4", optional = true }
pydantic = "0.*"
py2nats = "0.*"

[tool.poetry.extras]
kafka = ["kafka-python"]
nats = ["py2nats"]

Issue

Failed to run poetry develop if extras defined.

Exception:

[VenvCommandError]
Command ['pip', 'install', '-e', '/my/package', '--no-deps'] errored with the following output:
Obtaining file:///my/package
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
    Complete output from command python setup.py egg_info:
    error in package setup command: 'extras_require' must be a dictionary whose values are strings or lists of strings containing valid project/version requirement specifiers.

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /my/package

Exception trace:
 /Users/ng/.pyenv/versions/3.6.5/lib/python3.6/site-packages/cleo/application.py in run() at line 94
   status_code = self.do_run(input_, output_)
 /Users/ng/.pyenv/versions/3.6.5/lib/python3.6/site-packages/poetry/console/application.py in do_run() at line 88
   return super(Application, self).do_run(i, o)
 /Users/ng/.pyenv/versions/3.6.5/lib/python3.6/site-packages/cleo/application.py in do_run() at line 197
   status_code = command.run(input_, output_)
 /Users/ng/.pyenv/versions/3.6.5/lib/python3.6/site-packages/poetry/console/commands/command.py in run() at line 77
   return super(BaseCommand, self).run(i, o)
 /Users/ng/.pyenv/versions/3.6.5/lib/python3.6/site-packages/cleo/commands/base_command.py in run() at line 146
   status_code = self.execute(input_, output_)
 /Users/ng/.pyenv/versions/3.6.5/lib/python3.6/site-packages/cleo/commands/command.py in execute() at line 107
   return self.handle()
 /Users/ng/.pyenv/versions/3.6.5/lib/python3.6/site-packages/poetry/console/commands/develop.py in handle() at line 35
   self._install(setup)
 /Users/ng/.pyenv/versions/3.6.5/lib/python3.6/site-packages/poetry/console/commands/develop.py in _install() at line 48
   self.venv.run("pip", "install", "-e", str(setup.parent), "--no-deps")
 /Users/ng/.pyenv/versions/3.6.5/lib/python3.6/site-packages/poetry/utils/venv.py in run() at line 274
   raise VenvCommandError(e)

develop

Part of generated setup.py:

extras_require = \
{':extra == "nats"': ['py2nats<1.0.0'],
 ':python_version >= "3.6" and python_version < "3.7"': ['dataclasses<1.0.0'],
 'kafka': ['kafka-python>=1.3.4,<2.0.0']}

Most helpful comment

Not a poetry issue, I forgot to specify optional=true for py2nats dependency.

All 2 comments

Not a poetry issue, I forgot to specify optional=true for py2nats dependency.

Thanks for explaining what the issue was; totally just hit this myself. 🤦‍♂️

Was this page helpful?
0 / 5 - 0 ratings

Related issues

etijskens picture etijskens  ·  3Comments

tonysyu picture tonysyu  ·  3Comments

AWegnerGitHub picture AWegnerGitHub  ·  3Comments

jbarlow83 picture jbarlow83  ·  3Comments

probablykasper picture probablykasper  ·  3Comments