Skip to main content

wheelpaths

Check whether a chosen set of Python wheels would claim the same installation paths.

Tests

Quickstart

python -m pip install "git+https://github.com/anishpentyala/wheelpaths.git"
python -m pip download --only-binary=:all: --no-deps jwt==1.4.0 PyJWT==2.15.1 -d wheels
printf '{"purelib":"/venv/lib/site-packages","platlib":"/venv/lib/site-packages","scripts":"/venv/bin","data":"/venv"}' > scheme.json
wheelpaths --scheme scheme.json wheels/*.whl > plan.json

The pinned JWT wheel pair has four shared destinations under that scheme:

jwt/__init__.py
jwt/exceptions.py
jwt/py.typed
jwt/utils.py

The planner exits 1 for collisions. It reads archives without installing, extracting or importing them. This explicit POSIX path model does not inspect an existing environment, resolve dependencies or prove an installation is safe.

Installation is currently from source. A PyPI release is being prepared; do not assume pip install wheelpaths is available until its package page is linked here.

Details

Plan collisions in the destinations of a chosen set of Python wheels, without installing them or importing their code. Supply an explicit POSIX installation scheme. The output binds every claim to the SHA256 of the exact archive snapshot read for the plan and distinguishes archive members from generated entry-point scripts.

This is a path planner, not a package resolver, wheel validator or safe-install certificate. NO_COLLISIONS_IN_MODEL means exactly that. It does not mean the packages can be used together or installed safely.

Run

Install from this repository with pip install ., then:

wheelpaths --scheme scheme.json first.whl second.whl > plan.json

scheme.json must have exactly these four keys, with canonical absolute POSIX paths. Equal destinations are allowed and important:

{
  "purelib": "/venv/lib/python3.12/site-packages",
  "platlib": "/venv/lib/python3.12/site-packages",
  "scripts": "/venv/bin",
  "data": "/venv"
}

Exit 0: no collision found in the supported model. Exit 1: collisions found. Exit 2: invalid/unsupported input, never a clear plan. Argument syntax errors use argparse's stderr and exit 2; data/input errors produce JSON with status INVALID.

Root members use Root-Is-Purelib. Members in the wheel's own .data/purelib, .data/platlib, .data/scripts and .data/data are relocated. console_scripts and gui_scripts create POSIX command-name claims. Other entry-point groups are ignored, including misspelled script group names; they do not generate commands in this model. Equal targets are conflicts even with equal contents: two owners can remove each other's files on uninstall. A file that another claim needs as a directory is also a conflict. Shared directories alone, including namespace-package directories, are not conflicts.

Inputs must resolve to regular files, verified on the opened descriptor. Symlinks to regular files are allowed. On systems with O_NONBLOCK, FIFOs without writers are refused without waiting for a producer. Other device or socket open failures also produce INVALID; there is no universal timeout for regular files on a slow or remote filesystem. The scheme JSON is UTF-8 and at most 1 MiB, including whitespace. An over-limit or nonregular later input produces no partial plan.

Archives are never extracted. Per archive, at most 256 MiB of archive bytes, 100,000 members and 1 MiB per read metadata file are accepted. Invocation-wide limits additionally cap the wheel count, aggregate archive bytes, aggregate ZIP members and projected claims. These are admission limits, not a general hostile-input sandbox or hard limits on memory, disk, CPU time or serialized report bytes. ZIP central directories, metadata text and path/claim objects still need memory. Conflict claim references have a separate admission cap, including repetitions across conflicts.

Supported boundary

  • Metadata ZIP compression must be stored or deflated; corrupted reads are INVALID.
  • Wheel-Version 1.0, one expected .dist-info directory, optional matching .data.
  • Explicit exact, case-sensitive POSIX lexical paths only.
  • Candidate wheel set only; no network and no installed environment inspection.
  • Headers and unknown schemes, special/symlink ZIP entries, duplicate members, traversal/noncanonical paths and unknown metadata layouts fail explicitly.
  • Root metadata identity is checked against the filename. RECORD contents, member payload checksums, dependency metadata and wheel validity are not checked.

Not modeled: existing files, filesystem symlinks, case/Unicode aliases, Windows launchers, generated bytecode, installer-added metadata such as INSTALLER, import shadowing, ABI/tag compatibility, package dependencies or execution safety. The scheme must reflect the intended install layout; it is not inferred from the machine running the planner. No guarantee about a specific installer's extra files or behavior is implied. No source builds or editable installs.

Checked example

An offline plan for actual jwt 1.4.0 and PyJWT 2.15.1 wheels finds four shared destinations: jwt/__init__.py, jwt/exceptions.py, jwt/py.typed and jwt/utils.py. The archive URLs and hashes are in evidence/downloads.json. In a disposable staging directory, pypa installer copied the first wheel's 14 projected paths and refused the second wheel at the first predicted collision. This is local verification, not maintainer adoption. The packages were not imported.

The test suite also checks .data relocation, aliased/distinct scheme roots, console/gui scripts, within-wheel projection collisions, file/directory clashes, namespace-directory sharing, invalid metadata, duplicate members, special files, and machine-readable CLI outcomes. See evidence/QUALIFICATION.md for exact runtime, negative-control and installed-artifact scope.

OpenCV desktop and headless wheels

A second offline check uses the manylinux2014 x86-64 opencv-python and opencv-python-headless wheels for version 5.1.0.95. Under the explicit scheme in evidence/opencv-downloads.json, the pair produces 230 claims and 41 same-target conflicts, all under cv2. The manifest pins both archive URLs, sizes and SHA256 hashes, plus the checked planner commit. Pass those two wheel files and that scheme to the command in Run to reproduce the plan. Neither wheel was installed or imported.

For these exact archives, an independent intersection of regular ZIP member names gives the same 41 targets. Neither archive has .data relocation members or entry-point metadata, both have Root-Is-Purelib: false, and the scheme's library roots are equal. That simple intersection is not an oracle for arbitrary wheels. Each wheel alone has no collision in this model, not a safe-install certificate.

This illustrates a known packaging boundary, not a newly discovered OpenCV bug or maintainer adoption. Both OpenCV package and headless package pages already say to choose only one variant because they share the cv2 namespace.

Existing work and intended use

Conflict detection is not new. ModuleGuard already studies and detects import module conflicts. check-wheel-contents checks individual wheel contents. Installer and package-manager overwrite checks are useful at install time. wheelpaths instead emits an explicit, offline, cross-archive destination plan including non-module .data and generated command targets. It is a small CI or release-preflight building block, not a replacement for those tools. The research notes cite their actual capabilities and do not claim exhaustive novelty.

License

MIT. No package-index release is implied by this repository.

Invocation-wide admission limits

Option Default What counts
--max-wheels 100 Every supplied input, including repeated paths
--max-total-archive-bytes 1073741824 (1 GiB) Sum of exact archive bytes read across inputs
--max-total-members 250000 Every ZIP member, including directories/metadata
--max-claims 500000 Each projected file/directory/generated script claim
--max-conflict-claims 500000 Every claim reference in every reported conflict, counting repetitions

Each cap is an integer from 1 through 1000000000000. API booleans are not integers here. Use audit(wheels, scheme, limits=Limits(...)), importing Limits from wheelpaths, or the CLI flags above. Existing per-archive limits still apply independently, even if an aggregate cap is raised. Equality with a cap is allowed; exceeding any cap returns INVALID/exit2, never a partial collision plan. Raising a cap is an explicit choice to admit more input, not a safety guarantee.

The wheel count is checked before any archive is opened. Each archive read is bounded by the smaller of the per-archive limit plus one byte and the remaining aggregate byte budget plus one. The one excess byte detects an overrun, is never accepted into a plan, and need not be the entire next archive. Aggregate member counts are checked after ZIP indexing but before reading metadata. Claims are counted as projected, including generated console/gui scripts and repeated claims; a relocation-only directory entry skipped by the existing planner still counts as a ZIP member but does not create a projected claim. No file content is installed, extracted or executed. Budgets reset for each audit call.

These new defaults intentionally reject formerly uncapped large invocations. For inputs admitted under the defaults, successful plan structure, owner hashes, claim ordering, collision semantics and report schema remain unchanged. No new fields are added to successful reports. The CLI's INVALID JSON keeps its existing shape; consumers must not interpret an invalid result as a collision-free plan.

Conflict report admission

Limits(max_conflict_claims=N) or --max-conflict-claims N limits the sum of len(conflict["claims"]) across the complete report. A claim repeated in several conflicts is counted every time. Both same-target and file/directory conflicts count. Shared directories alone do not create conflicts or spend this budget. For example, one file blocking 100 descendant targets creates 200 claim references, even though the blocking file is only one projected claim.

Equality with the cap is accepted. If the next conflict would exceed it, the whole audit raises InvalidPlan, or the CLI returns INVALID/exit 2 without a partial conflict plan. It never clips conflicts or presents an incomplete list as a complete report. The cap is checked before constructing a combined ancestor/descendant conflict-claim list. Budget state resets for each audit call. This new default intentionally rejects previously admitted reports above the cap; reports within it retain the same fields, ordering and collision semantics.

This limits claim-reference count, not unique claims, string lengths, encoded JSON bytes or every intermediate allocation. Input claims and ZIP indexes have already been collected before conflict analysis. A long target or member string can make each reference large, so this is not a hard output-size or RAM bound. No file is installed, executed, extracted, deleted or repaired.

Output failures

The installed command and python -m wheelpaths.cli return exit 2 if stdout cannot be written or flushed, including closed pipes and full devices. This overrides the model's clear/collision status. Partial bytes already written cannot be retracted; check the process exit status before using a report. The process runner redirects failed stdout to the null device before Python's shutdown flush, avoiding an ignored flush exception and exit 120.

The callable wheelpaths.cli.main(argv) returns 2 on output failure without closing or redirecting caller-owned streams. Embedding applications own their own later flush/shutdown behavior.

Scheme decoder limits

A scheme JSON document nested beyond Python's decoder limit returns INVALID JSON and exit 2, rather than an uncaught traceback and exit 1 (which otherwise means a collision was found). This refusal happens before reading wheel archives. The nesting guard applies only to scheme decoding; unexpected planner failures are not silently turned into input errors. This is not a hard input byte, memory, or CPU limit for scheme files.

Metadata

Release files for wheelpaths 0.3.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for wheelpaths 0.3.2
File Size Uploaded Provenance Actions
wheelpaths-0.3.2.tar.gz 27.5 kB Without provenance Details for wheelpaths-0.3.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for wheelpaths 0.3.2
File Interpreter ABI Platform Actions
wheelpaths-0.3.2-py3-none-any.whl Python 3 none any Details for wheelpaths-0.3.2-py3-none-any.whl

Total release size: 41.1 kB

Release files / wheelpaths-0.3.2.tar.gz

Download URL wheelpaths-0.3.2.tar.gz
Size 27.5 kB
Tags Source
SHA-256 checksum
How to use checksums
17dc56e1697b1505398964c20218557272966b7645c22ec4323e58fe761b5970
BLAKE2b-256 checksum
How to use checksums
000abac8a1f5cd3b180911f74dbeece1a7157f48c377c53e7f136cf34c7d95e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Release files / wheelpaths-0.3.2-py3-none-any.whl

Download URL wheelpaths-0.3.2-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
038fd519b5ffcf3a695403b595ea01357ca9cb12536be550faadc2f26dc1d087
BLAKE2b-256 checksum
How to use checksums
88e1875a9bad1b651a41db19f15ad2ee676392c1b14a6755a0f366357a940017
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.15.2

Security for wheelpaths 0.3.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page