首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >将诗歌剧本转换为conda yaml为Intel Lava?

将诗歌剧本转换为conda yaml为Intel Lava?
EN

Stack Overflow用户
提问于 2022-03-29 12:35:20
回答 2查看 195关注 0票数 2

上下文

英特尔在Linux/MacOS指令上为Lava神经形态计算框架设置设备的说明提供了几个pip命令、一个git克隆命令和一些诗歌说明。我习惯于将pip命令集成到用于conda的environment.yml中,我认为git克隆命令也可以包含在environment.yml文件中。然而,我还不知道如何整合诗歌指令。

问题

因此,我想问:如何将以下安装脚本转换为(单个) conda环境yaml文件?

代码语言:javascript
复制
cd $HOME
pip install -U pip
pip install "poetry>=1.1.13"
git clone git@github.com:lava-nc/lava.git
cd lava
poetry config virtualenvs.in-project true
poetry install
source .venv/bin/activate
pytest

尝试

我已经成功地在一个environment.yml中安装了Lava软件,使用:

代码语言:javascript
复制
# 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

我已经安装了:

代码语言:javascript
复制
conda env create --file lava_environment.yml

然而,该从二进制文件中安装而不是从源。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2022-07-16 06:46:47

environment.yml可用于安装和使用Lavav0.0.3框架:

代码语言:javascript
复制
# This file is to automatically configure your environment. It allows you to
# run the code with a single command without having to install anything
# (extra).

# First run: conda env create --file environment.yml
# If you change this file, run: conda env update --file environment.yml

# Instructions for this networkx-to-lava-nc repository only. First time usage
# On Ubuntu (this is needed for lava-nc):
# sudo apt upgrade
# sudo apt full-upgrade
# yes | sudo apt install gcc

# Conda configuration settings. (Specify which modules/packages are installed.)
name: nx2lava
channels:
  - conda-forge
dependencies:
# Specify specific python version.
  - python=3.8
# Run python tests.
  - pytest-cov
# Generate plots.
  - matplotlib
# Run graph software quickly.
  - networkx
  - pip
  - pip:
# Run pip install on .tar.gz file in GitHub repository (For lava-nc only).
    - https://github.com/lava-nc/lava/releases/download/v0.3.0/lava-nc-0.3.0.tar.gz
# Turns relative import paths into absolute import paths.
    - absolufy-imports
# Auto format Python code to make it flake8 compliant.
    - autoflake
# Scan Python code for security issues.
    - bandit
# Code formatting compliance.
    - black
# Correct code misspellings.
    - codespell
# Verify percentage of code that has at least 1 test.
    - coverage
# Auto formats the Python documentation written in the code.
    - docformatter
# Auto generate docstrings.
    - flake8
# Auto sort the import statements.
    - isort
# Auto format Markdown files.
    - mdformat
# Auto check static typing.
    - mypy
# Auto generate documentation.
    - pdoc3
# Auto check programming style aspects.
    - pylint
# Auto generate docstrings.
    - pyment
# Identify and remove dead code.
    - vulture
# Include GitHub pre-commit hook.
    - pre-commit
# Automatically upgrades Python syntax to the new Python version syntax.
    - pyupgrade
# Another static type checker for python like mypy.
    - pyright

它还包括使用pre-commit的质量保证包。

票数 0
EN

Stack Overflow用户

发布于 2022-03-29 13:47:07

这可能对你有帮助:

代码语言:javascript
复制
cd $HOME
pip install -U pip
pip install "poetry>=1.1.13"
git clone git@github.com:lava-nc/lava.git
cd lava
poetry config virtualenvs.in-project true
poetry install
poetry run pytest

在脚本中使用poetry时,更容易不手动激活venv (原因是source很难使用),而是使用poetry run 执行应该知道venv的命令。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71662125

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档