-
Notifications
You must be signed in to change notification settings - Fork 4
Improve optional dependency handling and install documentation #75
Copy link
Copy link
Open
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request
Description
Context
Raised during JOSS review (openjournals/joss-reviews#10072) by @yewentao256, who recommended "making a full requirements.txt file for user and fix all unit tests".
Problem
While pyproject.toml already declares core dependencies and an extras optional group (jax, cupy), there are gaps:
- The
[project.optional-dependencies]extrasgroup bundles CuPy and JAX together — these should be separate extras so users can install only what they need (e.g.pip install torchsparsegradutils[cupy]orpip install torchsparsegradutils[jax]). - The CuPy extra doesn't specify a version range, meaning users may install an incompatible version (see #issue_2 for the
tol/rtolbreakage). - Tests that depend on optional packages (CuPy, JAX) should skip gracefully with a clear message when the dependency is not installed or is an unsupported version, rather than failing with an import or runtime error.
- The README and docs installation section should clearly document the optional extras and what each one provides.
Proposed Changes
- Split
extrasinto separate optional dependency groups inpyproject.toml:[project.optional-dependencies] cupy = ["cupy-cuda12x>=13.0"] # or appropriate version range jax = ["jax[cuda12]"] all = ["torchsparsegradutils[cupy,jax]"] dev = [...] docs = [...]
- Add version constraints for CuPy to ensure compatibility with the solver kwarg API.
- Ensure all tests using optional dependencies use
pytest.importorskip()or equivalent skip markers. - Update README and RTD docs installation instructions to document the extras.
Acceptance Criteria
- Optional dependencies are properly separated in
pyproject.toml - CuPy version range is pinned to supported versions
- Tests skip cleanly when optional dependencies are missing
- Installation instructions in README and docs are updated
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
documentationImprovements or additions to documentationImprovements or additions to documentationenhancementNew feature or requestNew feature or request