deps: declare fbm as a runtime dependency, not a dev extra - #6
Merged
Conversation
powersig/util/__init__.py imports fbm_utils eagerly and fbm_utils does `from fbm import FBM`, so fbm is needed to import the package at all — but it was only listed in the dev extra and requirements-dev.txt. On a plain install powersig.util.grid, powersig.torch.algorithm and powersig.cupy_backend.algorithm all raise ModuleNotFoundError: No module named 'fbm'. That is the torch and cupy backends unimportable from a released wheel. fbm is safe to require: version 0.3.0 is a pure-Python py3-none-any wheel, four source modules, no compiled extensions, and numpy is its only dependency — which this project already requires. Nothing CUDA-specific or platform-specific. Removed from the dev extra and requirements-dev.txt, where it is now redundant. Verified: the three imports above succeed, and tests/test_core_jax.py stays 21/21.
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.
Follow-up to #5 on the same branch — one last-minute packaging fix found while landing that work.
The problem
fbmwas declared only in thedevextra andrequirements-dev.txt, but it is imported at package load time:powersig/util/__init__.py:1—from .fbm_utils import fractional_brownian_motionpowersig/util/fbm_utils.py:3—from fbm import FBMBecause
__init__.pypullsfbm_utilsin eagerly, importing anything underpowersig.utilexecutes thatfrom fbm import FBM. That takes down the backends on a plain (non-dev) install:powersig/torch/algorithm.py:6—from powersig.util.grid import get_diagonal_rangepowersig/cupy_backend/algorithm.py:5—from powersig.util.grid import get_diagonal_rangepowersig/jax/utils.py:5—import powersig.util.fbm_utilsAll of them raise
ModuleNotFoundError: No module named 'fbm'— i.e. the torch and cupy backends are unimportable from a released wheel.The fix
Move
fbm>=0.3.0from thedevextra into[project].dependencies, and add it torequirements.txt. Removed from thedevextra andrequirements-dev.txt, where it is now redundant.fbmis safe to require unconditionally: 0.3.0 is a pure-Pythonpy3-none-anywheel, four source modules, no compiled extensions, and numpy is its only dependency — which this project already requires. Nothing CUDA-specific or platform-specific, so it adds no constraint to the CUDA 13 stack landed in #5.Verification
Per the commit message: the three imports above succeed, and
tests/test_core_jax.pystays 21/21.The import chain above was also confirmed statically against the branch tree.
CI note: the workflow installs
.[jax-cpu,dev].fbmleaving thedevextra doesn't remove it from that install — it moves into the coredependencies, whichpip install .always resolves. So CI keeps gettingfbm, and this change is exactly what makes a plainpip install powersigget it too.