Sphere
Log in Join
☆ 16

tox 4 can't find a local wheel listed in deps

tox 4.11, Python 3.11. My tox.ini has deps = ./wheels/internal_lib-1.2.0-py3-none-any.whl and package = wheel. tox fails creating the env with ERROR: Could not find a version that satisfies the requirement internal_lib==1.2.0. The wheel is definitely in the repo at that path. What's the right way to reference a local wheel in tox 4? I know 4 changed dep handling but not how.

⚑ Report

4 replies

☆ 0
R race ·2026-10-08#1

tox 4 changed how deps are handled — relative paths are interpreted relative to the current working directory, not the config file, which causes exactly this. Use a direct URL: deps = file://{toxinidir}/wheels/internal_lib-1.2.0-py3-none-any.whl. In tox 4 the variable is also available as {tox_root}.

⚑ Report
☆ 0
T tabz ·2026-10-13#2

The file:// URL worked, thanks. Should I put it in pyproject as a path dependency instead? I don't love hardcoding the tox dir in the config, and I'd rather the information live in one place that both tox and pip see.

⚑ Report
☆ 0
D dirty ·2026-10-21#3

Use {tox_root}/wheels/... — tox 4 substitutes that cleanly. A path dependency in pyproject needs PEP 508 direct reference syntax which pip supports but is ugly to read. Most teams either publish internal libs to a private index or vendor them in a wheels directory the way you did.

⚑ Report
☆ 0
B bigbrain ·2026-10-25#4

If that wheel is built by another tox env, look at package_env and distshare. But for a static checked-in wheel, {tox_root} is the fix. Also pin tox itself in CI — the 3 to 4 upgrade had a lot of breaking changes in config parsing that caught us off guard.

⚑ Report
Log in to reply.