Getting `ImportError: cannot import name 'splat'` with `setuptools` 75.0.0

Open
#190 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start by reproducing the python-inspector command from the report with Python 3.11.9 and setuptools 75.0.0. Trace the import through python_inspector/setup_py_live_eval.py and the shown setuptools _distutils files, then compare the installed jaraco.functools version. Done means identifying the compatibility boundary and recording a verified resolution or a minimal reproduction.

Written by the indexing model from the issue text.

Description

We started to see this in ORT:

    java.io.IOException: Running 'python-inspector --python-version 311 --operating-system linux --json-pdt /tmp/ort-PythonInspector15711813311588694259/python-inspector5969974550712099055.json --requirement /workspace/plugins/package-managers/python/src/funTest/assets/projects/synthetic/python-inspector-no-analyze-setup-py/requirements.txt --verbose' in '/workspace/plugins/package-managers/python/src/funTest/assets/projects/synthetic/python-inspector-no-analyze-setup-py' failed with exit code 1:
    Traceback (most recent call last):
      File "/opt/python/versions/3.11.9/bin/python-inspector", line 8, in <module>
        sys.exit(resolve_dependencies())
                 ^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
        return self.main(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/click/core.py", line 1078, in main
        rv = self.invoke(ctx)
             ^^^^^^^^^^^^^^^^
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
        return ctx.invoke(self.callback, **ctx.params)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/click/core.py", line 783, in invoke
        return __callback(*args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/click/decorators.py", line 33, in new_func
        return f(get_current_context(), *args, **kwargs)
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/python_inspector/resolve_cli.py", line 224, in resolve_dependencies
        from python_inspector.api import resolve_dependencies as resolver_api
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/python_inspector/api.py", line 33, in <module>
        from python_inspector.package_data import get_pypi_data_from_purl
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/python_inspector/package_data.py", line 22, in <module>
        from python_inspector.resolution import get_python_version_from_env_tag
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/python_inspector/resolution.py", line 41, in <module>
        from python_inspector.setup_py_live_eval import iter_requirements
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/python_inspector/setup_py_live_eval.py", line 21, in <module>
        import distutils.core
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/setuptools/_distutils/core.py", line 13, in <module>
        from .cmd import Command
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/setuptools/_distutils/cmd.py", line 12, in <module>
        from . import _modified, archive_util, dir_util, file_util, util
      File "/opt/python/versions/3.11.9/lib/python3.11/site-packages/setuptools/_distutils/_modified.py", line 6, in <module>
        from jaraco.functools import splat
    ImportError: cannot import name 'splat' from 'jaraco.functools' (/opt/python/versions/3.11.9/lib/python3.11/site-packages/jaraco/functools.py)

Is this a known issue with Python 3.11.9?

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.