Skip to content

Add third-wheel sync, add, and cache-clean commands - #9

Merged
ianhi merged 3 commits into
mainfrom
feat/sync-and-improvements
Mar 11, 2026
Merged

Add third-wheel sync, add, and cache-clean commands#9
ianhi merged 3 commits into
mainfrom
feat/sync-and-improvements

Conversation

@ianhi

@ianhi ianhi commented Mar 11, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • third-wheel sync — reads [tool.third-wheel].renames from pyproject.toml, downloads/renames wheels, and installs via uv pip install. Supports --find-links for local wheels, auto-detects pixi/conda envs via CONDA_PREFIX, and caches renamed wheels.
  • third-wheel add — adds a rename entry to pyproject.toml's [tool.third-wheel] section, with optional --sync to immediately install.
  • third-wheel cache-clean — clears cached renamed wheels (--sync-only, --run-only, or all).
  • Makes normalize_name, parse_wheel_filename, compute_record_hash, cache_dir, rename_cache_key, prepare_wheels, merge_renames public for reuse by sync.py.
  • Removes dead _has_server_extras() function.
  • Adds scikit-image comparison example.
  • Documents known issues and tech debt in AGENTS.md.

Bugfixes included

  • add_rename_to_pyproject regex now scoped to [tool.third-wheel] section (was matching anywhere in TOML)
  • sync_cmd errors on missing explicitly-provided --pyproject path
  • add_cmd --sync reads pyproject config for index-url (was hardcoding PyPI default)
  • _detect_installer gracefully falls back when conda python binary doesn't exist
  • cache_clean_cmd validates --sync-only/--run-only mutual exclusion before early return
  • get_pyproject_config catches only TOMLDecodeError instead of bare Exception
  • Standardized error emoji across all CLI commands
  • Fixed source attribution display in sync_cmd

Test plan

  • 206 tests pass (uv run pytest tests/)
  • uv run ruff check clean
  • Pre-commit hooks pass
  • Manual test: third-wheel sync with a pyproject.toml containing [tool.third-wheel].renames
  • Manual test: third-wheel add "icechunk<2=icechunk_v1" --sync
  • Manual test: third-wheel cache-clean -v

🤖 Generated with Claude Code

ianhi and others added 3 commits March 10, 2026 21:59
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>
@ianhi
ianhi merged commit 128e0ba into main Mar 11, 2026
5 checks passed
@ianhi
ianhi deleted the feat/sync-and-improvements branch March 11, 2026 02:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant