Add third-wheel sync, add, and cache-clean commands - #9
Merged
Conversation
New sync module reads rename specs from pyproject.toml's [tool.third-wheel] section, downloads/renames wheels, and installs them via uv pip install. Supports --find-links for local wheels, auto-detects pixi/conda environments via CONDA_PREFIX, and caches renamed wheels to avoid redundant work. Also adds cache-clean command, makes rename.py/run.py helpers public for reuse, expands test coverage (206 tests passing), adds a scikit-image comparison example, and documents known issues in AGENTS.md. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Scope add_rename_to_pyproject regex to [tool.third-wheel] section to avoid corrupting unrelated TOML sections - Error when explicitly-provided --pyproject path doesn't exist in sync_cmd - Read pyproject config for index-url in add_cmd --sync - Fall back to default uv pip install when conda python path doesn't exist - Move mutual exclusion check before early return in cache_clean_cmd - Catch only TOMLDecodeError instead of bare Exception in get_pyproject_config - Standardize error emoji across all CLI commands - Fix source attribution in sync_cmd rename display - Remove dead _has_server_extras() function Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Adds add_rename_to_script() which modifies a PEP 723 metadata block to add the renamed dependency and a [tool.third-wheel] renames entry. The CLI `add` command now accepts `--script <path>` to target a script file instead of pyproject.toml. Includes 13 new tests (unit + integration round-trips) covering: - Adding to scripts with/without existing [tool.third-wheel] sections - Updating existing renames, dedup of dependencies - Multi-rename round-trip parsing, comment annotation preservation - CLI invocation and error handling Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
third-wheel sync— reads[tool.third-wheel].renamesfrom pyproject.toml, downloads/renames wheels, and installs viauv pip install. Supports--find-linksfor local wheels, auto-detects pixi/conda envs viaCONDA_PREFIX, and caches renamed wheels.third-wheel add— adds a rename entry to pyproject.toml's[tool.third-wheel]section, with optional--syncto immediately install.third-wheel cache-clean— clears cached renamed wheels (--sync-only,--run-only, or all).normalize_name,parse_wheel_filename,compute_record_hash,cache_dir,rename_cache_key,prepare_wheels,merge_renamespublic for reuse bysync.py._has_server_extras()function.Bugfixes included
add_rename_to_pyprojectregex now scoped to[tool.third-wheel]section (was matching anywhere in TOML)sync_cmderrors on missing explicitly-provided--pyprojectpathadd_cmd --syncreads pyproject config for index-url (was hardcoding PyPI default)_detect_installergracefully falls back when conda python binary doesn't existcache_clean_cmdvalidates--sync-only/--run-onlymutual exclusion before early returnget_pyproject_configcatches onlyTOMLDecodeErrorinstead of bareExceptionsync_cmdTest plan
uv run pytest tests/)uv run ruff checkcleanthird-wheel syncwith a pyproject.toml containing[tool.third-wheel].renamesthird-wheel add "icechunk<2=icechunk_v1" --syncthird-wheel cache-clean -v🤖 Generated with Claude Code