Note

This library is free to use under the MIT license. Any additions are very much appreciated, in terms of suggested functionality, code, documentation, testimonials, word of mouth advertisement, etc. Bug reports or feature requests can be filed on GitHub. As always, the code comes with no guarantee. None of the developers can be held responsible for possible mistakes.

Download: .zip file | .tar.gz file.

(c - MIT) T.W.J. de Geus (Tom) | tom@geus.me | www.geus.me | github.com/tdegeus/conda_envfile

ci Documentation Status pre-commit pre-commit Conda Version

Documentation: `https://conda_envfile.readthedocs.io <conda_envfile.readthedocs.io>`_

conda_envfile#

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

Command line#

conda_envfile_merge#

Merge different environment files. For example:

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.

conda_envfile_diff#

Show the difference between two environment files. For example:

conda_envfile_diff env1.yml env2.yml

pre-commit#

conda_envfile_parse#

Keep your environment.yaml file unique, sorted, and legal in terms of version limitations. In your .pre-commit-config.yaml, add:

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

conda_envfile_pyproject#

Keep your pyproject.toml and environment.yaml in sync. In your .pre-commit-config.yaml, add:

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

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"]

Contents#