tdegeus / conda_envfile

Parse conda environment yaml files

Home Page:https://conda_envfile.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ci Documentation Status pre-commit pre-commit Conda Version

Documentation: https://conda_envfile.readthedocs.io

conda_envfile

Provides a Python library, command line tools, and pre-commit tools to manage conda environment files.

Command line

From the command line:

conda_envfile_merge -a "extra-library" env1.yml env2.yml > env3.yml

merges env1.yml and env2.yml and adds the package extra-library to the merged environment file env3.yml.

pre-commit

In your .pre-commit-config.yaml, add:

- repo: https://github.com/tdegeus/conda_envfile
  rev: v0.2.1
  hooks:
  - id: conda_envfile_parse
    files: "environment.yaml"

to keep your environment.yaml file unique, sorted, and legal in terms of version limitations.

Python

Combine different version restrictions. For example:

import conda_envfile

list(map(str, conda_envfile.unique("foo >1.2.0", "foo =1.2.*")))

which returns

["foo >1.2.0, <1.3.0"]

About

Parse conda environment yaml files

https://conda_envfile.readthedocs.io

License:MIT License


Languages

Language:Python 100.0%