pwntools
pwntools copied to clipboard
Use UV as a faster pip implementation
Closes #2490
Okay: for some reason this breaks PLT emulation (so unicorn?), breaks it consistently, and only breaks it on py3.10.
Why? No idea yet.
>>> import unicorn
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/.venv/lib/python3.10/site-packages/unicorn/__init__.py", line 4, in <module>
from .unicorn import Uc, ucsubclass, uc_version, uc_arch_supported, version_bind, debug, UcError, __version__
File "/.venv/lib/python3.10/site-packages/unicorn/unicorn.py", line 14, in <module>
from .unicorn_py3 import *
File "/.venv/lib/python3.10/site-packages/unicorn/unicorn_py3/__init__.py", line 1, in <module>
from .unicorn import *
File "/.venv/lib/python3.10/site-packages/unicorn/unicorn_py3/unicorn.py", line 236, in <module>
uclib = __load_uc_lib()
File "/.venv/lib/python3.10/site-packages/unicorn/unicorn_py3/unicorn.py", line 123, in __load_uc_lib
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
Okay, this is a thing probably on Unicorn's side: https://github.com/unicorn-engine/unicorn/pull/2122
Huh?
https://github.com/astral-sh/uv/blob/83f1b8b0f13713f2413ae9b96c64da0cedcf5fb8/crates/uv/src/commands/venv.rs#L354-L365
// Resolve the seed packages.
let requirements = if interpreter.python_tuple() >= (3, 12) {
vec![Requirement::from(
uv_pep508::Requirement::from_str("pip").unwrap(),
)]
} else {
// Include `setuptools` and `wheel` on Python <3.12.
vec![
Requirement::from(uv_pep508::Requirement::from_str("pip").unwrap()),
Requirement::from(uv_pep508::Requirement::from_str("setuptools").unwrap()),
Requirement::from(uv_pep508::Requirement::from_str("wheel").unwrap()),
]
};
It seems venv does seed itself, but not venv-less things.
Blocked: waiting for Unicorn 2.1.4.
Please fix git conflicts.
Note setup-uv@v6 brought a usability impairment (https://github.com/astral-sh/setup-uv/pull/381).
Nope, still blocked, waiting for unicorn 2.1.5 (2.1.4 has broken MIPS).
ModuleNotFoundError: No module named 'pkg_resources'
Some of the pkg_resources code is still available in modern setuptools.
% uvx --with=unicorn python3.14 -c 'import unicorn'
% uvx --with=setuptools,unicorn python3.14 -c 'import unicorn'