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 in Dependency Resolution with "sphinx-rtd-theme" in requirements.txt #164

Open
inderps opened this issue Nov 30, 2023 · 2 comments

Comments

@inderps
Copy link

inderps commented Nov 30, 2023

Description

I am experiencing a RecursionError when using python-inspector to analyze a project that includes sphinx-rtd-theme as a dependency. This error seems to occur during the dependency resolution process.

Steps to Reproduce

  1. Create a requirements.txt file with the following content:
sphinx-rtd-theme
  1. Run python-inspector with the following command:
python-inspector --python-version 311 --operating-system macos --json-pdt output.json --analyze-setup-py-insecurely --requirement requirements.txt --verbose

Expected Behavior

I expected python-inspector to analyze the project's dependencies without any issues.

Actual Behavior

The python-inspector command results in a RecursionError. The detailed error output is as follows:

    dependencies = [pdt_dfs(mapping, graph, c) for c in children]
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/inderpal.singh/.pyenv/versions/3.11.5/lib/python3.11/site-packages/python_inspector/resolution.py", line 739, in <listcomp>
    dependencies = [pdt_dfs(mapping, graph, c) for c in children]
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/inderpal.singh/.pyenv/versions/3.11.5/lib/python3.11/site-packages/python_inspector/resolution.py", line 736, in pdt_dfs
    key=src, package_name=src, installed_version=str(mapping[src].version), dependencies=[]
                                                 ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/inderpal.singh/.pyenv/versions/3.11.5/lib/python3.11/site-packages/packvers/version.py", line 301, in __str__
    parts.append(".".join(str(x) for x in self.release))
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
RecursionError: maximum recursion depth exceeded
@TG1999
Copy link
Contributor

TG1999 commented Nov 30, 2023

@inderps thanks for raising this issue. Note also that a PR is always welcomed if you want to take a stab at fixing this bug.

@AJDurant
Copy link

I had the same issue when the requirements file had:

sphinx-autodoc-typehints==1.25.2

along with any one of:

sphinxcontrib-applehelp==1.0.8
sphinxcontrib-devhelp==1.0.6
sphinxcontrib-htmlhelp==2.0.5
sphinxcontrib-qthelp==1.0.7
sphinxcontrib-serializinghtml==1.1.9

However I realised that these contrib packages had mix-matched versions with the downstream Sphinx dependencies. Moving them on one incremental version seems to avoid the issue.

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