Crates.io | viva |
lib.rs | viva |
version | 0.0.3 |
source | src |
created_at | 2023-04-11 15:51:17.283248 |
updated_at | 2023-04-18 12:27:08.408219 |
description | Transparently create environments and run executables contained within. |
homepage | https://github.com/frkl-dev/viva |
repository | https://github.com/frkl-dev/viva |
max_upload_size | |
id | 836142 |
size | 210,036 |
A generic environment wrapper and (in the future) script interpreter.
This project is in very early alpha state, and its main purpose is to serve as a library for another project I'm working on. That being said, I think the pattern I want it to encapsulate can be useful for other/similar circumstances, which is why it's published as a separate project.
In general, this is just a thin wrapper around the brilliant 'rattler' library, and most of the interesting stuff happens there. So, in most cases I'd recommond to use that library directly.
# install the 'cookiecutter' package into the 'default' environment (if not already there)
viva -c conda-forge -s cookiecutter apply
# install the 'cookiecutter' package into an environment called 'project-templates' (if not already there), then run it
# note the '--' to separate the viva arguments from the command arguments
viva -e project-templates -c conda-forge -s cookiecutter run -- cookiecutter --help
# list all existing environments
viva list-envs
# delete the environment called 'project-templates'
viva -e project-templates remove
Each environment lives in a so-called 'target-prefix', where all (well, most, if I understand right) files are hard-linked into, which means that if you create 2 or more environments with the same packages, the space used would be equal to a single one (plus some small fileystem metadata).
In addition, each environment has a spec (json) file that records which channels where used to create it, and also which packages (matchspecs).
The location of the environment and spec file depends on the OS, and how the environment was specified (see below).
In case the environment was specified as a simple string representing an alias:
viva list-envs
to see the actual path), plus viva/envs/
viva/envs/
Otherwise:
For now, I'm only interested in the former case, and the latter is only stubbed out, but I did not want to close the door to having this flexibility.
-e
/ --env
command-line argumentIn viva, an environment can be specified in several different ways by the env-spec string. viva parses the string in teh following order, the first match will determine where the environment lives:
/
on Posix, '' on Windows):
_
:
viva
script interpreterThis project is MPL v2.0 & BSD-3 Clause licensed, for the license texts please check the LICENSES file in this repository.
Code under src/rattler
:
Everything else: