Skip to content

build: move vesin[torch] to the torch extra (fix conda-forge)#5501

Merged
njzjz merged 1 commit into
deepmodeling:masterfrom
wanghan-iapcm:fix-vesin-torch-extra
Jun 7, 2026
Merged

build: move vesin[torch] to the torch extra (fix conda-forge)#5501
njzjz merged 1 commit into
deepmodeling:masterfrom
wanghan-iapcm:fix-vesin-torch-extra

Conversation

@wanghan-iapcm

@wanghan-iapcm wanghan-iapcm commented Jun 7, 2026

Copy link
Copy Markdown
Collaborator

Summary

vesin's torch bindings ship as a separate PyPI package (vesin-torch, pulled in by the vesin[torch] extra). conda-forge packages vesin but not vesin-torch, so listing vesin[torch] in the core dependencies (added in #5491) breaks the conda-forge build of the base deepmd-kit package.

This moves vesin[torch] out of the core dependencies and into the torch optional-dependency extra (backend/find_pytorch.get_pt_requirement), so only deepmd-kit[torch] (pip) pulls it. The neighbor-list runtime already guards usage via is_vesin_torch_available(), and nlist_backend="auto" falls back to the native builder when vesin is absent, so this is behavior-preserving for installs that don't ship the torch extra.

Changes

  • pyproject.toml: drop vesin[torch] from core dependencies.
  • backend/find_pytorch.py: add vesin[torch] to the torch extra.

Known limitations

  • No automated test covers the build-backend's generated extras; the change is verified by inspection (the pip install deepmd-kit[torch] resolution and the conda-forge recipe build are not exercised in CI here).
  • When torch is not requested, the torch extra is empty and vesin is not installed (intended).

Summary by CodeRabbit

  • Chores
    • Adjusted dependency configuration for improved package management.

vesin's torch bindings ship as a separate PyPI package (vesin-torch, pulled
in by the vesin[torch] extra).  conda-forge packages vesin but not
vesin-torch, so listing vesin[torch] in the core dependencies breaks the
conda-forge build.  Move it under the torch optional-dependency extra
(get_pt_requirement), so only deepmd-kit[torch] (pip) pulls it; the runtime
already guards usage via is_vesin_torch_available().
@dosubot dosubot Bot added the build label Jun 7, 2026
@coderabbitai

coderabbitai Bot commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 145f7e48-d06d-473f-a425-dc2dec7b3d05

📥 Commits

Reviewing files that changed from the base of the PR and between 2e3117e and 629a66c.

📒 Files selected for processing (2)
  • backend/find_pytorch.py
  • pyproject.toml
💤 Files with no reviewable changes (1)
  • pyproject.toml

📝 Walkthrough

Walkthrough

The PR relocates the vesin[torch] dependency from static project declarations in pyproject.toml to conditional inclusion in get_pt_requirement() within the backend module, making the dependency available only when PyTorch is unavailable during backend initialization.

Changes

Conditional vesin[torch] dependency handling

Layer / File(s) Summary
Relocate vesin[torch] to conditional requirement
backend/find_pytorch.py, pyproject.toml
get_pt_requirement() now includes vesin[torch] in the returned PyTorch dependency list with supporting comments, while the entry is removed from static project.dependencies to avoid duplication.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies the main change: moving vesin[torch] from core dependencies to the torch extra to resolve a conda-forge compatibility issue.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@wanghan-iapcm wanghan-iapcm requested a review from njzjz June 7, 2026 02:31
@codecov

codecov Bot commented Jun 7, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.41%. Comparing base (2e3117e) to head (629a66c).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #5501      +/-   ##
==========================================
- Coverage   81.42%   81.41%   -0.01%     
==========================================
  Files         871      871              
  Lines       96951    96952       +1     
  Branches     4240     4241       +1     
==========================================
- Hits        78941    78938       -3     
- Misses      16707    16711       +4     
  Partials     1303     1303              

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@njzjz njzjz added this pull request to the merge queue Jun 7, 2026
Merged via the queue into deepmodeling:master with commit 99c1ece Jun 7, 2026
73 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants