feat(spikes): run Phase 0 spike week, SP-1 through SP-6

18 fixtures (9 scenarios x 2 engines) plus a reproducible capture harness.
Findings written up in spikes/README.md and summarised in the ROADMAP
Phase 0 table. Verdict: GO for shipping both engines, but for a different
reason than the roadmap anticipated.

SP-1 asked whether uv's plan output is too lossy to ship uv in v1.0. The
question turned out to be the wrong shape. Neither engine holds packages
back on `install -U <pkg>` — seeded with httpx 0.23.0, which requires
httpcore<0.16, both pip and uv plan httpcore 1.0.9 and exit 0, silently
breaking it. Restating the installed set as explicit requirements is what
produces the correct held-back plan. That makes it a hard requirement on
both adapters, not an optimisation: without it PipDock would preview a
plan that breaks the environment. uv also writes its entire plan to
stderr, and its conflict attribution is markedly better than pip's — uv
names the exact blocking constraint where pip says only that versions
conflict.

SP-2 found a blocker. `pip install --dry-run --report -` crashes with
UnicodeEncodeError on Windows under cp1252, because pip routes the report
JSON through vendored rich and the console codec. Confirmed on pip 25.0.1
and 26.1.2, so it is current, not legacy. It is data-dependent — an
all-ASCII report succeeds — which means it would pass local testing and
fail on users' machines. PYTHONIOENCODING=utf-8 plus PYTHONUTF8=1 fixes
it, and the crash is kept as a fixture so a regression is recognisable.
Also: yanked releases exit 0 in both engines, so PD-PKG-003 belongs in
the preview as a warning rather than in the failure path the catalog
implies; and the two engines disagree on Requires-Python enforcement.

SP-3 passes: 858k projects, 2.95s cold refresh against a 60s budget,
42.1ms worst keystroke against 50ms. But only in memory — scanning
SQLite per keystroke costs 218ms, four times over. Two cautions recorded:
16% headroom on fast hardware is thin for the low-end VM the spike asked
about, and raw nucleo ranking puts requests-ntlm above requests, so the
Search screen needs an exact/prefix boost to be usable.

SP-4 confirms SECURITY section 6 as written: --path cannot combine with
--no-deps, so freeze-file mode is the only option for a foreign env.

SP-5 is answered by SP-1 — no engine reports held-back items at all, so
resolved version, latest version and blocker must all be derived by
PipDock, for pip as much as for uv.

SP-6 avoided two identity bugs. `uv python list` returns downloadable
entries and shims that duplicate real interpreters, and the same
interpreter reports different path casing depending on how it was
launched, so env_hash must lowercase on Windows or a single environment
silently splits its pins and snapshot history in two. Microsoft Store
Python is not installed here and remains unverified.

Four decisions are queued for the owner at the end of spikes/README.md;
two of them change adapter behaviour and should land before M1.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
poli0981andClaude Opus 5 committed 2026-07-27 18:04:37 +07:00
1 parent 8f6b7ed24b
commit ab4d55ea0c
60 files changed
+1908 -36

No files matched your search

+3
View File
@@ -41,3 +41,6 @@ tauri-signing-private.key*
# Logs & scratch
*.log
/spikes/out/
# Spike tooling venvs (SP-1 needs several uv versions side by side)
/spikes/.venv*/
@@ -0,0 +1,89 @@
//! SP-3 — fuzzy-search latency over the full PyPI name index.
//!
//! `spikes/sp3_index.py` measures the fetch and SQLite side and found that a **full column scan
//! costs ~218 ms**, four times the 50 ms per-keystroke budget in PRD §6. So the question this
//! example answers is not "is SQLite fast enough per keystroke" — it is not — but "does loading
//! the names into memory once and matching there fit the budget?"
//!
//! Run after `py -3.14 spikes/sp3_index.py`:
//!
//! ```text
//! cargo run --release --example sp3_search -- spikes/out/index.db
//! ```
// A measurement harness reports to a human on stdout; the library-level ban does not apply.
#![allow(clippy::print_stdout)]
use std::time::Instant;
use nucleo::Matcher;
use nucleo::pattern::{CaseMatching, Normalization, Pattern};
fn main() -> Result<(), Box<dyn std::error::Error>> {
let db_path = std::env::args()
.nth(1)
.unwrap_or_else(|| "spikes/out/index.db".into());
let conn = rusqlite::Connection::open(&db_path)?;
// Load once at startup, the way the real index module will.
let load_start = Instant::now();
let mut stmt = conn.prepare("SELECT normalized FROM names")?;
let names: Vec<String> = stmt
.query_map([], |row| row.get(0))?
.collect::<Result<_, _>>()?;
let load_ms = load_start.elapsed().as_secs_f64() * 1000.0;
println!(
"loaded {} names in {load_ms:.0} ms (once, at startup)",
names.len()
);
let mut matcher = Matcher::default();
let mut buf = Vec::new();
// Progressive typing: this is what the budget is actually about — the cost of each keystroke,
// including the single-character query that matches almost everything.
let queries = [
"r", "re", "req", "requ", "reque", "request", "requests", "numpy", "zope",
];
let mut worst: f64 = 0.0;
for query in queries {
let pattern = Pattern::parse(query, CaseMatching::Ignore, Normalization::Smart);
let start = Instant::now();
let mut scored: Vec<(u32, &str)> = names
.iter()
.filter_map(|name| {
buf.clear();
let haystack = nucleo::Utf32Str::new(name, &mut buf);
pattern
.score(haystack, &mut matcher)
.map(|s| (s, name.as_str()))
})
.collect();
// The UI shows a bounded list, so only the top slice is ordered.
scored.sort_unstable_by(|a, b| b.0.cmp(&a.0));
scored.truncate(50);
let ms = start.elapsed().as_secs_f64() * 1000.0;
worst = worst.max(ms);
let top = scored.first().map(|(_, n)| *n).unwrap_or("-");
println!(
" {query:<10} {ms:>7.1} ms matches shown: {:>2} top: {top}",
scored.len()
);
}
println!("\nworst keystroke: {worst:.1} ms vs the 50 ms budget in PRD §6");
println!(
"verdict: {}",
if worst < 50.0 {
"PASS"
} else {
"FAIL — needs prefilter"
}
);
Ok(())
}
@@ -0,0 +1,25 @@
{
"scenario": "build-backend-failure",
"question": "sdist build backend failure (PEP 517 backend unavailable).",
"expects_code": "PD-BLD-002",
"engine": "pip",
"engine_version": "pip 25.0.1 from C:\\Users\\Anon\\AppData\\Local\\Temp\\pd-pip-build-backend-failure-tykm5pzw\\venv\\Lib\\site-packages\\pip (python 3.12)",
"python": "Python 3.12.10",
"argv": [
"<TMP>\\pd-pip-build-backend-failure-tykm5pzw\\venv\\Scripts\\python.exe",
"-m",
"pip",
"install",
"-U",
"numpy==1.19.5"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 2,
"seed": [],
"seed_exit_code": null,
"stdout_bytes": 282,
"stderr_bytes": 7255
}
@@ -0,0 +1,82 @@
[notice] A new release of pip is available: 25.0.1 -> 26.1.2
[notice] To update, run: C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Scripts\python.exe -m pip install --upgrade pip
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\cli\base_command.py", line 106, in _run_wrapper
status = _inner_run()
^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\cli\base_command.py", line 97, in _inner_run
return self.run(options, args)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\cli\req_command.py", line 67, in wrapper
return func(self, options, args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\commands\install.py", line 386, in run
requirement_set = resolver.resolve(
^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\resolution\resolvelib\resolver.py", line 95, in resolve
result = self._result = resolver.resolve(
^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 546, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 397, in resolve
self._add_to_criteria(self.state.criteria, r, parent=None)
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_vendor\resolvelib\resolvers.py", line 173, in _add_to_criteria
if not criterion.candidates:
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_vendor\resolvelib\structs.py", line 156, in __bool__
return bool(self._sequence)
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 174, in __bool__
return any(self)
^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 162, in <genexpr>
return (c for c in iterator if id(c) not in self._incompatible_ids)
^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\resolution\resolvelib\found_candidates.py", line 53, in _iter_built
candidate = func()
^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 187, in _make_candidate_from_link
base: Optional[BaseCandidate] = self._make_base_candidate_from_link(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\resolution\resolvelib\factory.py", line 233, in _make_base_candidate_from_link
self._link_candidate_cache[link] = LinkCandidate(
^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 304, in __init__
super().__init__(
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 159, in __init__
self.dist = self._prepare()
^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 236, in _prepare
dist = self._prepare_distribution()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\resolution\resolvelib\candidates.py", line 315, in _prepare_distribution
return preparer.prepare_linked_requirement(self._ireq, parallel_builds=True)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\operations\prepare.py", line 527, in prepare_linked_requirement
return self._prepare_linked_requirement(req, parallel_builds)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\operations\prepare.py", line 642, in _prepare_linked_requirement
dist = _get_prepared_distribution(
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\operations\prepare.py", line 72, in _get_prepared_distribution
abstract_dist.prepare_distribution_metadata(
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\distributions\sdist.py", line 56, in prepare_distribution_metadata
self._install_build_reqs(finder)
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\distributions\sdist.py", line 126, in _install_build_reqs
build_reqs = self._get_build_requires_wheel()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\distributions\sdist.py", line 103, in _get_build_requires_wheel
return backend.get_requires_for_build_wheel()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_internal\utils\misc.py", line 702, in get_requires_for_build_wheel
return super().get_requires_for_build_wheel(config_settings=cs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_impl.py", line 196, in get_requires_for_build_wheel
return self._call_hook(
^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-build-backend-failure-tykm5pzw\venv\Lib\site-packages\pip\_vendor\pyproject_hooks\_impl.py", line 402, in _call_hook
raise BackendUnavailable(
pip._vendor.pyproject_hooks._impl.BackendUnavailable: Cannot import 'setuptools.build_meta'
@@ -0,0 +1,6 @@
Collecting numpy==1.19.5
Using cached numpy-1.19.5.zip (7.3 MB)
Installing build dependencies: started
Installing build dependencies: finished with status 'done'
Getting requirements to build wheel: started
Getting requirements to build wheel: finished with status 'done'
@@ -0,0 +1,31 @@
{
"scenario": "clean-upgrade",
"question": "Baseline: what does an unconstrained upgrade plan look like?",
"expects_code": null,
"engine": "pip",
"engine_version": "pip 25.0.1 from C:\\Users\\Anon\\AppData\\Local\\Temp\\pd-pip-clean-upgrade-enhq45pn\\venv\\Lib\\site-packages\\pip (python 3.12)",
"python": "Python 3.12.10",
"argv": [
"<TMP>\\pd-pip-clean-upgrade-enhq45pn\\venv\\Scripts\\python.exe",
"-m",
"pip",
"install",
"-U",
"--dry-run",
"--quiet",
"--report",
"-",
"idna"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 0,
"seed": [
"idna==3.4"
],
"seed_exit_code": 0,
"stdout_bytes": 7526,
"stderr_bytes": 203
}
@@ -0,0 +1,3 @@
[notice] A new release of pip is available: 25.0.1 -> 26.1.2
[notice] To update, run: C:\Users\Anon\AppData\Local\Temp\pd-pip-clean-upgrade-enhq45pn\venv\Scripts\python.exe -m pip install --upgrade pip
@@ -0,0 +1,80 @@
{
"version": "1",
"pip_version": "25.0.1",
"install": [
{
"download_info": {
"url": "https://files.pythonhosted.org/packages/1e/5e/d4e9f1a599fb8e573b7b87160658329fbf28d19eac2718f51fc3def3aa5a/idna-3.18-py3-none-any.whl",
"archive_info": {
"hash": "sha256=7f952cbe720b688055e3f87de14f5c3e5fdaa8bc3928985c4077ca689de849a2",
"hashes": {
"sha256": "7f952cbe720b688055e3f87de14f5c3e5fdaa8bc3928985c4077ca689de849a2"
}
}
},
"is_direct": false,
"is_yanked": false,
"requested": true,
"metadata": {
"metadata_version": "2.4",
"name": "idna",
"version": "3.18",
"summary": "Internationalized Domain Names in Applications (IDNA)",
"description": "# Internationalized Domain Names in Applications (IDNA)\n\nSupport for [Internationalized Domain Names in Applications\n(IDNA)](https://tools.ietf.org/html/rfc5891) and [Unicode IDNA\nCompatibility Processing](https://unicode.org/reports/tr46/). It\nsupersedes the standard library's `encodings.idna`, which only\nimplements the 2003 specification, offering broader script coverage and\nlimiting domains with known security vulnerabilities.\n\n## Usage\n\nPackage may be installed from [PyPI](https://pypi.org/project/idna/) via\nthe typical methods (e.g. `python3 -m pip install idna`)\n\nFor typical usage, the `encode` and `decode` functions will take a\ndomain name argument and perform a conversion to ASCII-compatible encoding\n(known as A-labels), or to Unicode strings (known as U-labels)\nrespectively.\n\n```pycon\n>>> import idna\n>>> idna.encode('ドメイン.テスト')\nb'xn--eckwd4c7c.xn--zckzah'\n>>> print(idna.decode('xn--eckwd4c7c.xn--zckzah'))\nドメイン.テスト\n```\n\nConversions can be applied at a per-label basis using the `ulabel` or\n`alabel` functions for specialized use cases.\n\n\n### Compatibility Mapping (UTS #46)\n\nThis library provides support for [Unicode IDNA Compatibility\nProcessing](https://unicode.org/reports/tr46/) which normalizes input from\ndifferent potential ways a user may input a domain prior to performing the IDNA\nconversion operations. This functionality, known as a\n[mapping](https://tools.ietf.org/html/rfc5895), is considered by the\nspecification to be a local user-interface issue distinct from IDNA\nconversion functionality.\n\nFor example, \"Königsgäßchen\" is not a permissible label as capital letters\nare not allowed. UTS 46 will convert this into lower case prior to applying\nthe IDNA conversion.\n\n```pycon\n>>> import idna\n>>> idna.encode('Königsgäßchen')\n...\nidna.core.InvalidCodepoint: Codepoint U+004B at position 1 of 'Königsgäßchen' not allowed\n>>> idna.encode('Königsgäßchen', uts46=True)\nb'xn--knigsgchen-b4a3dun'\n>>> idna.decode('xn--knigsgchen-b4a3dun')\n'königsgäßchen'\n```\n\nWhen performing a decode operation for display purposes, `decode()`\naccepts a `display=True` argument that leaves any `xn--` label that\nfails to decode unchanged. This is useful for user interface display\nwhere a domain is in use, the A-label form can be presented when it\nis not a valid IDN.\n\n\n## Exceptions\n\nAll errors raised during conversion derive from the `idna.IDNAError`\nbase class. The more specific exceptions are:\n\n* `idna.IDNABidiError` — raised when a label contains an illegal\n combination of left-to-right and right-to-left characters.\n* `idna.InvalidCodepoint` — raised when a label contains a codepoint\n that is INVALID for IDNA.\n* `idna.InvalidCodepointContext` — raised when a CONTEXTO or CONTEXTJ\n codepoint appears in a position whose contextual requirements are\n not satisfied.\n\n\n## Command-line tool\n\nThe package supports command-line usage to convert domain names\nbetween their Unicode and ASCII-compatible forms. It can be run either\nas a module (`python3 -m idna`) or, once installed (such as with `uv\ntool` or `pipx`), via the `idna` script:\n\n```bash\n$ uv tool install idna\n$ idna xn--e1afmkfd.xn--p1ai\nпример.рф\n$ idna пример.рф\nxn--e1afmkfd.xn--p1ai\n```\n\nMode can be specified with `-e`/`--encode` or `-d`/`--decode`, otherwise\nit will be chosen automatically based on the first input. Multiple\ndomains can be supplied either as arguments or through standard input.\nUTS #46 mapping is applied by default, which lets the tool accept\ninputs that aren't strictly valid IDNA 2008 by normalising them first,\npass `--strict` to disable UTS #46.\n\nConversion failures are reported on stderr together with the\noffending input; processing continues with the remaining domains and\nthe tool exits with a non-zero status if any conversion failed.\n\n\n## Additional Notes\n\n* **Version support**. This library supports Python 3.9 and higher.\n As this library serves as a low-level toolkit for a variety of\n applications, we strive to support all versions of Python that are\n not beyond end-of-life.\n\n* **Emoji**. It is an occasional request to support emoji domains in\n this library. Encoding of symbols like emoji is expressly prohibited by\n the IDNA technical standard, and emoji domains are broadly phased\n out across the domain industry due to associated security risks.\n\n* **Regenerating lookup tables**. The IDNA and UTS 46 functionality\n relies upon pre-calculated lookup tables, generated using the\n `idna-data` script in [`tools/`](tools/README.md).\n\n",
"description_content_type": "text/markdown",
"author_email": "Kim Davies <kim+pypi@gumleaf.org>",
"license_expression": "BSD-3-Clause",
"license_file": [
"LICENSE.md"
],
"classifier": [
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"Intended Audience :: System Administrators",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: 3.14",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: Name Service (DNS)",
"Topic :: Software Development :: Libraries :: Python Modules",
"Topic :: Utilities"
],
"requires_dist": [
"ruff >= 0.6.2 ; extra == \"all\"",
"mypy >= 1.11.2 ; extra == \"all\"",
"pytest >= 8.3.2 ; extra == \"all\""
],
"requires_python": ">=3.9",
"project_url": [
"Changelog, https://github.com/kjd/idna/blob/master/HISTORY.md",
"Issue tracker, https://github.com/kjd/idna/issues",
"Source, https://github.com/kjd/idna"
],
"provides_extra": [
"all"
]
}
}
],
"environment": {
"implementation_name": "cpython",
"implementation_version": "3.12.10",
"os_name": "nt",
"platform_machine": "AMD64",
"platform_release": "11",
"platform_system": "Windows",
"platform_version": "10.0.26300",
"python_full_version": "3.12.10",
"platform_python_implementation": "CPython",
"python_version": "3.12",
"sys_platform": "win32"
}
}
@@ -0,0 +1,32 @@
{
"scenario": "held-back-constrained",
"question": "SP-1 follow-up: does restating the installed set as explicit requirements make the resolver hold httpcore back to 0.15.x instead of breaking httpx? This decides whether PipDock must pass the full installed set on every plan.",
"expects_code": null,
"engine": "pip",
"engine_version": "pip 25.0.1 from C:\\Users\\Anon\\AppData\\Local\\Temp\\pd-pip-held-back-constrained-c9qurkon\\venv\\Lib\\site-packages\\pip (python 3.12)",
"python": "Python 3.12.10",
"argv": [
"<TMP>\\pd-pip-held-back-constrained-c9qurkon\\venv\\Scripts\\python.exe",
"-m",
"pip",
"install",
"-U",
"--dry-run",
"--quiet",
"--report",
"-",
"httpcore",
"httpx==0.23.0"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 0,
"seed": [
"httpx==0.23.0"
],
"seed_exit_code": 0,
"stdout_bytes": 469,
"stderr_bytes": 211
}
@@ -0,0 +1,3 @@
[notice] A new release of pip is available: 25.0.1 -> 26.1.2
[notice] To update, run: C:\Users\Anon\AppData\Local\Temp\pd-pip-held-back-constrained-c9qurkon\venv\Scripts\python.exe -m pip install --upgrade pip
@@ -0,0 +1,18 @@
{
"version": "1",
"pip_version": "25.0.1",
"install": [],
"environment": {
"implementation_name": "cpython",
"implementation_version": "3.12.10",
"os_name": "nt",
"platform_machine": "AMD64",
"platform_release": "11",
"platform_system": "Windows",
"platform_version": "10.0.26300",
"python_full_version": "3.12.10",
"platform_python_implementation": "CPython",
"python_version": "3.12",
"sys_platform": "win32"
}
}
@@ -0,0 +1,31 @@
{
"scenario": "held-back",
"question": "SP-1 core question: httpx 0.23.0 requires httpcore<0.16, so httpcore cannot reach its 1.x latest. Does the engine name httpx as the blocker, or only report the resolved version? ANSWER: neither \u2014 both engines ignore the installed httpx entirely and plan httpcore 1.0.9, silently breaking it. Exit 0.",
"expects_code": null,
"engine": "pip",
"engine_version": "pip 25.0.1 from C:\\Users\\Anon\\AppData\\Local\\Temp\\pd-pip-held-back-mm7fn80i\\venv\\Lib\\site-packages\\pip (python 3.12)",
"python": "Python 3.12.10",
"argv": [
"<TMP>\\pd-pip-held-back-mm7fn80i\\venv\\Scripts\\python.exe",
"-m",
"pip",
"install",
"-U",
"--dry-run",
"--quiet",
"--report",
"-",
"httpcore"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 0,
"seed": [
"httpx==0.23.0"
],
"seed_exit_code": 0,
"stdout_bytes": 32856,
"stderr_bytes": 199
}
@@ -0,0 +1,3 @@
[notice] A new release of pip is available: 25.0.1 -> 26.1.2
[notice] To update, run: C:\Users\Anon\AppData\Local\Temp\pd-pip-held-back-mm7fn80i\venv\Scripts\python.exe -m pip install --upgrade pip
@@ -0,0 +1,139 @@
{
"version": "1",
"pip_version": "25.0.1",
"install": [
{
"download_info": {
"url": "https://files.pythonhosted.org/packages/7e/f5/f66802a942d491edb555dd61e3a9961140fd64c90bce1eafd741609d334d/httpcore-1.0.9-py3-none-any.whl",
"archive_info": {
"hash": "sha256=2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55",
"hashes": {
"sha256": "2d400746a40668fc9dec9810239072b40b4484b640a8c38fd654a024c7a1bf55"
}
}
},
"is_direct": false,
"is_yanked": false,
"requested": true,
"metadata": {
"metadata_version": "2.4",
"name": "httpcore",
"version": "1.0.9",
"summary": "A minimal low-level HTTP client.",
"description": "# HTTP Core\n\n[![Test Suite](https://github.com/encode/httpcore/workflows/Test%20Suite/badge.svg)](https://github.com/encode/httpcore/actions)\n[![Package version](https://badge.fury.io/py/httpcore.svg)](https://pypi.org/project/httpcore/)\n\n> *Do one thing, and do it well.*\n\nThe HTTP Core package provides a minimal low-level HTTP client, which does\none thing only. Sending HTTP requests.\n\nIt does not provide any high level model abstractions over the API,\ndoes not handle redirects, multipart uploads, building authentication headers,\ntransparent HTTP caching, URL parsing, session cookie handling,\ncontent or charset decoding, handling JSON, environment based configuration\ndefaults, or any of that Jazz.\n\nSome things HTTP Core does do:\n\n* Sending HTTP requests.\n* Thread-safe / task-safe connection pooling.\n* HTTP(S) proxy & SOCKS proxy support.\n* Supports HTTP/1.1 and HTTP/2.\n* Provides both sync and async interfaces.\n* Async backend support for `asyncio` and `trio`.\n\n## Requirements\n\nPython 3.8+\n\n## Installation\n\nFor HTTP/1.1 only support, install with:\n\n```shell\n$ pip install httpcore\n```\n\nThere are also a number of optional extras available...\n\n```shell\n$ pip install httpcore['asyncio,trio,http2,socks']\n```\n\n## Sending requests\n\nSend an HTTP request:\n\n```python\nimport httpcore\n\nresponse = httpcore.request(\"GET\", \"https://www.example.com/\")\n\nprint(response)\n# <Response [200]>\nprint(response.status)\n# 200\nprint(response.headers)\n# [(b'Accept-Ranges', b'bytes'), (b'Age', b'557328'), (b'Cache-Control', b'max-age=604800'), ...]\nprint(response.content)\n# b'<!doctype html>\\n<html>\\n<head>\\n<title>Example Domain</title>\\n\\n<meta charset=\"utf-8\"/>\\n ...'\n```\n\nThe top-level `httpcore.request()` function is provided for convenience. In practice whenever you're working with `httpcore` you'll want to use the connection pooling functionality that it provides.\n\n```python\nimport httpcore\n\nhttp = httpcore.ConnectionPool()\nresponse = http.request(\"GET\", \"https://www.example.com/\")\n```\n\nOnce you're ready to get going, [head over to the documentation](https://www.encode.io/httpcore/).\n\n## Motivation\n\nYou *probably* don't want to be using HTTP Core directly. It might make sense if\nyou're writing something like a proxy service in Python, and you just want\nsomething at the lowest possible level, but more typically you'll want to use\na higher level client library, such as `httpx`.\n\nThe motivation for `httpcore` is:\n\n* To provide a reusable low-level client library, that other packages can then build on top of.\n* To provide a *really clear interface split* between the networking code and client logic,\n so that each is easier to understand and reason about in isolation.\n\n## Dependencies\n\nThe `httpcore` package has the following dependencies...\n\n* `h11`\n* `certifi`\n\nAnd the following optional extras...\n\n* `anyio` - Required by `pip install httpcore['asyncio']`.\n* `trio` - Required by `pip install httpcore['trio']`.\n* `h2` - Required by `pip install httpcore['http2']`.\n* `socksio` - Required by `pip install httpcore['socks']`.\n\n## Versioning\n\nWe use [SEMVER for our versioning policy](https://semver.org/).\n\nFor changes between package versions please see our [project changelog](CHANGELOG.md).\n\nWe recommend pinning your requirements either the most current major version, or a more specific version range:\n\n```python\npip install 'httpcore==1.*'\n```\n# Changelog\n\nAll notable changes to this project will be documented in this file.\n\nThe format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).\n\n## Version 1.0.9 (April 24th, 2025)\n\n- Resolve https://github.com/advisories/GHSA-vqfr-h8mv-ghfj with h11 dependency update. (#1008)\n\n## Version 1.0.8 (April 11th, 2025)\n\n- Fix `AttributeError` when importing on Python 3.14. (#1005)\n\n## Version 1.0.7 (November 15th, 2024)\n\n- Support `proxy=…` configuration on `ConnectionPool()`. (#974)\n\n## Version 1.0.6 (October 1st, 2024)\n\n- Relax `trio` dependency pinning. (#956)\n- Handle `trio` raising `NotImplementedError` on unsupported platforms. (#955)\n- Handle mapping `ssl.SSLError` to `httpcore.ConnectError`. (#918)\n\n## 1.0.5 (March 27th, 2024)\n\n- Handle `EndOfStream` exception for anyio backend. (#899)\n- Allow trio `0.25.*` series in package dependancies. (#903)\n\n## 1.0.4 (February 21st, 2024)\n\n- Add `target` request extension. (#888)\n- Fix support for connection `Upgrade` and `CONNECT` when some data in the stream has been read. (#882)\n\n## 1.0.3 (February 13th, 2024)\n\n- Fix support for async cancellations. (#880)\n- Fix trace extension when used with socks proxy. (#849)\n- Fix SSL context for connections using the \"wss\" scheme (#869)\n\n## 1.0.2 (November 10th, 2023)\n\n- Fix `float(\"inf\")` timeouts in `Event.wait` function. (#846)\n\n## 1.0.1 (November 3rd, 2023)\n\n- Fix pool timeout to account for Line truncated
"description_content_type": "text/markdown",
"author_email": "Tom Christie <tom@tomchristie.com>",
"license_expression": "BSD-3-Clause",
"license_file": [
"LICENSE.md"
],
"classifier": [
"Development Status :: 3 - Alpha",
"Environment :: Web Environment",
"Framework :: AsyncIO",
"Framework :: Trio",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP"
],
"requires_dist": [
"certifi",
"h11>=0.16",
"anyio<5.0,>=4.0; extra == 'asyncio'",
"h2<5,>=3; extra == 'http2'",
"socksio==1.*; extra == 'socks'",
"trio<1.0,>=0.22.0; extra == 'trio'"
],
"requires_python": ">=3.8",
"project_url": [
"Documentation, https://www.encode.io/httpcore",
"Homepage, https://www.encode.io/httpcore/",
"Source, https://github.com/encode/httpcore"
],
"provides_extra": [
"asyncio",
"http2",
"socks",
"trio"
]
}
},
{
"download_info": {
"url": "https://files.pythonhosted.org/packages/04/4b/29cac41a4d98d144bf5f6d33995617b185d14b22401f75ca86f384e87ff1/h11-0.16.0-py3-none-any.whl",
"archive_info": {
"hash": "sha256=63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86",
"hashes": {
"sha256": "63cf8bbe7522de3bf65932fda1d9c2772064ffb3dae62d55932da54b31cb6c86"
}
}
},
"is_direct": false,
"is_yanked": false,
"requested": false,
"metadata": {
"metadata_version": "2.4",
"name": "h11",
"version": "0.16.0",
"dynamic": [
"author",
"author-email",
"classifier",
"description",
"home-page",
"license",
"license-file",
"requires-python",
"summary"
],
"summary": "A pure-Python, bring-your-own-I/O implementation of HTTP/1.1",
"description": "h11\n===\n\n.. image:: https://travis-ci.org/python-hyper/h11.svg?branch=master\n :target: https://travis-ci.org/python-hyper/h11\n :alt: Automated test status\n\n.. image:: https://codecov.io/gh/python-hyper/h11/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/python-hyper/h11\n :alt: Test coverage\n\n.. image:: https://readthedocs.org/projects/h11/badge/?version=latest\n :target: http://h11.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\nThis is a little HTTP/1.1 library written from scratch in Python,\nheavily inspired by `hyper-h2 <https://hyper-h2.readthedocs.io/>`_.\n\nIt's a \"bring-your-own-I/O\" library; h11 contains no IO code\nwhatsoever. This means you can hook h11 up to your favorite network\nAPI, and that could be anything you want: synchronous, threaded,\nasynchronous, or your own implementation of `RFC 6214\n<https://tools.ietf.org/html/rfc6214>`_ -- h11 won't judge you.\n(Compare this to the current state of the art, where every time a `new\nnetwork API <https://trio.readthedocs.io/>`_ comes along then someone\ngets to start over reimplementing the entire HTTP protocol from\nscratch.) Cory Benfield made an `excellent blog post describing the\nbenefits of this approach\n<https://lukasa.co.uk/2015/10/The_New_Hyper/>`_, or if you like video\nthen here's his `PyCon 2016 talk on the same theme\n<https://www.youtube.com/watch?v=7cC3_jGwl_U>`_.\n\nThis also means that h11 is not immediately useful out of the box:\nit's a toolkit for building programs that speak HTTP, not something\nthat could directly replace ``requests`` or ``twisted.web`` or\nwhatever. But h11 makes it much easier to implement something like\n``requests`` or ``twisted.web``.\n\nAt a high level, working with h11 goes like this:\n\n1) First, create an ``h11.Connection`` object to track the state of a\n single HTTP/1.1 connection.\n\n2) When you read data off the network, pass it to\n ``conn.receive_data(...)``; you'll get back a list of objects\n representing high-level HTTP \"events\".\n\n3) When you want to send a high-level HTTP event, create the\n corresponding \"event\" object and pass it to ``conn.send(...)``;\n this will give you back some bytes that you can then push out\n through the network.\n\nFor example, a client might instantiate and then send a\n``h11.Request`` object, then zero or more ``h11.Data`` objects for the\nrequest body (e.g., if this is a POST), and then a\n``h11.EndOfMessage`` to indicate the end of the message. Then the\nserver would then send back a ``h11.Response``, some ``h11.Data``, and\nits own ``h11.EndOfMessage``. If either side violates the protocol,\nyou'll get a ``h11.ProtocolError`` exception.\n\nh11 is suitable for implementing both servers and clients, and has a\npleasantly symmetric API: the events you send as a client are exactly\nthe ones that you receive as a server and vice-versa.\n\n`Here's an example of a tiny HTTP client\n<https://github.com/python-hyper/h11/blob/master/examples/basic-client.py>`_\n\nIt also has `a fine manual <https://h11.readthedocs.io/>`_.\n\nFAQ\n---\n\n*Whyyyyy?*\n\nI wanted to play with HTTP in `Curio\n<https://curio.readthedocs.io/en/latest/tutorial.html>`__ and `Trio\n<https://trio.readthedocs.io>`__, which at the time didn't have any\nHTTP libraries. So I thought, no big deal, Python has, like, a dozen\ndifferent implementations of HTTP, surely I can find one that's\nreusable. I didn't find one, but I did find Cory's call-to-arms\nblog-post. So I figured, well, fine, if I have to implement HTTP from\nscratch, at least I can make sure no-one *else* has to ever again.\n\n*Should I use it?*\n\nMaybe. You should be aware that it's a very young project. But, it's\nfeature complete and has an exhaustive test-suite and complete docs,\nso the next step is for people to try using it and see how it goes\n:-). If you do then please let us know -- if nothing else we'll want\nto talk to you before making any incompatible changes!\n\n*What are the features/limitations?*\n\nRoughly speaking, it's trying to be a robust, complete, and non-hacky\nimplementation of the first \"chapter\" of the HTTP/1.1 spec: `RFC 7230:\nHTTP/1.1 Message Syntax and Routing\n<https://tools.ietf.org/html/rfc7230>`_. That is, it mostly focuses on\nimplementing HTTP at the level of taking bytes on and off the wire,\nand the headers related to that, and tries to be anal about spec\nconformance. It doesn't know about higher-level concerns like URL\nrouting, conditional GETs, cross-origin cookie policies, or content\nnegotiation. But it does know how to take care of framing,\ncross-version differences in keep-alive handling, and the \"obsolete\nline folding\" rule, so you can focus your energies on the hard /\ninteresting parts for your application, and it tries to support the\nfull specification in the sense that any useful HTTP/1.1 conformant\napplication should be able to use h11.\n\nIt's pure Python, and has no dLine truncated
"home_page": "https://github.com/python-hyper/h11",
"author": "Nathaniel J. Smith",
"author_email": "njs@pobox.com",
"license": "MIT",
"license_file": [
"LICENSE.txt"
],
"classifier": [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Topic :: Internet :: WWW/HTTP",
"Topic :: System :: Networking"
],
"requires_python": ">=3.8"
}
}
],
"environment": {
"implementation_name": "cpython",
"implementation_version": "3.12.10",
"os_name": "nt",
"platform_machine": "AMD64",
"platform_release": "11",
"platform_system": "Windows",
"platform_version": "10.0.26300",
"python_full_version": "3.12.10",
"platform_python_implementation": "CPython",
"python_version": "3.12",
"sys_platform": "win32"
}
}
@@ -0,0 +1,32 @@
{
"scenario": "impossible",
"question": "Unsatisfiable set: how is ResolutionImpossible reported and is it attributable?",
"expects_code": "PD-RES-001",
"engine": "pip",
"engine_version": "pip 25.0.1 from C:\\Users\\Anon\\AppData\\Local\\Temp\\pd-pip-impossible-6ja7hyci\\venv\\Lib\\site-packages\\pip (python 3.12)",
"python": "Python 3.12.10",
"argv": [
"<TMP>\\pd-pip-impossible-6ja7hyci\\venv\\Scripts\\python.exe",
"-m",
"pip",
"install",
"-U",
"--dry-run",
"--quiet",
"--report",
"-",
"httpcore>=1.0",
"httpx==0.23.0"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 1,
"seed": [
"httpx==0.23.0"
],
"seed_exit_code": 0,
"stdout_bytes": 0,
"stderr_bytes": 454
}
@@ -0,0 +1,5 @@
ERROR: Cannot install httpcore>=1.0 and httpx==0.23.0 because these package versions have conflicting dependencies.
[notice] A new release of pip is available: 25.0.1 -> 26.1.2
[notice] To update, run: C:\Users\Anon\AppData\Local\Temp\pd-pip-impossible-6ja7hyci\venv\Scripts\python.exe -m pip install --upgrade pip
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts
Whitespace-only changes.
@@ -0,0 +1,29 @@
{
"scenario": "not-found",
"question": "Unknown distribution name.",
"expects_code": "PD-PKG-002",
"engine": "pip",
"engine_version": "pip 25.0.1 from C:\\Users\\Anon\\AppData\\Local\\Temp\\pd-pip-not-found-kac3nuir\\venv\\Lib\\site-packages\\pip (python 3.12)",
"python": "Python 3.12.10",
"argv": [
"<TMP>\\pd-pip-not-found-kac3nuir\\venv\\Scripts\\python.exe",
"-m",
"pip",
"install",
"-U",
"--dry-run",
"--quiet",
"--report",
"-",
"pipdock-no-such-package-9f3a2b"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 1,
"seed": [],
"seed_exit_code": null,
"stdout_bytes": 0,
"stderr_bytes": 388
}
@@ -0,0 +1,5 @@
ERROR: Could not find a version that satisfies the requirement pipdock-no-such-package-9f3a2b (from versions: none)
[notice] A new release of pip is available: 25.0.1 -> 26.1.2
[notice] To update, run: C:\Users\Anon\AppData\Local\Temp\pd-pip-not-found-kac3nuir\venv\Scripts\python.exe -m pip install --upgrade pip
ERROR: No matching distribution found for pipdock-no-such-package-9f3a2b
Whitespace-only changes.
@@ -0,0 +1,28 @@
{
"scenario": "report-encoding-crash",
"question": "Evidence for the pip --report UnicodeEncodeError on Windows/cp1252. Kept as a fixture so a regression in the UTF-8 mitigation is recognisable.",
"expects_code": null,
"engine": "pip",
"engine_version": "pip 25.0.1 from C:\\Users\\Anon\\AppData\\Local\\Temp\\pd-pip-report-encoding-crash-h4_safl0\\venv\\Lib\\site-packages\\pip (python 3.12)",
"python": "Python 3.12.10",
"argv": [
"<TMP>\\pd-pip-report-encoding-crash-h4_safl0\\venv\\Scripts\\python.exe",
"-m",
"pip",
"install",
"-U",
"--dry-run",
"--quiet",
"--report",
"-",
"idna"
],
"extra_env": null,
"exit_code": 2,
"seed": [
"idna==3.4"
],
"seed_exit_code": 0,
"stdout_bytes": 788,
"stderr_bytes": 3419
}
@@ -0,0 +1,41 @@
[notice] A new release of pip is available: 25.0.1 -> 26.1.2
[notice] To update, run: C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Scripts\python.exe -m pip install --upgrade pip
ERROR: Exception:
Traceback (most recent call last):
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_internal\cli\base_command.py", line 106, in _run_wrapper
status = _inner_run()
^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_internal\cli\base_command.py", line 97, in _inner_run
return self.run(options, args)
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_internal\cli\req_command.py", line 67, in wrapper
return func(self, options, args)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_internal\commands\install.py", line 393, in run
print_json(data=report.to_dict())
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_vendor\rich\__init__.py", line 106, in print_json
get_console().print_json(
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_vendor\rich\console.py", line 1787, in print_json
self.print(json_renderable, soft_wrap=True)
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_vendor\rich\console.py", line 1678, in print
with self:
^^^^
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_vendor\rich\console.py", line 864, in __exit__
self._exit_buffer()
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_vendor\rich\console.py", line 822, in _exit_buffer
self._check_buffer()
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_vendor\rich\console.py", line 2019, in _check_buffer
self._write_buffer()
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_vendor\rich\console.py", line 2055, in _write_buffer
legacy_windows_render(buffer, LegacyWindowsTerm(self.file))
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_vendor\rich\_windows_renderer.py", line 17, in legacy_windows_render
term.write_styled(text, style)
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_vendor\rich\_win32_console.py", line 441, in write_styled
self.write_text(text)
File "C:\Users\Anon\AppData\Local\Temp\pd-pip-report-encoding-crash-h4_safl0\venv\Lib\site-packages\pip\_vendor\rich\_win32_console.py", line 402, in write_text
self.write(text)
File "C:\Users\Anon\AppData\Local\Programs\Python\Python312\Lib\encodings\cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeEncodeError: 'charmap' codec can't encode characters in position 860-863: character maps to <undefined>
@@ -0,0 +1,23 @@
{
"version": "1",
"pip_version": "25.0.1",
"install": [
{
"download_info": {
"url": "https://files.pythonhosted.org/packages/1e/5e/d4e9f1a599fb8e573b7b87160658329fbf28d19eac2718f51fc3def3aa5a/idna-3.18-py3-none-any.whl",
"archive_info": {
"hash": "sha256=7f952cbe720b688055e3f87de14f5c3e5fdaa8bc3928985c4077ca689de849a2",
"hashes": {
"sha256": "7f952cbe720b688055e3f87de14f5c3e5fdaa8bc3928985c4077ca689de849a2"
}
}
},
"is_direct": false,
"is_yanked": false,
"requested": true,
"metadata": {
"metadata_version": "2.4",
"name": "idna",
"version": "3.18",
"summary": "Internationalized Domain Names in Applications (IDNA)",
"description":
@@ -0,0 +1,29 @@
{
"scenario": "requires-python",
"question": "Requires-Python mismatch against the running interpreter.",
"expects_code": "PD-PKG-001",
"engine": "pip",
"engine_version": "pip 25.0.1 from C:\\Users\\Anon\\AppData\\Local\\Temp\\pd-pip-requires-python-j_rytfff\\venv\\Lib\\site-packages\\pip (python 3.12)",
"python": "Python 3.12.10",
"argv": [
"<TMP>\\pd-pip-requires-python-j_rytfff\\venv\\Scripts\\python.exe",
"-m",
"pip",
"install",
"-U",
"--dry-run",
"--quiet",
"--report",
"-",
"scipy==1.7.3"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 1,
"seed": [],
"seed_exit_code": null,
"stdout_bytes": 0,
"stderr_bytes": 1066
}
@@ -0,0 +1,6 @@
ERROR: Ignored the following yanked versions: 1.11.0, 1.14.0rc1
ERROR: Could not find a version that satisfies the requirement scipy==1.7.3 (from versions: 0.8.0, 0.9.0, 0.10.0, 0.10.1, 0.11.0, 0.12.0, 0.12.1, 0.13.0, 0.13.1, 0.13.2, 0.13.3, 0.14.0, 0.14.1, 0.15.0, 0.15.1, 0.16.0, 0.16.1, 0.17.0, 0.17.1, 0.18.0, 0.18.1, 0.19.0, 0.19.1, 1.0.0, 1.0.1, 1.1.0, 1.2.0, 1.2.1, 1.2.2, 1.2.3, 1.3.0, 1.3.1, 1.3.2, 1.3.3, 1.4.0, 1.4.1, 1.5.0, 1.5.1, 1.5.2, 1.5.3, 1.5.4, 1.6.0, 1.6.1, 1.9.2, 1.9.3, 1.11.0rc1, 1.11.0rc2, 1.11.1, 1.11.2, 1.11.3, 1.11.4, 1.12.0rc1, 1.12.0rc2, 1.12.0, 1.13.0rc1, 1.13.0, 1.13.1, 1.14.0rc2, 1.14.0, 1.14.1, 1.15.0rc1, 1.15.0rc2, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.16.0rc1, 1.16.0rc2, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.17.0rc1, 1.17.0rc2, 1.17.0, 1.17.1, 1.18.0rc1, 1.18.0rc2, 1.18.0)
[notice] A new release of pip is available: 25.0.1 -> 26.1.2
[notice] To update, run: C:\Users\Anon\AppData\Local\Temp\pd-pip-requires-python-j_rytfff\venv\Scripts\python.exe -m pip install --upgrade pip
ERROR: No matching distribution found for scipy==1.7.3
Whitespace-only changes.
+29
View File
@@ -0,0 +1,29 @@
{
"scenario": "yanked",
"question": "Yanked release explicitly requested. Does the engine flag the yank, and where \u2014 structured field or stderr text?",
"expects_code": "PD-PKG-003",
"engine": "pip",
"engine_version": "pip 25.0.1 from C:\\Users\\Anon\\AppData\\Local\\Temp\\pd-pip-yanked-id7w4uu1\\venv\\Lib\\site-packages\\pip (python 3.12)",
"python": "Python 3.12.10",
"argv": [
"<TMP>\\pd-pip-yanked-id7w4uu1\\venv\\Scripts\\python.exe",
"-m",
"pip",
"install",
"-U",
"--dry-run",
"--quiet",
"--report",
"-",
"urllib3==2.0.0"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 0,
"seed": [],
"seed_exit_code": null,
"stdout_bytes": 8246,
"stderr_bytes": 685
}
@@ -0,0 +1,5 @@
WARNING: The candidate selected for download or install is a yanked version: 'urllib3' candidate (version 2.0.0 at https://files.pythonhosted.org/packages/ca/25/fe81738a115a2f1005b19bd69b6253b7b5cd6c9119164f13f02ec627fc41/urllib3-2.0.0-py3-none-any.whl (from https://pypi.org/simple/urllib3/) (requires-python:>=3.7))
Reason for being yanked: Truncated response bodies when streaming a large compressed body. Upgrade to at least 2.0.2 (See: https://github.com/urllib3/urllib3/issues/3009)
[notice] A new release of pip is available: 25.0.1 -> 26.1.2
[notice] To update, run: C:\Users\Anon\AppData\Local\Temp\pd-pip-yanked-id7w4uu1\venv\Scripts\python.exe -m pip install --upgrade pip
@@ -0,0 +1,99 @@
{
"version": "1",
"pip_version": "25.0.1",
"install": [
{
"download_info": {
"url": "https://files.pythonhosted.org/packages/ca/25/fe81738a115a2f1005b19bd69b6253b7b5cd6c9119164f13f02ec627fc41/urllib3-2.0.0-py3-none-any.whl",
"archive_info": {
"hash": "sha256=8f7f917bc6ff1c021c4b7b677229c455a7612878748581f6de39fd45e4fa21ae",
"hashes": {
"sha256": "8f7f917bc6ff1c021c4b7b677229c455a7612878748581f6de39fd45e4fa21ae"
}
}
},
"is_direct": false,
"is_yanked": true,
"requested": true,
"metadata": {
"metadata_version": "2.1",
"name": "urllib3",
"version": "2.0.0",
"summary": "HTTP library with thread-safe connection pooling, file post, and more.",
"description": "<h1 align=\"center\">\n\n![urllib3](https://github.com/urllib3/urllib3/raw/main/docs/_static/banner_github.svg)\n\n</h1>\n\n<p align=\"center\">\n <a href=\"https://pypi.org/project/urllib3\"><img alt=\"PyPI Version\" src=\"https://img.shields.io/pypi/v/urllib3.svg?maxAge=86400\" /></a>\n <a href=\"https://pypi.org/project/urllib3\"><img alt=\"Python Versions\" src=\"https://img.shields.io/pypi/pyversions/urllib3.svg?maxAge=86400\" /></a>\n <a href=\"https://discord.gg/urllib3\"><img alt=\"Join our Discord\" src=\"https://img.shields.io/discord/756342717725933608?color=%237289da&label=discord\" /></a>\n <a href=\"https://github.com/urllib3/urllib3/actions?query=workflow%3ACI\"><img alt=\"Coverage Status\" src=\"https://img.shields.io/badge/coverage-100%25-success\" /></a>\n <a href=\"https://github.com/urllib3/urllib3/actions?query=workflow%3ACI\"><img alt=\"Build Status on GitHub\" src=\"https://github.com/urllib3/urllib3/workflows/CI/badge.svg\" /></a>\n <a href=\"https://urllib3.readthedocs.io\"><img alt=\"Documentation Status\" src=\"https://readthedocs.org/projects/urllib3/badge/?version=latest\" /></a><br>\n <a href=\"https://deps.dev/pypi/urllib3\"><img alt=\"OpenSSF Scorecard\" src=\"https://api.securityscorecards.dev/projects/github.com/urllib3/urllib3/badge\" /></a>\n <a href=\"https://slsa.dev\"><img alt=\"SLSA 3\" src=\"https://slsa.dev/images/gh-badge-level3.svg\" /></a>\n <a href=\"https://bestpractices.coreinfrastructure.org/projects/6227\"><img alt=\"CII Best Practices\" src=\"https://bestpractices.coreinfrastructure.org/projects/6227/badge\" /></a>\n</p>\n\nurllib3 is a powerful, *user-friendly* HTTP client for Python. Much of the\nPython ecosystem already uses urllib3 and you should too.\nurllib3 brings many critical features that are missing from the Python\nstandard libraries:\n\n- Thread safety.\n- Connection pooling.\n- Client-side SSL/TLS verification.\n- File uploads with multipart encoding.\n- Helpers for retrying requests and dealing with HTTP redirects.\n- Support for gzip, deflate, brotli, and zstd encoding.\n- Proxy support for HTTP and SOCKS.\n- 100% test coverage.\n\nurllib3 is powerful and easy to use:\n\n```python3\n>>> import urllib3\n>>> http = urllib3.PoolManager()\n>>> resp = http.request(\"GET\", \"http://httpbin.org/robots.txt\")\n>>> resp.status\n200\n>>> resp.data\nb\"User-agent: *\\nDisallow: /deny\\n\"\n```\n\n## Installing\n\nurllib3 can be installed with [pip](https://pip.pypa.io):\n\n```bash\n$ python -m pip install urllib3\n```\n\nAlternatively, you can grab the latest source code from [GitHub](https://github.com/urllib3/urllib3):\n\n```bash\n$ git clone https://github.com/urllib3/urllib3.git\n$ cd urllib3\n$ pip install .\n```\n\n\n## Documentation\n\nurllib3 has usage and reference documentation at [urllib3.readthedocs.io](https://urllib3.readthedocs.io).\n\n\n## Community\n\nurllib3 has a [community Discord channel](https://discord.gg/urllib3) for asking questions and\ncollaborating with other contributors. Drop by and say hello 👋\n\n\n## Contributing\n\nurllib3 happily accepts contributions. Please see our\n[contributing documentation](https://urllib3.readthedocs.io/en/latest/contributing.html)\nfor some tips on getting started.\n\n\n## Security Disclosures\n\nTo report a security vulnerability, please use the\n[Tidelift security contact](https://tidelift.com/security).\nTidelift will coordinate the fix and disclosure with maintainers.\n\n\n## Maintainers\n\n- [@sethmlarson](https://github.com/sethmlarson) (Seth M. Larson)\n- [@pquentin](https://github.com/pquentin) (Quentin Pradet)\n- [@theacodes](https://github.com/theacodes) (Thea Flowers)\n- [@haikuginger](https://github.com/haikuginger) (Jess Shapiro)\n- [@lukasa](https://github.com/lukasa) (Cory Benfield)\n- [@sigmavirus24](https://github.com/sigmavirus24) (Ian Stapleton Cordasco)\n- [@shazow](https://github.com/shazow) (Andrey Petrov)\n\n👋\n\n\n## Sponsorship\n\nIf your company benefits from this library, please consider [sponsoring its\ndevelopment](https://urllib3.readthedocs.io/en/latest/sponsors.html).\n\n\n## For Enterprise\n\nProfessional support for urllib3 is available as part of the [Tidelift\nSubscription][1]. Tidelift gives software development teams a single source for\npurchasing and maintaining their software, with professional grade assurances\nfrom the experts who know it best, while seamlessly integrating with existing\ntools.\n\n[1]: https://tidelift.com/subscription/pkg/pypi-urllib3?utm_source=pypi-urllib3&utm_medium=referral&utm_campaign=readme\n",
"description_content_type": "text/markdown",
"keywords": [
"filepost",
"http",
"httplib",
"https",
"pooling",
"ssl",
"threadsafe",
"urllib"
],
"author_email": "Andrey Petrov <andrey.petrov@shazow.net>",
"maintainer_email": "Seth Michael Larson <sethmichaellarson@gmail.com>, Quentin Pradet <quentin@pradet.me>",
"license_file": [
"LICENSE.txt"
],
"classifier": [
"Environment :: Web Environment",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
"Topic :: Internet :: WWW/HTTP",
"Topic :: Software Development :: Libraries"
],
"requires_dist": [
"brotli>=1.0.9; platform_python_implementation == 'CPython' and extra == 'brotli'",
"brotlicffi>=0.8.0; platform_python_implementation != 'CPython' and extra == 'brotli'",
"certifi; extra == 'secure'",
"cryptography>=1.9; extra == 'secure'",
"idna>=2.0.0; extra == 'secure'",
"pyopenssl>=17.1.0; extra == 'secure'",
"urllib3-secure-extra; extra == 'secure'",
"pysocks!=1.5.7,<2.0,>=1.5.6; extra == 'socks'",
"zstandard>=0.18.0; extra == 'zstd'"
],
"requires_python": ">=3.7",
"project_url": [
"Changelog, https://github.com/urllib3/urllib3/blob/main/CHANGES.rst",
"Documentation, https://urllib3.readthedocs.io",
"Code, https://github.com/urllib3/urllib3",
"Issue tracker, https://github.com/urllib3/urllib3/issues"
],
"provides_extra": [
"brotli",
"secure",
"socks",
"zstd"
]
}
}
],
"environment": {
"implementation_name": "cpython",
"implementation_version": "3.12.10",
"os_name": "nt",
"platform_machine": "AMD64",
"platform_release": "11",
"platform_system": "Windows",
"platform_version": "10.0.26300",
"python_full_version": "3.12.10",
"platform_python_implementation": "CPython",
"python_version": "3.12",
"sys_platform": "win32"
}
}
@@ -0,0 +1,26 @@
{
"scenario": "build-backend-failure",
"question": "sdist build backend failure (PEP 517 backend unavailable).",
"expects_code": "PD-BLD-002",
"engine": "uv",
"engine_version": "uv 0.11.32 (3010295ae 2026-07-23 x86_64-pc-windows-msvc)",
"python": "Python 3.12.10",
"argv": [
"spikes\\.venv-uv-latest\\Scripts\\uv.exe",
"pip",
"install",
"-U",
"numpy==1.19.5",
"--python",
"<TMP>\\pd-uv-build-backend-failure-x06525p0\\venv\\Scripts\\python.exe"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 1,
"seed": [],
"seed_exit_code": null,
"stdout_bytes": 0,
"stderr_bytes": 861
}
@@ -0,0 +1,18 @@
Using Python 3.12.10 environment at: C:\Users\Anon\AppData\Local\Temp\pd-uv-build-backend-failure-x06525p0\venv
Resolved 1 package in 325ms
Building numpy==1.19.5
× Failed to build `numpy==1.19.5`
├─▶ The build backend returned an error
╰─▶ Call to `setuptools.build_meta:__legacy__.build_wheel` failed (exit
code: 1)
[stderr]
Traceback (most recent call last):
File "<string>", line 8, in <module>
File
"C:\Users\Anon\AppData\Local\uv\cache\builds-v0\.tmpM6qzfj\Lib\site-packages\setuptools\__init__.py",
line 9, in <module>
import distutils.core
ModuleNotFoundError: No module named 'distutils'
hint: `distutils` was removed from the standard library in Python 3.12. Consider adding a constraint (like `numpy >1.19.5`) to avoid building a version of `numpy` that depends on `distutils`.
Whitespace-only changes.
@@ -0,0 +1,29 @@
{
"scenario": "clean-upgrade",
"question": "Baseline: what does an unconstrained upgrade plan look like?",
"expects_code": null,
"engine": "uv",
"engine_version": "uv 0.11.32 (3010295ae 2026-07-23 x86_64-pc-windows-msvc)",
"python": "Python 3.12.10",
"argv": [
"spikes\\.venv-uv-latest\\Scripts\\uv.exe",
"pip",
"install",
"-U",
"--dry-run",
"idna",
"--python",
"<TMP>\\pd-uv-clean-upgrade-py2bn54p\\venv\\Scripts\\python.exe"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 0,
"seed": [
"idna==3.4"
],
"seed_exit_code": 0,
"stdout_bytes": 0,
"stderr_bytes": 234
}
@@ -0,0 +1,7 @@
Using Python 3.12.10 environment at: C:\Users\Anon\AppData\Local\Temp\pd-uv-clean-upgrade-py2bn54p\venv
Resolved 1 package in 293ms
Would download 1 package
Would uninstall 1 package
Would install 1 package
- idna==3.4
+ idna==3.18
Whitespace-only changes.
@@ -0,0 +1,30 @@
{
"scenario": "held-back-constrained",
"question": "SP-1 follow-up: does restating the installed set as explicit requirements make the resolver hold httpcore back to 0.15.x instead of breaking httpx? This decides whether PipDock must pass the full installed set on every plan.",
"expects_code": null,
"engine": "uv",
"engine_version": "uv 0.11.32 (3010295ae 2026-07-23 x86_64-pc-windows-msvc)",
"python": "Python 3.12.10",
"argv": [
"spikes\\.venv-uv-latest\\Scripts\\uv.exe",
"pip",
"install",
"-U",
"--dry-run",
"httpcore",
"httpx==0.23.0",
"--python",
"<TMP>\\pd-uv-held-back-constrained-66ncg_2i\\venv\\Scripts\\python.exe"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 0,
"seed": [
"httpx==0.23.0"
],
"seed_exit_code": 0,
"stdout_bytes": 0,
"stderr_bytes": 189
}
@@ -0,0 +1,4 @@
Using Python 3.12.10 environment at: C:\Users\Anon\AppData\Local\Temp\pd-uv-held-back-constrained-66ncg_2i\venv
Resolved 8 packages in 406ms
Checked 8 packages in 1ms
Would make no changes
Whitespace-only changes.
@@ -0,0 +1,29 @@
{
"scenario": "held-back",
"question": "SP-1 core question: httpx 0.23.0 requires httpcore<0.16, so httpcore cannot reach its 1.x latest. Does the engine name httpx as the blocker, or only report the resolved version? ANSWER: neither \u2014 both engines ignore the installed httpx entirely and plan httpcore 1.0.9, silently breaking it. Exit 0.",
"expects_code": null,
"engine": "uv",
"engine_version": "uv 0.11.32 (3010295ae 2026-07-23 x86_64-pc-windows-msvc)",
"python": "Python 3.12.10",
"argv": [
"spikes\\.venv-uv-latest\\Scripts\\uv.exe",
"pip",
"install",
"-U",
"--dry-run",
"httpcore",
"--python",
"<TMP>\\pd-uv-held-back-6hmjod7b\\venv\\Scripts\\python.exe"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 0,
"seed": [
"httpx==0.23.0"
],
"seed_exit_code": 0,
"stdout_bytes": 0,
"stderr_bytes": 276
}
@@ -0,0 +1,9 @@
Using Python 3.12.10 environment at: C:\Users\Anon\AppData\Local\Temp\pd-uv-held-back-6hmjod7b\venv
Resolved 3 packages in 491ms
Would download 2 packages
Would uninstall 2 packages
Would install 2 packages
- h11==0.12.0
+ h11==0.16.0
- httpcore==0.15.0
+ httpcore==1.0.9
Whitespace-only changes.
@@ -0,0 +1,30 @@
{
"scenario": "impossible",
"question": "Unsatisfiable set: how is ResolutionImpossible reported and is it attributable?",
"expects_code": "PD-RES-001",
"engine": "uv",
"engine_version": "uv 0.11.32 (3010295ae 2026-07-23 x86_64-pc-windows-msvc)",
"python": "Python 3.12.10",
"argv": [
"spikes\\.venv-uv-latest\\Scripts\\uv.exe",
"pip",
"install",
"-U",
"--dry-run",
"httpcore>=1.0",
"httpx==0.23.0",
"--python",
"<TMP>\\pd-uv-impossible-9aivzjzy\\venv\\Scripts\\python.exe"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 1,
"seed": [
"httpx==0.23.0"
],
"seed_exit_code": 0,
"stdout_bytes": 0,
"stderr_bytes": 443
}
@@ -0,0 +1,7 @@
Using Python 3.12.10 environment at: C:\Users\Anon\AppData\Local\Temp\pd-uv-impossible-9aivzjzy\venv
× No solution found when resolving dependencies:
╰─▶ Because httpx==0.23.0 depends on httpcore>=0.15.0,<0.16.0 and you
require httpcore>=1.0, we can conclude that your requirements and
httpx==0.23.0 are incompatible.
And because you require httpx==0.23.0, we can conclude that your
requirements are unsatisfiable.
Whitespace-only changes.
@@ -0,0 +1,27 @@
{
"scenario": "not-found",
"question": "Unknown distribution name.",
"expects_code": "PD-PKG-002",
"engine": "uv",
"engine_version": "uv 0.11.32 (3010295ae 2026-07-23 x86_64-pc-windows-msvc)",
"python": "Python 3.12.10",
"argv": [
"spikes\\.venv-uv-latest\\Scripts\\uv.exe",
"pip",
"install",
"-U",
"--dry-run",
"pipdock-no-such-package-9f3a2b",
"--python",
"<TMP>\\pd-uv-not-found-_xu4q_pz\\venv\\Scripts\\python.exe"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 1,
"seed": [],
"seed_exit_code": null,
"stdout_bytes": 0,
"stderr_bytes": 352
}
@@ -0,0 +1,5 @@
Using Python 3.12.10 environment at: C:\Users\Anon\AppData\Local\Temp\pd-uv-not-found-_xu4q_pz\venv
× No solution found when resolving dependencies:
╰─▶ Because pipdock-no-such-package-9f3a2b was not found in the package
registry and you require pipdock-no-such-package-9f3a2b, we can conclude
that your requirements are unsatisfiable.
Whitespace-only changes.
@@ -0,0 +1,26 @@
{
"scenario": "report-encoding-crash",
"question": "Evidence for the pip --report UnicodeEncodeError on Windows/cp1252. Kept as a fixture so a regression in the UTF-8 mitigation is recognisable.",
"expects_code": null,
"engine": "uv",
"engine_version": "uv 0.11.32 (3010295ae 2026-07-23 x86_64-pc-windows-msvc)",
"python": "Python 3.12.10",
"argv": [
"spikes\\.venv-uv-latest\\Scripts\\uv.exe",
"pip",
"install",
"-U",
"--dry-run",
"idna",
"--python",
"<TMP>\\pd-uv-report-encoding-crash-sjbyqk1o\\venv\\Scripts\\python.exe"
],
"extra_env": null,
"exit_code": 0,
"seed": [
"idna==3.4"
],
"seed_exit_code": 0,
"stdout_bytes": 0,
"stderr_bytes": 242
}
@@ -0,0 +1,7 @@
Using Python 3.12.10 environment at: C:\Users\Anon\AppData\Local\Temp\pd-uv-report-encoding-crash-sjbyqk1o\venv
Resolved 1 package in 343ms
Would download 1 package
Would uninstall 1 package
Would install 1 package
- idna==3.4
+ idna==3.18
Whitespace-only changes.
@@ -0,0 +1,27 @@
{
"scenario": "requires-python",
"question": "Requires-Python mismatch against the running interpreter.",
"expects_code": "PD-PKG-001",
"engine": "uv",
"engine_version": "uv 0.11.32 (3010295ae 2026-07-23 x86_64-pc-windows-msvc)",
"python": "Python 3.12.10",
"argv": [
"spikes\\.venv-uv-latest\\Scripts\\uv.exe",
"pip",
"install",
"-U",
"--dry-run",
"scipy==1.7.3",
"--python",
"<TMP>\\pd-uv-requires-python-d0zbs0as\\venv\\Scripts\\python.exe"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 0,
"seed": [],
"seed_exit_code": null,
"stdout_bytes": 0,
"stderr_bytes": 219
}
@@ -0,0 +1,6 @@
Using Python 3.12.10 environment at: C:\Users\Anon\AppData\Local\Temp\pd-uv-requires-python-d0zbs0as\venv
Resolved 2 packages in 949ms
Would download 2 packages
Would install 2 packages
+ numpy==1.22.4
+ scipy==1.7.3
Whitespace-only changes.
+27
View File
@@ -0,0 +1,27 @@
{
"scenario": "yanked",
"question": "Yanked release explicitly requested. Does the engine flag the yank, and where \u2014 structured field or stderr text?",
"expects_code": "PD-PKG-003",
"engine": "uv",
"engine_version": "uv 0.11.32 (3010295ae 2026-07-23 x86_64-pc-windows-msvc)",
"python": "Python 3.12.10",
"argv": [
"spikes\\.venv-uv-latest\\Scripts\\uv.exe",
"pip",
"install",
"-U",
"--dry-run",
"urllib3==2.0.0",
"--python",
"<TMP>\\pd-uv-yanked-q_o2x7qx\\venv\\Scripts\\python.exe"
],
"extra_env": {
"PYTHONIOENCODING": "utf-8",
"PYTHONUTF8": "1"
},
"exit_code": 0,
"seed": [],
"seed_exit_code": null,
"stdout_bytes": 0,
"stderr_bytes": 386
}
@@ -0,0 +1,6 @@
Using Python 3.12.10 environment at: C:\Users\Anon\AppData\Local\Temp\pd-uv-yanked-q_o2x7qx\venv
Resolved 1 package in 740ms
Would download 1 package
Would install 1 package
+ urllib3==2.0.0
warning: `urllib3==2.0.0` is yanked (reason: "Truncated response bodies when streaming a large compressed body. Upgrade to at least 2.0.2 (See: https://github.com/urllib3/urllib3/issues/3009)")
Whitespace-only changes.
+14 -1
View File
@@ -2,10 +2,23 @@
*Version 0.1 · 2026-07-17*
## Phase 0 — Spike week (before any feature code)
## Phase 0 — Spike week (before any feature code) — **RUN 2026-07-27**
The entire architecture stands on assumptions that must be verified on a real machine first (the FrameLedger/QuoteAtlas discipline). Each spike is a small script + captured fixtures committed to `crates/pipdock-core/tests/fixtures/`.
**Outcomes — full write-up in [`spikes/README.md`](../spikes/README.md).**
| Spike | Verdict | The one thing that changed |
|---|---|---|
| SP-1 | **GO — ship both engines** | Neither engine holds packages back on `install -U <pkg>`; both silently break installed dependents. **Every plan must restate the full installed set as explicit requirements.** uv's conflict attribution is *better* than pip's; uv writes its plan to **stderr**, not stdout. uv minimum pinned at 0.10.0. |
| SP-2 | Corpus captured; **blocker found and fixed** | `pip install --dry-run --report -` crashes with `UnicodeEncodeError` on Windows/cp1252 (pip 25 **and** 26). Every pip invocation must set `PYTHONIOENCODING=utf-8` + `PYTHONUTF8=1`. Also: yanked releases exit 0 (a preview warning, not a failure), and pip/uv disagree on Requires-Python enforcement. |
| SP-3 | **PASS** | 858 k projects; cold refresh 2.95 s (budget 60 s); worst keystroke 42.1 ms (budget 50 ms) — but only **in memory**: scanning SQLite per keystroke costs 218 ms. Margin is thin on fast hardware, and raw nucleo ranking puts `requests-ntlm` above `requests`. |
| SP-4 | Answered | `--path` cannot be combined with `--no-deps`; freeze-file mode (`-r <freeze> --no-deps -f json`) is the only option. SECURITY §6 confirmed. Findings arrive with duplicate advisory ids. |
| SP-5 | Answered by SP-1 | **No engine reports held-back items at all.** Resolved version, latest version and blocker must all be derived by PipDock — for pip as much as for uv, contrary to ARCHITECTURE §3's implication. |
| SP-6 | Answered | `uv python list` returns downloadable entries and duplicate shims; `env_hash` **must lowercase** the interpreter path on Windows or pins and snapshots split in two. `probe.py -I` hides 24 user-site packages on a system Python — open decision. Microsoft Store Python still unverified. |
Four open questions for the owner are listed at the end of `spikes/README.md`; M1 should not start until at least the Requires-Python and `-I` decisions are made, since both change adapter behaviour.
| # | Spike | Question to answer | Exit criterion |
|---|---|---|---|
| SP-1 | **uv dry-run shape** | Exact stdout of `uv pip install -U --dry-run` (current + previous uv) across: clean upgrade, held-back, impossible. Is held-back attribution derivable, or does uv only show the resolved set? | Fixture set committed; adapter parsing strategy written; uv minimum version pinned. **Go/no-go for launching with both engines** — if uv's plan output is too lossy, v1.0 ships pip-primary with uv behind a "beta engine" flag. |
+257 -35
View File
@@ -1,30 +1,242 @@
# Phase 0 spikes
# Phase 0 spikes — findings
`docs/ROADMAP.md` Phase 0: **before any feature code**, because the architecture rests on
assumptions that have to be checked on a real machine. Each spike is a small script here plus
fixtures committed to `crates/pipdock-core/tests/fixtures/`, and its answer is recorded below.
assumptions that have to be checked on a real machine. Each spike is a script here plus fixtures
committed under `crates/pipdock-core/tests/fixtures/`.
| Spike | Question | Status |
Run on 2026-07-27 · Windows 11 Pro 26300 · i7-14700KF · Python 3.12.10 / 3.14.6 ·
pip 25.0.1 and 26.1.2 · uv 0.11.32 and 0.10.12.
| Spike | Verdict |
|---|---|
| SP-1 uv dry-run shape | **GO for both engines** — but for a different reason than the doc assumed |
| SP-2 pip report & stderr corpus | 8 fixtures per engine; **one blocker found and fixed** |
| SP-3 index economics | **PASS**, with one architectural requirement and one thin margin |
| SP-4 pip-audit foreign env | Answered: freeze-file mode only |
| SP-5 held-back attribution | Answered by SP-1 — **no engine reports attribution at all** |
| SP-6 Windows discovery | Answered; **two identity bugs avoided** |
Reproduce with:
```bash
py -3.12 spikes/capture.py --engine pip
```
---
## SP-1 — uv dry-run shape · **GO**
**The question was the wrong shape.** ROADMAP asked whether uv's text plan is lossy enough that
v1.0 should ship pip-primary with uv behind a beta flag. The answer is that uv is *not* the weak
side — on the one output that matters most it is clearly better than pip.
### What both engines actually do
`<engine> install -U <pkg>` **ignores the constraints of packages already installed**:
| Scenario | Plan produced | Exit |
|---|---|---|
| SP-1 | Exact shape of `uv pip install -U --dry-run`; is held-back attribution derivable? | not started — **blocked on installing uv** |
| SP-2 | `pip --dry-run --report` JSON + real stderr for every catalog code | not started |
| SP-3 | PEP 691 index size, SQLite ingest time, fuzzy-search latency over ~600 k names | not started |
| SP-4 | pip-audit invocation for a foreign environment | not started |
| SP-5 | Held-back attribution accuracy on a real numpy/scipy/pandas tangle | not started |
| SP-6 | Windows env discovery sweep (PEP 514, `py -0p`, Store Python, uv-managed) | one finding recorded below |
| Seed `httpx==0.23.0` (needs `httpcore>=0.15,<0.16`), then `install -U httpcore` | `httpcore 0.15.0 → 1.0.9` — **silently breaks httpx** | 0 |
| Same, but restating the installed package: `install -U httpcore httpx==0.23.0` | *no changes* — httpcore correctly held at 0.15.0 | 0 |
SP-1 is a **go/no-go**: if uv's plan output is too lossy to populate
`ResolutionReport::held_back[].blockers`, v1.0 ships pip-primary with uv behind a beta-engine flag.
pip and uv behave **identically** here. There is no "held back" concept in either engine's
`install -U` output, because neither holds anything back — they break the environment and exit 0.
## Findings
> **Design requirement (both adapters).** Every plan must restate the full installed set as
> explicit requirements. Without it, PipDock's core promise — preview before touch — would preview
> a plan that quietly breaks the environment, and `pip check` would only discover it afterwards.
> This is not an optimisation; it is the difference between the product working and not.
### SP-6 — `probe.py -I` hides user-site packages (measured 2026-07-27)
### Where uv wins
`docs/SECURITY.md` §2 specifies running the probe with `-I` (isolated mode) so a poisoned
environment cannot inject code into it. Isolated mode also disables **user site-packages**, and on
a system Python that is where most packages actually live.
Given an unsatisfiable set, uv names the exact constraint and the chain:
Measured against `C:\Python314` on the dev machine:
```text
× No solution found when resolving dependencies:
╰─▶ Because httpx==0.23.0 depends on httpcore>=0.15.0,<0.16.0 and you
require httpcore>=1.0, we can conclude that your requirements and
httpx==0.23.0 are incompatible.
```
pip, for the same input, says only:
```text
ERROR: Cannot install httpcore>=1.0 and httpx==0.23.0 because these package versions have
conflicting dependencies.
```
uv gives the blocker **and** its constraint; pip gives neither. `docs/ERROR-CATALOG.md` PD-RES-001
tells the user to make per-package Skip/Force choices — with uv, PipDock can also tell them *why*,
straight from the engine.
### Output channel
**uv writes its entire plan to stderr; stdout is empty.** All nine uv fixtures have `stdout=0B`.
The adapter must read stderr for the plan, which also means engine stderr cannot be treated as
"error output only" — the error classifier has to run *after* a plan-parse attempt, not before.
uv 0.10.12 and 0.11.32 produce identical formats for every scenario, so the parser has at least
one minor version of stability. Minimum pinned at **0.10.0**.
---
## SP-2 — pip report & stderr corpus · **blocker found**
### `pip install --dry-run --report -` crashes on Windows
pip's `--report` writes its JSON through the vendored `rich`, which on Windows routes via
`legacy_windows_render` and the **console** codec. Under cp1252 it raises `UnicodeEncodeError` the
moment any report field holds a non-ASCII character — pip exits 2 and emits no report:
```text
File "...\encodings\cp1252.py", line 19, in encode
UnicodeEncodeError: 'charmap' codec can't encode characters in position 860-863
```
Reproduced with a plain `pip install -U --dry-run --quiet --report - idna`. Confirmed on **pip
25.0.1 and pip 26.1.2** — current, not legacy.
It is **data-dependent**, which makes it worse than a hard failure: the `held-back` fixture's
32 KB report is all-ASCII and succeeds, so this would pass local testing and fail on users'
machines depending on which packages they have.
> **Mitigation (mandatory, every pip invocation).** Set `PYTHONIOENCODING=utf-8` and
> `PYTHONUTF8=1` in the child environment. Verified: exit 0, valid JSON on stdout.
> `spikes/capture.py` applies this as `SAFE_ENV`, and the `report-encoding-crash` fixture keeps
> the failure as evidence so a regression is recognisable.
### Catalog notes from the corpus
- **PD-PKG-001 vs PD-PKG-002 are not separable from pip stderr.** A Requires-Python rejection and
an unknown name both produce `No matching distribution found for X`. ERROR-CATALOG's note about
cross-checking index metadata is not optional — it is the only way to tell them apart.
- **PD-PKG-003 (yanked) is not an error.** Both engines exit **0** and install the yanked release,
emitting a warning. pip carries it structurally (`"is_yanked": true` in the report) *and* on
stderr; uv only on stderr. So the yank belongs in the **preview**, as a warning row, not in the
failure path the catalog currently implies.
- **The engines disagree about Requires-Python.** `scipy==1.7.3` declares `>=3.7,<3.11`. On Python
3.12 pip refuses it; **uv planned to install it**. PipDock's preview will therefore differ by
engine for the same request. Needs a decision before M1 (see open questions).
- pip's own upgrade notice (`[notice] A new release of pip is available`) appears on stderr in
almost every capture. Classifiers must not treat a non-empty stderr as failure.
Fixtures: `crates/pipdock-core/tests/fixtures/{pip,uv}/<scenario>/{stdout,stderr}.txt` +
`meta.json` recording argv, engine version, exit code and the question each answers.
Still to capture (need conditions this machine cannot produce):
`PD-BLD-001` (MSVC missing — MSVC is installed here), `PD-NET-002` (TLS interception),
`PD-PRM-002` (locked file), `PD-SYS-001/002` (long path, disk full).
---
## SP-3 — PEP 691 index economics · **PASS**
| Measure | Result | Budget |
|---|---|---|
| Projects on PyPI | **858,476** | doc assumed ~600 k |
| Index on the wire (gzip) | 8.91 MiB | — |
| Decompressed | 40.17 MiB | — |
| Fetch | 1.25 s | — |
| Parse + normalize + SQLite ingest | 1.70 s | — |
| **Cold refresh, total** | **2.95 s** | < 60 s ✅ |
| SQLite file | 47.86 MiB | — |
| Load all names into memory | 82 ms, once at startup | — |
| **Worst keystroke (nucleo, in memory)** | **42.1 ms** (`"re"`) | < 50 ms ✅ |
| Full SQLite column scan | 218 ms | ❌ 4× over |
> **Architectural requirement.** Searching by scanning SQLite per keystroke costs 218 ms and
> misses the budget fourfold. The name list must be loaded into memory **once** and matched there;
> SQLite is the persistence layer, not the search path.
Two cautions:
- **The margin is thin, and this is fast hardware.** 42.1 ms on an i7-14700KF leaves ~16 %
headroom. SP-3 explicitly asked about a low-end reference VM, which was not available here — on
slower hardware this misses. Keep the delta/prefilter fallback in the drawer as ROADMAP says;
the obvious first move is a cheap substring prefilter before the fuzzy pass on short queries,
since `"re"` (the widest match) is the worst case.
- **Raw nucleo ranking is not shippable.** Searching `requests` ranks `requests-ntlm` above
`requests`; `numpy` ranks `numpy-utils` first. The Search screen needs an exact- and
prefix-match boost on top of the fuzzy score, or it will look broken on the most common queries.
Reproduce: `py -3.14 spikes/sp3_index.py` then
`cargo run --release --example sp3_search -- spikes/out/index.db`.
---
## SP-4 — pip-audit against a foreign environment · **freeze-file mode only**
pip-audit 2.10.1:
- `--path <site-packages> --no-deps` is **rejected**: *"The --no-deps flag can only be used with
--requirement (-r)"*. `--path` is therefore not an alternative to the documented approach.
- `-r <freeze> --no-deps -f json` **works**: against a seeded env it found 10 advisories in
`urllib3==2.0.0`.
`docs/SECURITY.md` §6 is confirmed as written. Two implementation notes: the JSON output
**repeats advisory ids** (`PYSEC-2023-192` twice), so findings need de-duplication before they
reach the UI; and pip-audit writes a `pip-compile`/hashes advisory to stderr on every run, which
must not be treated as a failure.
---
## SP-5 — held-back attribution accuracy · **answered by SP-1**
The spike assumed the engine reports *what* was held back and PipDock supplies *who*. In fact
**neither engine reports a held-back item at all** — with the installed set restated, pip's report
is simply empty and uv says `Would make no changes`. There is nothing to attribute against.
So all three parts of the preview's "needs decision" row must be derived by PipDock:
| Part | Source |
|---|---|
| resolved version | the plan, or the absence of a change for that package |
| latest version | the index (already fetched for `list --outdated`) |
| the blocker and its constraint | the reverse-dependency graph from `probe.py`'s `requires_dist` |
ARCHITECTURE §3 already specifies graph-based attribution for uv. The correction is that it
applies to **pip equally** — the `--dry-run --report` JSON does not carry it, contrary to the
document's implication. ARCHITECTURE §3's ambiguity rule (show the constraint without a culprit
rather than guessing) becomes the main safeguard, so it needs test coverage from day one.
The numpy/scipy/pandas tangle from the original spike text was not exercised; the httpx/httpcore
construction answered the question more cleanly and deterministically. Worth revisiting during M1
against a real 200-package environment.
---
## SP-6 — Windows environment discovery · **two identity bugs avoided**
Sources swept: PEP 514 registry (HKCU and HKLM), `py -0p`, `uv python list`.
### `uv python list` needs filtering and de-duplication
It returns downloadable interpreters alongside installed ones (`<download available>`), which must
be dropped. It also surfaces **shims that duplicate a real interpreter** — here a Chocolatey shim
and the real install both report the same interpreter:
```text
cpython-3.14.6-windows-x86_64-none C:\Python314\python.exe
cpython-3.14.6-windows-x86_64-none C:\ProgramData\chocolatey\bin\python3.14.exe
```
Both resolve to `sys.executable = c:\python314\python.exe`. Path-string de-duplication is not
enough — dedupe on what the probe reports, not on the discovery path.
### `env_hash` must be case-normalized
Launched via the shim, Python reports `c:\python314`; launched directly, `C:\Python314`.
ARCHITECTURE §6 defines `env_hash` as the SHA-256 of the canonicalized interpreter path — on
Windows that **must lowercase** as part of canonicalization. Otherwise the same environment gets
two hashes, and its pins and snapshot history silently split in two depending on how it was
discovered. PEP 514 registry entries exist under both HKCU and HKLM here, giving another route to
the same duplication.
### `probe.py -I` hides user-site packages
`docs/SECURITY.md` §2 specifies `-I` (isolated mode) so a poisoned environment cannot inject code
into the probe. Isolated mode also disables user site-packages, where most packages live on a
system Python. Measured against `C:\Python314`:
| View | Distributions |
|---|---|
@@ -32,27 +244,37 @@ Measured against `C:\Python314` on the dev machine:
| `probe.py` without `-I` | 376 |
| `pip list` | 375 |
So `-I` hides **24 packages** that pip itself reports, and PipDock's Installed tab would disagree
with `pip list` by that much. The remaining 376 vs 375 gap is a second, smaller question — likely a
shadowed distribution that `importlib.metadata` reports twice and pip de-duplicates by normalized
name.
`-I` hides **24 packages pip itself reports**. Venvs are unaffected (no user site), so this only
bites non-venv system Pythons — and `C:\Python314` reports `externally_managed: false`, so nothing
blocks PipDock from managing it. The remaining 376 vs 375 gap is likely a shadowed distribution
that `importlib.metadata` reports twice and pip de-duplicates by normalized name.
This does not affect the primary target: a venv has no user site, so all three numbers agree. It
affects **non-venv system Pythons that are not PEP 668-marked** — `C:\Python314` reports
`externally_managed: false`, so nothing blocks PipDock from managing it.
**Open decision for SP-6** (do not resolve unilaterally — it trades a documented security control
against list accuracy):
**Open decision** — it trades a documented security control against list accuracy:
- keep `-I` and show a "user-site packages not shown" note on non-venv environments; or
- drop to `-E` (ignore `PYTHONPATH` only, keep user site), accepting that a package in user site
can influence the probe's imports; or
- run the probe twice and reconcile, at the cost of a second interpreter start per scan.
- drop to `-E` (ignore `PYTHONPATH` only, keep user site); or
- probe twice and reconcile, at the cost of a second interpreter start per scan.
### SP-6 — Python 3.14 metadata deprecation (fixed 2026-07-27)
### Python 3.14 metadata deprecation (fixed)
Subscripting `dist.metadata["Requires-Python"]` for an absent header emits
`DeprecationWarning: Implicit None on return values is deprecated and will raise KeyErrors` on
Python 3.14, on **stderr**, for many distributions. `probe.py` now uses `.get()`. Worth keeping in
mind generally: the probe must stay clean on stderr, because the core treats probe noise as
`PD-ENV-003`.
Python 3.14, on stderr, for most distributions. `probe.py` now uses `.get()`. The probe must stay
stderr-clean, because noise there reads as `PD-ENV-003`.
Not swept: **Microsoft Store Python** is not installed on this machine, so the aliasing quirks
SP-6 asks about remain unverified. Store Python must still be either supported or explicitly
detected-and-explained before v1.0.
---
## Open questions for the owner
1. **Requires-Python divergence (SP-2).** pip refuses `scipy==1.7.3` on Python 3.12; uv plans it.
Should PipDock enforce Requires-Python itself so the preview is engine-independent, or show
each engine's own verdict?
2. **`probe.py -I` (SP-6).** Which of the three options above?
3. **Search ranking (SP-3).** Confirm that an exact/prefix boost over nucleo's score is in scope
for M1 rather than deferred — the Search screen is unusable without it.
4. **`PD-BLD-001` fixture (SP-2).** Capture on a clean VM, or ship a labelled synthetic fixture?
`docs/TESTING.md` §2 requires a fixture per code before ship.
+299
View File
@@ -0,0 +1,299 @@
"""Fixture capture harness for spikes SP-1 and SP-2.
Builds a disposable venv per scenario, runs the engine commands PipDock will run, and writes
stdout / stderr / exit code to `crates/pipdock-core/tests/fixtures/<engine>/<scenario>/`.
Why a harness rather than ad-hoc runs: `docs/TESTING.md` §1 makes adapter parsing the thing that
must never regress, and requires at least one captured fixture per error-catalog code. Those
fixtures have to be reproducible when a new pip or uv ships, so the capture has to be a script
that CI can re-run (RELEASE-CI §1, the weekly latest-engine parser job).
Usage:
py -3.12 spikes/capture.py --engine pip
py -3.12 spikes/capture.py --engine uv --uv-exe spikes/.venv-uv-latest/Scripts/uv.exe
py -3.12 spikes/capture.py --list
"""
from __future__ import annotations
import argparse
import json
import os
import shutil
import subprocess
import sys
import tempfile
import venv
from dataclasses import dataclass, field
from pathlib import Path
REPO = Path(__file__).resolve().parent.parent
FIXTURES = REPO / "crates" / "pipdock-core" / "tests" / "fixtures"
# Deliberately small, pure-Python, long-published packages so the captures stay reproducible.
# httpx 0.23.0 pins httpcore>=0.15.0,<0.16.0, which is the cleanest held-back construction:
# httpcore's latest is 1.x, so the resolver must hold it two majors back.
@dataclass
class Scenario:
"""One captured situation: seed an environment, then run a command against it."""
name: str
#: Installed before the captured command runs. Not captured itself.
seed: list[str] = field(default_factory=list)
#: Requirements passed to the captured `install` command.
target: list[str] = field(default_factory=list)
#: True for the flows PipDock previews rather than executes.
dry_run: bool = True
#: Human-readable statement of what this fixture is evidence for.
question: str = ""
#: Error-catalog code this fixture is expected to feed, when it is an error case.
expects_code: str | None = None
#: Set False only to capture what happens WITHOUT the UTF-8 mitigation (see SAFE_ENV).
utf8_io: bool = True
# pip's `--report -` writes JSON through its vendored rich, which on Windows goes via
# legacy_windows_render and the console codec. Under cp1252 that raises UnicodeEncodeError the
# moment any report field contains a non-ASCII character, and pip exits 2 with no report at all.
# Confirmed on pip 25.0.1 AND pip 26.1.2 (spikes/README.md, SP-2). Forcing UTF-8 on the child's
# stdio is the mitigation, and it is mandatory for every pip invocation PipDock makes.
SAFE_ENV = {"PYTHONIOENCODING": "utf-8", "PYTHONUTF8": "1"}
SCENARIOS: list[Scenario] = [
Scenario(
name="clean-upgrade",
seed=["idna==3.4"],
target=["idna"],
question="Baseline: what does an unconstrained upgrade plan look like?",
),
Scenario(
name="held-back",
seed=["httpx==0.23.0"],
target=["httpcore"],
question=(
"SP-1 core question: httpx 0.23.0 requires httpcore<0.16, so httpcore cannot reach "
"its 1.x latest. Does the engine name httpx as the blocker, or only report the "
"resolved version? ANSWER: neither — both engines ignore the installed httpx "
"entirely and plan httpcore 1.0.9, silently breaking it. Exit 0."
),
),
Scenario(
name="held-back-constrained",
seed=["httpx==0.23.0"],
# The same upgrade, but with the installed distribution restated as a requirement.
target=["httpcore", "httpx==0.23.0"],
question=(
"SP-1 follow-up: does restating the installed set as explicit requirements make the "
"resolver hold httpcore back to 0.15.x instead of breaking httpx? This decides "
"whether PipDock must pass the full installed set on every plan."
),
),
Scenario(
name="report-encoding-crash",
seed=["idna==3.4"],
target=["idna"],
utf8_io=False,
question=(
"Evidence for the pip --report UnicodeEncodeError on Windows/cp1252. Kept as a "
"fixture so a regression in the UTF-8 mitigation is recognisable."
),
),
Scenario(
name="impossible",
seed=["httpx==0.23.0"],
target=["httpcore>=1.0", "httpx==0.23.0"],
question="Unsatisfiable set: how is ResolutionImpossible reported and is it attributable?",
expects_code="PD-RES-001",
),
Scenario(
name="not-found",
seed=[],
target=["pipdock-no-such-package-9f3a2b"],
question="Unknown distribution name.",
expects_code="PD-PKG-002",
),
Scenario(
name="requires-python",
seed=[],
# scipy 1.7.3 declares Requires-Python >=3.7,<3.11 and ships wheels, so the resolver
# rejects it on metadata rather than attempting a build.
target=["scipy==1.7.3"],
question="Requires-Python mismatch against the running interpreter.",
expects_code="PD-PKG-001",
),
Scenario(
name="yanked",
seed=[],
# urllib3 2.0.0 is yanked upstream. PipDock must surface the yank rather than proceed.
target=["urllib3==2.0.0"],
question=(
"Yanked release explicitly requested. Does the engine flag the yank, and where — "
"structured field or stderr text?"
),
expects_code="PD-PKG-003",
),
Scenario(
name="build-backend-failure",
seed=[],
# numpy 1.19.5 is sdist-only for this interpreter, and a modern venv ships no setuptools,
# so the PEP 517 backend cannot even be imported. A real-world "old sdist on new Python".
target=["numpy==1.19.5"],
dry_run=False,
question="sdist build backend failure (PEP 517 backend unavailable).",
expects_code="PD-BLD-002",
),
]
def run(
argv: list[str], cwd: Path | None = None, extra_env: dict[str, str] | None = None
) -> subprocess.CompletedProcess[str]:
"""Run a command with no shell involved, mirroring SECURITY §2."""
env = None
if extra_env:
env = {**os.environ, **extra_env}
return subprocess.run(
argv,
cwd=cwd,
env=env,
capture_output=True,
text=True,
encoding="utf-8",
errors="replace",
timeout=600,
check=False,
)
def make_venv(path: Path) -> Path:
"""Create a disposable venv and return its interpreter."""
venv.create(path, with_pip=True, clear=True)
python = path / ("Scripts/python.exe" if os.name == "nt" else "bin/python")
if not python.exists():
raise RuntimeError(f"venv interpreter missing at {python}")
return python
def pip_argv(python: Path, args: list[str]) -> list[str]:
return [str(python), "-m", "pip", *args]
def uv_argv(uv_exe: Path, python: Path, args: list[str]) -> list[str]:
return [str(uv_exe), "pip", *args, "--python", str(python)]
def capture(engine: str, scenario: Scenario, uv_exe: Path | None, out_root: Path) -> dict:
"""Run one scenario and write its fixture. Returns a summary record."""
work = Path(tempfile.mkdtemp(prefix=f"pd-{engine}-{scenario.name}-"))
env = SAFE_ENV if scenario.utf8_io else None
try:
python = make_venv(work / "venv")
seed_result = None
if scenario.seed:
argv = (
pip_argv(python, ["install", "--quiet", *scenario.seed])
if engine == "pip"
else uv_argv(uv_exe, python, ["install", *scenario.seed])
)
seed_result = run(argv, extra_env=SAFE_ENV)
if seed_result.returncode != 0:
print(f" ! seed failed ({seed_result.returncode}); capturing anyway")
if engine == "pip":
args = ["install", "-U"]
if scenario.dry_run:
# DATA-FLOW §7: this is the exact planning command, JSON report to stdout.
args += ["--dry-run", "--quiet", "--report", "-"]
args += scenario.target
argv = pip_argv(python, args)
else:
args = ["install", "-U"]
if scenario.dry_run:
args += ["--dry-run"]
args += scenario.target
argv = uv_argv(uv_exe, python, args)
result = run(argv, extra_env=env)
out_dir = out_root / engine / scenario.name
out_dir.mkdir(parents=True, exist_ok=True)
(out_dir / "stdout.txt").write_text(result.stdout, encoding="utf-8")
(out_dir / "stderr.txt").write_text(result.stderr, encoding="utf-8")
meta = {
"scenario": scenario.name,
"question": scenario.question,
"expects_code": scenario.expects_code,
"engine": engine,
"engine_version": engine_version(engine, python, uv_exe),
"python": python_version(python),
"argv": [redact(a) for a in argv],
"extra_env": env,
"exit_code": result.returncode,
"seed": scenario.seed,
"seed_exit_code": None if seed_result is None else seed_result.returncode,
"stdout_bytes": len(result.stdout),
"stderr_bytes": len(result.stderr),
}
(out_dir / "meta.json").write_text(json.dumps(meta, indent=2) + "\n", encoding="utf-8")
return meta
finally:
shutil.rmtree(work, ignore_errors=True)
def redact(arg: str) -> str:
"""Replace the temp-dir path so fixtures are stable across machines and runs."""
return arg.replace(str(Path(tempfile.gettempdir())), "<TMP>")
def engine_version(engine: str, python: Path, uv_exe: Path | None) -> str:
argv = (
pip_argv(python, ["--version"]) if engine == "pip" else [str(uv_exe), "--version"]
)
return run(argv).stdout.strip()
def python_version(python: Path) -> str:
return run([str(python), "--version"]).stdout.strip() or run(
[str(python), "-c", "import sys;print(sys.version.split()[0])"]
).stdout.strip()
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--engine", choices=["pip", "uv"], default="pip")
parser.add_argument("--uv-exe", type=Path, help="uv executable (required for --engine uv)")
parser.add_argument("--out", type=Path, default=FIXTURES)
parser.add_argument("--only", action="append", help="run only these scenarios")
parser.add_argument("--list", action="store_true", help="list scenarios and exit")
args = parser.parse_args()
if args.list:
for s in SCENARIOS:
print(f"{s.name:24} {s.expects_code or '-':12} {s.question}")
return 0
if args.engine == "uv" and not args.uv_exe:
parser.error("--uv-exe is required with --engine uv")
selected = [s for s in SCENARIOS if not args.only or s.name in args.only]
summaries = []
for scenario in selected:
print(f"[{args.engine}] {scenario.name} …", flush=True)
meta = capture(args.engine, scenario, args.uv_exe, args.out)
summaries.append(meta)
print(
f" exit={meta['exit_code']} stdout={meta['stdout_bytes']}B "
f"stderr={meta['stderr_bytes']}B",
flush=True,
)
print(json.dumps({"engine": args.engine, "captured": len(summaries)}, indent=2))
return 0
if __name__ == "__main__":
sys.exit(main())
+142
View File
@@ -0,0 +1,142 @@
"""SP-3 — PEP 691 index economics.
`docs/ROADMAP.md` SP-3 asks: how big is the full PyPI name index, how long does it take to fetch
on VN broadband, how long to ingest into SQLite, and can fuzzy search stay under the 50 ms
per-keystroke budget over ~600 k names? If the answer is no, ARCHITECTURE §5 needs a delta or
compression fallback.
This measures the fetch and the SQLite side in Python. The fuzzy-search half is measured in Rust
with the real `nucleo` matcher (`spikes/sp3_search.rs` is not a thing yet — see the README), so
what is timed here is the SQLite scan that feeds the matcher, which is the part that would sink
the budget if the schema were wrong.
Usage:
py -3.14 spikes/sp3_index.py --out spikes/out
"""
from __future__ import annotations
import argparse
import gzip
import io
import json
import sqlite3
import time
import urllib.request
from pathlib import Path
SIMPLE_INDEX = "https://pypi.org/simple/"
PEP691_ACCEPT = "application/vnd.pypi.simple.v1+json"
def normalize(name: str) -> str:
"""PEP 503 normalization; must match `PkgName::parse` in the Rust core."""
out: list[str] = []
prev_sep = False
for ch in name:
if ch in "-_.":
if not prev_sep:
out.append("-")
prev_sep = True
else:
out.append(ch.lower())
prev_sep = False
return "".join(out)
def fetch(url: str) -> tuple[bytes, float, int]:
"""Fetch the index, returning (body, seconds, wire_bytes)."""
req = urllib.request.Request(
url, headers={"Accept": PEP691_ACCEPT, "Accept-Encoding": "gzip"}
)
start = time.perf_counter()
with urllib.request.urlopen(req, timeout=300) as resp:
raw = resp.read()
encoding = resp.headers.get("Content-Encoding", "")
elapsed = time.perf_counter() - start
wire = len(raw)
if encoding == "gzip":
raw = gzip.GzipFile(fileobj=io.BytesIO(raw)).read()
return raw, elapsed, wire
def main() -> int:
parser = argparse.ArgumentParser(description=__doc__)
parser.add_argument("--out", type=Path, default=Path("spikes/out"))
args = parser.parse_args()
args.out.mkdir(parents=True, exist_ok=True)
print(f"fetching {SIMPLE_INDEX} …", flush=True)
body, fetch_s, wire_bytes = fetch(SIMPLE_INDEX)
t0 = time.perf_counter()
doc = json.loads(body)
parse_s = time.perf_counter() - t0
names = [p["name"] for p in doc["projects"]]
t0 = time.perf_counter()
rows = [(n, normalize(n)) for n in names]
normalize_s = time.perf_counter() - t0
db_path = args.out / "index.db"
db_path.unlink(missing_ok=True)
conn = sqlite3.connect(db_path)
t0 = time.perf_counter()
conn.executescript(
"""
PRAGMA journal_mode = OFF;
PRAGMA synchronous = OFF;
CREATE TABLE names (name TEXT NOT NULL, normalized TEXT NOT NULL);
"""
)
conn.executemany("INSERT INTO names (name, normalized) VALUES (?, ?)", rows)
conn.execute("CREATE INDEX idx_names_normalized ON names (normalized)")
conn.commit()
ingest_s = time.perf_counter() - t0
# The search path PipDock actually needs: pull the normalized column into memory once, then
# let the fuzzy matcher work over it. Timing the scan separately shows whether SQLite is the
# bottleneck or the matcher is.
t0 = time.perf_counter()
loaded = [r[0] for r in conn.execute("SELECT normalized FROM names")]
scan_s = time.perf_counter() - t0
# A prefix query is the cheapest possible search; it bounds how fast any index-backed lookup
# can be, and shows whether the btree index is doing its job.
t0 = time.perf_counter()
for q in ("req", "num", "pand", "flask", "zope"):
conn.execute(
"SELECT name FROM names WHERE normalized GLOB ? LIMIT 50", (f"{q}*",)
).fetchall()
prefix_s = (time.perf_counter() - t0) / 5
conn.close()
db_bytes = db_path.stat().st_size
result = {
"projects": len(names),
"wire_bytes": wire_bytes,
"wire_mib": round(wire_bytes / 1024 / 1024, 2),
"decompressed_mib": round(len(body) / 1024 / 1024, 2),
"fetch_seconds": round(fetch_s, 2),
"json_parse_seconds": round(parse_s, 2),
"normalize_seconds": round(normalize_s, 2),
"sqlite_ingest_seconds": round(ingest_s, 2),
"sqlite_bytes": db_bytes,
"sqlite_mib": round(db_bytes / 1024 / 1024, 2),
"full_scan_ms": round(scan_s * 1000, 1),
"prefix_query_ms": round(prefix_s * 1000, 2),
"cold_total_seconds": round(fetch_s + parse_s + normalize_s + ingest_s, 2),
"budget_cold_refresh_seconds": 60,
"budget_search_ms": 50,
}
(args.out / "sp3.json").write_text(json.dumps(result, indent=2) + "\n", encoding="utf-8")
print(json.dumps(result, indent=2))
verdict = "PASS" if result["cold_total_seconds"] < 60 else "FAIL"
print(f"\ncold refresh: {result['cold_total_seconds']}s vs 60s budget -> {verdict}")
return 0
if __name__ == "__main__":
raise SystemExit(main())