RecursionError in Dependency Resolution with "sphinx-rtd-theme" in requirements.txt

Open
#164 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
52/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
backend

Research direction

Reproduce the failure with the requirements.txt contents and the shown python-inspector command. Start in resolution.py around pdt_dfs and the dependency list construction at lines 736-739, then trace the sphinx-rtd-theme dependency graph. Done means the command completes dependency analysis without a RecursionError.

Written by the indexing model from the issue text.

Description

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
Dominant language
Python
Stars
23
Forks
29
Avg merge
1h 7m
Merged PRs (30d)
2

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from aboutcode-org/python-inspector

All issues in aboutcode-org/python-inspector

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.