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

[BUG] No filename and code hints in traceback #4815

Open
MarcinKonowalczyk opened this issue Jan 29, 2025 · 0 comments · May be fixed by #4816
Open

[BUG] No filename and code hints in traceback #4815

MarcinKonowalczyk opened this issue Jan 29, 2025 · 0 comments · May be fixed by #4816
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.

Comments

@MarcinKonowalczyk
Copy link

MarcinKonowalczyk commented Jan 29, 2025

setuptools version

setuptools==75.8.0

Python version

Python 3.14.0a4+ (heads/main:5c9a63f, Jan 29 2025, 12:10:34) [Clang 16.0.0 (clang-1600.0.26.6)] on darwin

Also tested on 3.12.3. I don't believe this is python-version specific.

OS

macOS

Additional environment information

No response

Description

I'm trying to install a package which has an error in its setup.py (see here if you want, but the details there are not important. ). The issue is that the filename and code hints do not show up in the traceback.

Expected behavior

Seeing filename and code hints in the traceback.

How to Reproduce

mkdir bad_package
cd bad_package
cat > setup.py << EOF
class BadPackageError(Exception):
    pass

def foo():
    raise BadPackageError("This package is bad")

def bar():
    foo()

def baz():
    bar()

baz()
EOF

pip install --no-build-isolation .

Output

Looking in indexes: https://pypi.org/simple
Processing ~/git/bad_package
  Preparing metadata (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Preparing metadata (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [20 lines of output]
      Traceback (most recent call last):
        File "~/.pyenv/versions/3.12.3/envs/default/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "~/.pyenv/versions/3.12.3/envs/default/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "~/.pyenv/versions/3.12.3/envs/default/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 149, in prepare_metadata_for_build_wheel
          return hook(metadata_directory, config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "~/.pyenv/versions/3.12.3/envs/default/lib/python3.12/site-packages/setuptools/build_meta.py", line 377, in prepare_metadata_for_build_wheel
          self.run_setup()
        File "~/.pyenv/versions/3.12.3/envs/default/lib/python3.12/site-packages/setuptools/build_meta.py", line 522, in run_setup
          super().run_setup(setup_script=setup_script)
        File "~/.pyenv/versions/3.12.3/envs/default/lib/python3.12/site-packages/setuptools/build_meta.py", line 320, in run_setup
          exec(code, locals())
        File "<string>", line 14, in <module>
        File "<string>", line 12, in baz
        File "<string>", line 9, in bar
        File "<string>", line 6, in foo
      BadPackageError: This package is bad
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
@MarcinKonowalczyk MarcinKonowalczyk added bug Needs Triage Issues that need to be evaluated for severity and status. labels Jan 29, 2025
@MarcinKonowalczyk MarcinKonowalczyk changed the title [BUG] [BUG] No filename and code hints in traceback Jan 29, 2025
@MarcinKonowalczyk MarcinKonowalczyk linked a pull request Jan 29, 2025 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Needs Triage Issues that need to be evaluated for severity and status.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant