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

RecursionError #2008

Closed
dulm opened this issue Feb 10, 2020 · 7 comments
Closed

RecursionError #2008

dulm opened this issue Feb 10, 2020 · 7 comments
Labels
area/solver Related to the dependency resolver kind/bug Something isn't working as expected
Milestone

Comments

@dulm
Copy link

dulm commented Feb 10, 2020

  • OS version and name: mint 19.3
  • Poetry version: 1.0.3
  • Link of a Gist with the contents of your pyproject.toml file:
[tool.poetry]
name = "test1"
version = "0.1.0"
description = ""
authors = ["lqk"]

[tool.poetry.dependencies]
python = "^3.7"



[tool.poetry.dev-dependencies]


#[[tool.poetry.source]]
#name = "ali"
#url = "https://mirrors.aliyun.com/pypi/simple"
#default=true



[build-system]
requires = ["poetry>=0.12"]
build-backend = "poetry.masonry.api"

Issue

  1. poetry add pyautogui
  2. del the pyautogui in pyproject.toml
  3. poetry add pyautogui

throws

(.venv) (base) lqk@shenzhou-mint:~/projects/PycharmProjects/Test1$ poetry add pyautogui -vvv

[RuntimeError]
[tool.poetry] section not found in pyproject.toml

Traceback (most recent call last):
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/api/command/command.py", line 163, in _do_handle
    self._dispatcher.dispatch(PRE_HANDLE, event)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/api/event/event_dispatcher.py", line 22, in dispatch
    self._do_dispatch(listeners, event_name, event)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/api/event/event_dispatcher.py", line 89, in _do_dispatch
    listener(event, event_name, self)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/console/config/application_config.py", line 86, in set_env
    poetry = command.poetry
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/console/commands/command.py", line 10, in poetry
    return self.application.poetry
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/console/application.py", line 49, in poetry
    self._poetry = Factory().create_poetry(Path.cwd())
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/factory.py", line 43, in create_poetry
    '[tool.poetry] section not found in {}'.format(poetry_file.name)
  1. then call add or update wil throw error, only del lock can work
Writing lock file

[RecursionError]
maximum recursion depth exceeded

Traceback (most recent call last):
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/console_application.py", line 131, in run
    status_code = command.handle(parsed_args, io)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/api/command/command.py", line 120, in handle
    status_code = self._do_handle(args, io)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/clikit/api/command/command.py", line 171, in _do_handle
    return getattr(handler, handler_method)(args, io, self)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/cleo/commands/command.py", line 92, in wrap_handle
    return self.handle()
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/console/commands/add.py", line 149, in handle
    status = installer.run()
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/installation/installer.py", line 74, in run
    self._do_install(local_repo)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/installation/installer.py", line 225, in _do_install
    ops = solver.solve(use_latest=whitelist)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/puzzle/solver.py", line 36, in solve
    packages, depths = self._solve(use_latest=use_latest)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/puzzle/solver.py", line 181, in _solve
    self._package, self._provider, locked=locked, use_latest=use_latest
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/mixology/__init__.py", line 7, in resolve_version
    return solver.solve()
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/mixology/version_solver.py", line 80, in solve
    next = self._choose_package_version()
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/mixology/version_solver.py", line 398, in _choose_package_version
    self._solution.decide(version)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/mixology/partial_solution.py", line 87, in decide
    Assignment.decision(package, self.decision_level, len(self._assignments))
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/mixology/assignment.py", line 35, in decision
    return cls(package.to_dependency(), True, decision_level, index)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/packages/package.py", line 395, in to_dependency
    return dependency_from_pep_508(name)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/packages/__init__.py", line 39, in dependency_from_pep_508
    req = Requirement(name)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/poetry/version/requirements.py", line 208, in __init__
    req = REQUIREMENT.parseString(requirement_string)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/pyparsing.py", line 1937, in parseString
    loc, tokens = self._parse(instring, 0)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/pyparsing.py", line 1677, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/pyparsing.py", line 4052, in parseImpl
    loc, exprtokens = e._parse(instring, loc, doActions)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/pyparsing.py", line 1677, in _parseNoCache
    loc, tokens = self.parseImpl(instring, preloc, doActions)
  File "/home/lqk/opt/pipx/venvs/poetry/lib/python3.7/site-packages/pyparsing.py", line 4237, in parseImpl
    ret = e._parse(instring, loc, doActions)

if i use pymongo instead of pyautogui, it will not throw error follow above procedue.

@dulm dulm added the kind/bug Something isn't working as expected label Feb 10, 2020
@finswimmer finswimmer added the area/solver Related to the dependency resolver label Feb 11, 2020
@abn
Copy link
Member

abn commented Aug 9, 2020

Fixed in 1.1.0b2. Requires regeneration of lock file. Note that new lock file is not compatible with older versions of poetry.

@abn abn closed this as completed Aug 9, 2020
@abn abn added this to the 1.1 milestone Aug 9, 2020
@danihodovic
Copy link

While 1.1.0b2 fixes this issue, it breaks git installs. @abn do you have a recommendation for people that are facing both issues?

@abn
Copy link
Member

abn commented Aug 16, 2020

@danihodovic what is the breakage?

@danihodovic
Copy link

danihodovic commented Aug 16, 2020

1.1.0b2 fails to install git packages. Versions before 1.1.0b2 cause the recursionerror. I've resorted to downgrading to 1.10 and re-installing all dependencies

@abn
Copy link
Member

abn commented Aug 16, 2020

@danihodovic sorry to be obtuse, but I tried using master and the issue does not seem to exist. Would you be able to provide a quick example? I might be missing something.

#2817?

@danihodovic
Copy link

I didn't update poetry-core to master. I didn't even know that package existed. I will try it out. Thanks

Copy link

github-actions bot commented Mar 3, 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 3, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area/solver Related to the dependency resolver kind/bug Something isn't working as expected
Projects
None yet
Development

No branches or pull requests

4 participants