astral-sh / uv

An extremely fast Python package and project manager, written in Rust.
https://docs.astral.sh/uv
Apache License 2.0
26.13k stars 763 forks source link

uv run --with=pdbpp does not modify pdb as expected #8883

Open adamtheturtle opened 6 days ago

adamtheturtle commented 6 days ago

pdbpp is a replacement for pdb which is automatically used when it is installed and a pdb breakpoint is set.

Create a Python file with a breakpoint:

# example.py

breakpoint()

Run this (with echo "c" to exit the breakpoint) with pdbpp:

$ echo "c" | uv run --with=pdbpp example.py
--Return--
> /Users/adam/Desktop/uv-example/example.py(2)<module>()->None
-> breakpoint()
(Pdb) ⏎ 

We can see (Pdb) on the last line, which tells us that pdbpp is not being used.

To demonstrate what I expect, install pdbpp and then run the script:

$ uv pip install pdbpp
Resolved 6 packages in 15ms
Installed 1 package in 2ms
 + pdbpp==0.10.3
$ echo "c" | uv run example.py
--Return--
[0] > /Users/adam/Desktop/uv-example/example.py(2)<module>()->None
-> breakpoint()
(Pdb++) ⏎    

We can see (Pdb++) on the last line, which tells us that pdbpp is being used.

uv 0.4.30 (Homebrew 2024-11-05)
konstin commented 6 days ago

This is probably because pdbpp uses a .pth file, CC @zanieb.

zanieb commented 5 days ago

Interesting. Yeah it'd be good to support this, we'll probably need to dig into our virtual environment layering to fix it though.

jgehrcke commented 4 days ago

@adamtheturtle :turtle: exploring the pdb uv fun :heart: long time no see -- Hello!

(sorry for being offtopic here -- but this is too romantic to not say anything)