Command-line tools#
conda_envfile_parse#
Parse conda environment files. This keeps the list of packages unique, sorted, and with legal versions. It assumes YAML-files formatted like:
name: ...
channels:
- ...
- ...
dependencies:
- ...
- ...
usage: conda_envfile_parse [-h] [--version] [str ...]
Positional Arguments#
- files
Input files.
Named Arguments#
- --version
show program’s version number and exit
conda_envfile_merge#
Merge conda environment files. This creates a list of packages that is unique, sorted, and with the most restrictive versions. It assumes YAML-files formatted like:
name: ...
channels:
- ...
- ...
dependencies:
- ...
- ...
usage: conda_envfile_merge [-h] [--version] [-f] [-o str] [-a str] [-r str]
[--no-name] [--github-action str]
[str ...]
Positional Arguments#
- files
Input file(s).
Named Arguments#
- --version
show program’s version number and exit
- -f, --force
Force overwrite output file.
Default: False
- -o, --output
Write to output file.
- -a, --append
Append deps
Default: []
- -r, --remove
Remove deps
Default: []
- --no-name
Remove name from output.
Default: False
- --github-action
Interpret file as GitHub action
Default: []
conda_envfile_diff#
Print diff of two files.
usage: conda_envfile_diff [-h] [--version] [--conda-forge str] [str ...]
Positional Arguments#
- files
Input files.
Named Arguments#
- --version
show program’s version number and exit
- --conda-forge
Interpret the next file (
a
orb
) as conda-forge feedstock.Default: []
conda_envfile_pyproject#
Sync the version limitations in a pyproject.toml
file and a conda environment.yaml
file.
Optionally, all dependencies of one file can be added to the other
(--from-pyproject
or --from-environment
).
Note
Most often, the conda-forge dependencies are the lowercase package names.
For some packages a non-trivial mapping is required.
Use --mapping
to add custom mapping(s).
Please open a pull request to add any missing mapping to the aliases
dictionary.
usage: conda_envfile_pyproject [-h] [--version] [--format] [--mapping str str]
[-p] [-e] [--pyproject Path]
Path
Positional Arguments#
- environment
environment.yaml
Named Arguments#
- --version
show program’s version number and exit
- --format
Basic formatting of both files: unique sorted dependency-list
Default: False
- --mapping
Mapping [‘pyproject’, ‘conda’]
Default: []
- -p, --from-pyproject
Add all dependencies in pyproject to environment
Default: False
- -e, --from-environment
Add all dependencies in environment to pyproject
Default: False
- --pyproject
pyproject.toml
Default: pyproject.toml
conda_envfile_restrict#
Restrict version of packages based on another YAML file. Example:
conda_envfile_restrict source.yml env.yml ... > source_restricted.yml
To check conda-forge feedstocks, use:
conda_envfile_restrict --conda-forge meta.yml env.yml
In this case, this function only checks and outputs a 1
return code if the feedstock
is not restrictive enough. It does not print a formatted output of source
.
usage: conda_envfile_restrict [-h] [--version] [-f] [-o str]
[--conda-forge str] [-a str]
[str] [str ...]
Positional Arguments#
- source
Input file.
- comparison
Comparison file(s).
Named Arguments#
- --version
show program’s version number and exit
- -f, --force
Force overwrite output file.
Default: False
- -o, --output
Write to output file.
- --conda-forge
Interpret the next file (
source
orcomparison
) as conda-forge feedstock.- -a, --append
Append deps
Default: []