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

Installation of extras: maximum recursion depth exceeded #2555

Closed
3 tasks done
elben10 opened this issue Jun 14, 2020 · 3 comments · Fixed by #2787
Closed
3 tasks done

Installation of extras: maximum recursion depth exceeded #2555

elben10 opened this issue Jun 14, 2020 · 3 comments · Fixed by #2787
Labels
kind/bug Something isn't working as expected

Comments

@elben10
Copy link

elben10 commented Jun 14, 2020

  • I am on the latest Poetry version.
  • I have searched the issues of this repo and believe that this is not a duplicate.
  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).
  • OS version and name: macOS-10.15.5-x86_64-i386-64bit
  • Poetry version: 1.0.9
  • Link of a Gist with the contents of your pyproject.toml file:

Issue

When I'm installing pyproject2.toml in the gist everything works fine (poetry install), but when I try to install extra dependencies in pyproject1.toml (poetry install -E dask) I receive the following error message

[RecursionError]
maximum recursion depth exceeded

I guess it could be related to #1138

@elben10 elben10 added kind/bug Something isn't working as expected status/triage This issue needs to be triaged labels Jun 14, 2020
@abn
Copy link
Member

abn commented Jun 14, 2020

Issue can be reproduced with 1.1.0a1.

Stack Trace
Installing dependencies from lock file

  RecursionError

  maximum recursion depth exceeded

  at ~/.poetry/lib/poetry/utils/extras.py:47 in <genexpr>
      43|             if package:
      44|                 yield package.name
      45|                 # Recurse for dependencies
      46|                 for dependency_package_name in _extra_packages(
    > 47|                     dependency.name for dependency in package.requires
      48|                 ):
      49|                     yield dependency_package_name
      50| 
      51|     return _extra_packages(extra_package_names)

  Stack trace:

    1  ~/.poetry/lib/poetry/utils/extras.py:39 in _extra_packages
        37|         """Recursively find dependencies for packages names"""
        38|         # for each extra pacakge name
      > 39|         for package_name in package_names:
        40|             # Find the actual Package object. A missing key indicates an implicit
        41|             # dependency (like setuptools), which should be ignored

    2  ~/.poetry/lib/poetry/utils/extras.py:46 in _extra_packages
        44|                 yield package.name
        45|                 # Recurse for dependencies
      > 46|                 for dependency_package_name in _extra_packages(
        47|                     dependency.name for dependency in package.requires
        48|                 ):

  ...  Previous frame repeated 983 times

  986  ~/.poetry/lib/poetry/utils/extras.py:46 in _extra_packages
        44|                 yield package.name
        45|                 # Recurse for dependencies
      > 46|                 for dependency_package_name in _extra_packages(
        47|                     dependency.name for dependency in package.requires
        48|                 ):

  987  ~/.poetry/lib/poetry/installation/installer.py:482 in _get_extra_packages
        480|             extras = self._locker.lock_data.get("extras", {})
        481| 
      > 482|         return list(get_extra_package_names(repo.packages, extras, self._extras))
        483| 
        484|     def _get_installer(self):  # type: () -> BaseInstaller

  988  ~/.poetry/lib/poetry/installation/installer.py:402 in _get_operations_from_lock
        400|         ops = []
        401| 
      > 402|         extra_packages = self._get_extra_packages(locked_repository)
        403|         for locked in locked_repository.packages:
        404|             is_installed = False

  989  ~/.poetry/lib/poetry/installation/installer.py:184 in _do_install
        182|             # Filter the operations by comparing it with what is
        183|             # currently installed
      > 184|             ops = self._get_operations_from_lock(locked_repository)
        185| 
        186|         self._populate_local_repo(local_repo, ops)

  990  ~/.poetry/lib/poetry/installation/installer.py:74 in run
         72| 
         73|         local_repo = Repository()
      >  74|         self._do_install(local_repo)
         75| 
         76|         return 0

  991  ~/.poetry/lib/poetry/console/commands/install.py:63 in handle
        61|         installer.verbose(self.option("verbose"))
        62| 
      > 63|         return_code = installer.run()
        64| 
        65|         if return_code != 0:

  992  ~/.poetry/lib/poetry/_vendor/py3.8/cleo/commands/command.py:92 in wrap_handle
         90|         self._command = command
         91| 
      >  92|         return self.handle()
         93| 
         94|     def handle(self):  # type: () -> Optional[int]

  993  ~/.poetry/lib/poetry/_vendor/py3.8/clikit/api/command/command.py:171 in _do_handle
        169|         handler_method = self._config.handler_method
        170| 
      > 171|         return getattr(handler, handler_method)(args, io, self)
        172| 
        173|     def __repr__(self):  # type: () -> str

  994  ~/.poetry/lib/poetry/_vendor/py3.8/clikit/api/command/command.py:120 in handle
        118|     def handle(self, args, io):  # type: (Args, IO) -> int
        119|         try:
      > 120|             status_code = self._do_handle(args, io)
        121|         except KeyboardInterrupt:
        122|             if io.is_debug():

  995  ~/.poetry/lib/poetry/_vendor/py3.8/clikit/console_application.py:131 in run
        129|             parsed_args = resolved_command.args
        130| 
      > 131|             status_code = command.handle(parsed_args, io)
        132|         except KeyboardInterrupt:
        133|             status_code = 1

@yajo
Copy link

yajo commented Aug 8, 2020

With this pyproject.toml also happens the same:

[tool.poetry.dependencies]
python = "^3.6.1"
ansible = "^2.9.9"
mkdocs = {version = "^1.1.2", optional = true}
mkdocs-material = {version = "^5.5.3", optional = true}

[tool.poetry.extras]
docs = ["mkdocs", "mkdocs-material"]
➤ poetry --version
Poetry version 1.0.10

@abn abn linked a pull request Aug 9, 2020 that will close this issue
yajo pushed a commit to copier-org/copier that referenced this issue Aug 13, 2020
This is a workaround for python-poetry/poetry#2555 that should be reverted after it's fixed and a new poetry is released.
github-actions bot pushed a commit to copier-org/copier that referenced this issue Aug 13, 2020
This is a workaround for python-poetry/poetry#2555 that should be reverted after it's fixed and a new poetry is released.
@abn abn removed the status/triage This issue needs to be triaged label Sep 25, 2020
yajo pushed a commit to copier-org/copier that referenced this issue Oct 16, 2020
python-poetry/poetry#2555 was fixed, so we should be able to use `poetry install -E docs`.
github-actions bot pushed a commit to copier-org/copier that referenced this issue Oct 16, 2020
python-poetry/poetry#2555 was fixed, so we should be able to use `poetry install -E docs`.
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
kind/bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants