Skip to content

Graceful operation without aimnet (conda-forge groundwork) - #177

Merged
isayev merged 12 commits into
mainfrom
feat/conda-no-aimnet
Aug 27, 2026
Merged

isayev merged 12 commits into
mainfrom
feat/conda-no-aimnet

Conversation

@isayev

@isayev isayev commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Summary

Makes Auto3D fully usable without the aimnet package, so the conda-forge package (which cannot ship aimnet — its dependency nvalchemi-toolkit-ops is pip-only) can be updated past 2.3.0. Groundwork for #91; that issue closes when the feedstock update lands, not with this PR.

  • require_aimnet() (engines/models/availability.py): every import aimnet site now reports a missing aimnet as DependencyError (CLI exit 3, same convention as missing torchani) with an actionable hint, instead of a raw ModuleNotFoundError. A ModuleNotFoundError naming any other module re-raises unchanged.
  • Wired into all three aimnet import sites: resolve_engine_name, preflight_model, AIMNet2Adapter.__init__.
  • CLI hints map gains "aimnet": "Install: pip install aimnet"; end-to-end exit-3 test mirrors the torchani one, with a discriminating assertion on the hint prefix.
  • New no-aimnet CI job emulating the future conda environment: install .[ani,ase,dev], uninstall aimnet, then bare import Auto3D, whole-suite collection, the no-aimnet behavior tests, and an ANI2xt construction smoke test.
  • Docs: conda install story in README, installation.rst, and howto/conda_build.rst (all hedged to stay true until the recipe/feedstock updates land); CHANGELOG entries under Unreleased.

pyproject.toml is unchanged — aimnet>=0.2 stays a required pip dependency; pip UX is untouched.

Test plan

  • pytest tests/ fast suite: 1782 passed.
  • New tests/test_no_aimnet.py (10 tests) covers the helper, both preflight sites, the adapter, and the broken-transitive-dep re-raise case.
  • The no-aimnet CI job on this PR is the first genuine (not simulated) run of the aimnet-absent environment.

isayev added 12 commits August 26, 2026 22:55
The no-aimnet CI job comment and conda_build.rst both asserted the
conda-forge shape (no aimnet, plus torchani/ase) and the recipe update as
already true. Neither is: conda-forge is still on 2.3.0 and
conda-recipe/meta.yaml still matches 3.0.0 with aimnet in run deps. Rephrase
both as forward-looking, and note that `pip uninstall -y aimnet` in the CI
job leaves aimnet's transitive dependencies installed, so it cannot catch
code relying on a package that only arrives via that dependency tree -- the
real conda build remains the gate for that case.
auto3d run with the default engine -- the flagship conda-user path -- had
no no-aimnet exit-code test, even though models test did. Add
test_exit_3_run_without_aimnet alongside it.

auto3d models info was claimed in the CHANGELOG to work without aimnet
installed, but nothing exercised that. Add a test confirming it: the
command's ENGINE_INFO lookup never imports aimnet, so it renders correctly
even for the AIMNET engine with the package hidden.
@isayev
isayev merged commit 21df50a into main Aug 27, 2026
9 checks passed
@isayev isayev mentioned this pull request Aug 27, 2026
@isayev
isayev deleted the feat/conda-no-aimnet branch September 8, 2026 15:16
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