MambaをPoetryで管理する
mamba-ssmやcausal-conv1dがPEP517に準拠していないのでpoetry add <package-name>だとインスコできない
poetry add <path>でもsetup.py読んでくれないからムリ
→ 無理やりローカルでwheelを作ってpoetry addすればOK
python setup.py bdist_wheel
一例
code:install.sh
set -e # Exit immediately if a command exits with a non-zero status.
which python || exit 1
pip install poetry || exit 1
poetry install || exit 1
for package in "causal-conv1d" "mamba"
do
cd $package
python setup.py bdist_wheel
wheel_path=$(find pwd -name "*.whl" | grep linux)
cd ../
poetry add $wheel_path
done
For English speakers:
The issue arises because mamba-ssm and causal-conv1d are not compliant with PEP 517. This means you can't install them using the standard poetry add <package-name> command. Furthermore, attempting to add them via poetry add <path> doesn't work either, as this method does not execute setup.py.
I found a workaround: you can manually build a wheel for the package locally and then add it to your project using Poetry. This can be done by running python setup.py bdist_wheel. This process creates a wheel file, which can then be successfully added to your project with Poetry.