https://pantsbuild.org/ logo
#general
Title
# general
t

thousands-ability-24126

05/17/2022, 11:36 PM
Can I configure pants so
pants run
errors print the original source path in a Python stacktrace, instead of the
…/.pants.d/tmp…
source path?
./pants run
stack trace looks like:
Copy code
File "/Users/hawkeye/my_apps/.pants.d/tmpw_o_zgqz/./example/main.py", line 4, in <module>
    from module.lib import bar
ImportError: cannot import name 'bar' from 'module.lib' (/Users/hawkeye/my_apps/.pants.d/tmpw_o_zgqz/./module/lib/__init__.py)
But what I want is:
Copy code
File "/Users/hawkeye/my_apps/example/main.py", line 4, in <module>
    from module.lib import bar
ImportError: cannot import name 'bar' from 'module.lib' (/Users/hawkeye/my_apps/module/lib/__init__.py)
h

happy-kitchen-89482

05/18/2022, 12:12 AM
There's no way to do that right now AFAIK, but that would be a great feature to implement
👍 1
And probably not hard to do, could be a good first issue for a new contributor
h

hundreds-father-404

05/18/2022, 12:48 AM
t

thousands-ability-24126

05/18/2022, 4:24 PM
Got it, thanks for the info!
3 Views