'Converting poetry script to conda yaml for Intel Lava-nc?
Context
The instructions on the Linux/MacOS instructions to setup your device for the Lava neuromorphic computing framework by Intel provide a few pip commands, a git clone command and some poetry instructions. I am used to be able to integrate pip commands in an environment.yml for conda, and I thought the git clone command could also be included in the environment.yml file. However, I am not yet sure how to integrate the poetry commands.
Question
Hence, I would like to ask: How can I convert the following installation script into a (single) conda environment yaml file?:
cd $HOME
pip install -U pip
pip install "poetry>=1.1.13"
git clone [email protected]:lava-nc/lava.git
cd lava
poetry config virtualenvs.in-project true
poetry install
source .venv/bin/activate
pytest
Attempts
I have been able to install the Lava software successfully in a single environment.yml using:
# run: conda env create --file lava_environment.yml
# include new packages: conda env update --file lava_environment.yml
name: lava
channels:
- conda-forge
- conda
dependencies:
- anaconda
- conda:
# Run python tests.
- pytest=6.1.2
- pip
- pip:
# Auto generate docstrings
- pyment
# Run pip install on .tar.gz file in GitHub repository.
- https://github.com/lava-nc/lava/releases/download/v0.3.0/lava-nc-0.3.0.tar.gz
Which I've installed with:
conda env create --file lava_environment.yml
However, that installs it from a binary instead of from source.
Solution 1:[1]
This will probably help you:
cd $HOME
pip install -U pip
pip install "poetry>=1.1.13"
git clone [email protected]:lava-nc/lava.git
cd lava
poetry config virtualenvs.in-project true
poetry install
poetry run pytest
When using poetry in scripts, it's easier not to activate the venv manually (reason being that source can be hard to work with), and instead use poetry run <command> to execute commands that should be aware of the venv.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
