![]() |
STASIS
A pipeline delivery generator
|
#include <stdio.h>#include <string.h>#include <sys/utsname.h>#include "core.h"#include "download.h"
Go to the source code of this file.
Data Structures | |
| struct | CondaCapabilities |
| Collection of feature flags to support older, newer, and transitional versions of conda/mamba. More... | |
| struct | MicromambaInfo |
Macros | |
| #define | CONDA_INSTALL_PREFIX "conda" |
| #define | PYPI_INDEX_DEFAULT "https://pypi.org/simple" |
| #define | PKG_USE_PIP 0 |
| #define | PKG_USE_CONDA 1 |
| #define | PKG_NOT_FOUND 0 |
| #define | PKG_FOUND 1 |
| #define | PKG_INDEX_PROVIDES_ERROR_MESSAGE_OFFSET (-10) |
| #define | PKG_E_SUCCESS (PKG_INDEX_PROVIDES_ERROR_MESSAGE_OFFSET + 0) |
| #define | PKG_INDEX_PROVIDES_E_INTERNAL_MODE_UNKNOWN (PKG_INDEX_PROVIDES_ERROR_MESSAGE_OFFSET + 1) |
| #define | PKG_INDEX_PROVIDES_E_INTERNAL_LOG_HANDLE (PKG_INDEX_PROVIDES_ERROR_MESSAGE_OFFSET + 2) |
| #define | PKG_INDEX_PROVIDES_E_MANAGER_RUNTIME (PKG_INDEX_PROVIDES_ERROR_MESSAGE_OFFSET + 3) |
| #define | PKG_INDEX_PROVIDES_E_MANAGER_SIGNALED (PKG_INDEX_PROVIDES_ERROR_MESSAGE_OFFSET + 4) |
| #define | PKG_INDEX_PROVIDES_E_MANAGER_EXEC (PKG_INDEX_PROVIDES_ERROR_MESSAGE_OFFSET + 5) |
| #define | PKG_INDEX_PROVIDES_FAILED(ECODE) |
Functions | |
| int | conda_capable (struct CondaCapabilities *ccap, const char *root) |
| void | conda_capable_free (struct CondaCapabilities *ccap) |
| int | micromamba_install (const struct MicromambaInfo *info) |
| int | micromamba (const struct MicromambaInfo *info, char *command,...) |
| int | python_exec (const char *args) |
| int | pip_exec (const char *args) |
| char * | python_importlib_metadata_version (const char *package_name) |
| int | conda_exec (const char *args) |
| int | conda_activate (const char *root, const char *env_name) |
| int | conda_setup_headless (struct CondaCapabilities *cc) |
| int | conda_env_create_from_uri (char *name, char *uri, char *python_version) |
| int | conda_env_create (char *name, char *python_version, char *packages) |
| int | conda_env_remove (char *name) |
| int | conda_env_export (char *name, char *output_dir, char *output_filename) |
| int | conda_index (const char *path) |
| int | pkg_index_provides (int mode, const char *index, const char *spec, const char *logdir) |
| const char * | pkg_index_provides_strerror (int code) |
| char * | conda_get_active_environment () |
| int | conda_env_exists (const char *root, const char *name) |
| #define PKG_INDEX_PROVIDES_FAILED | ( | ECODE | ) |
| int conda_activate | ( | const char * | root, |
| const char * | env_name ) |
Configure the runtime environment to use Conda/Mamba
| root | directory where conda is installed |
| env_name | the conda environment to activate |
| int conda_capable | ( | struct CondaCapabilities * | ccap, |
| const char * | root ) |
Check for the existence of "Conda" and set flags based on the availability of features
| ccap | a pointer to an empty struct CondaCapabilities |
| root | conda installation root directory |

| void conda_capable_free | ( | struct CondaCapabilities * | ccap | ) |
Free memory allocated by conda_capable
| ccap | a pointer to a populated struct CondaCapabilities |
| int conda_env_create | ( | char * | name, |
| char * | python_version, | ||
| char * | packages ) |
Create a Conda environment using generic package specs
| name | Environment name |
| python_version | Desired version of Python |
| packages | Packages to install (or NULL) |
| int conda_env_create_from_uri | ( | char * | name, |
| char * | uri, | ||
| char * | python_version ) |
Creates a Conda environment from a YAML config
| name | Name of new environment to create |
| uri | /path/to/environment.yml |
| uri | file:///path/to/environment.yml |
| uri | http://myserver.tld/environment.yml |
| uri | https://myserver.tld/environment.yml |
| uri | ftp://myserver.tld/environment.yml |

| int conda_env_export | ( | char * | name, |
| char * | output_dir, | ||
| char * | output_filename ) |
Export a Conda environment in YAML format
| name | Environment name to export |
| output_dir | Destination directory |
| output_filename | Destination file name |
| int conda_env_remove | ( | char * | name | ) |
Remove a Conda environment
| name | Environment name |
| int conda_exec | ( | const char * | args | ) |
Execute conda (or if possible, mamba) Conda/Mamba is determined by PATH
| args | arguments to pass to Conda |

| int conda_index | ( | const char * | path | ) |
Run "conda index" on a local conda channel
| path | Top-level directory of conda channel |
| int conda_setup_headless | ( | struct CondaCapabilities * | cc | ) |
Configure the active conda installation for headless operation

| int micromamba | ( | const struct MicromambaInfo * | info, |
| char * | command, | ||
| ... ) |
Execute micromamba
| info | MicromambaInfo data structure (must be populated before use) |
| command | printf-style formatter string |
| ... | variadic arguments |

| int micromamba_install | ( | const struct MicromambaInfo * | info | ) |
Download and install Micromamba
| info | MicromambaInfo data structure (must be populated before use) |

| int pip_exec | ( | const char * | args | ) |
| int pkg_index_provides | ( | int | mode, |
| const char * | index, | ||
| const char * | spec, | ||
| const char * | logdir ) |
Determine whether a package index contains a package
| mode | USE_PIP |
| mode | USE_CONDA |
| index | a file system path or url pointing to a simple index or conda channel |
| spec | a pip package specification (e.g. name==1.2.3) |
| logdir | the directory to store the output log |
| spec | a conda package specification (e.g. name=1.2.3) |

| int python_exec | ( | const char * | args | ) |
Execute Python Python interpreter is determined by PATH
| args | arguments to pass to interpreter |
| char * python_importlib_metadata_version | ( | const char * | package_name | ) |
Use importlib to resolve the version of an installed package
| package_name | of installed python package |
