condathis 0.2.0
condathis 0.2.0 adds pipelines and runs the environment and command functions through backends. It makes the exported functions consistent (one argument order, one rule for missing environments, one set of condition classes). It no longer changes the files of other Conda tools in your home directory, except the lines of its own environments in ~/.conda/environments.txt (see Bug fixes). Some changes break code written for 0.1.4: they come first, each with what to write instead.
Breaking changes
create_env()andinstall_packages()take package specs in...and every other argument by name, as increate_env("python=3.13", env_name = "py-env").packages =still works. It is deprecated: called from the console, a script or the tests of your own package, it warns once per session and function (classcondathis_deprecated_packages_arg). Calls made inside other packages do not warn, except in tests that use testthat’s third edition, which setslifecycle_verbosity = "warning".env_file =ofcreate_env()is deprecated in the same way (classcondathis_deprecated_env_file_arg): pass the file in...with the newenv_definition(), as increate_env(env_definition("environment.yml"), env_name = "tools").Old positional calls no longer work: name every argument after the package specs, as in
install_packages("pkg", env_name = "my-env"). When the last of two or more unnamed arguments names an existing environment, the call aborts and says so (classcondathis_<function>_positional_env_name). Any other name is read as one more package spec, so the call fails unless a package has that name (install_packages()first creates a missing"condathis-env", empty). A spec that ends in.yml,.yaml,.jsonor.lockaborts with a hint to pass the file withenv_definition(). A misspelled argument such aschanels =names the closest argument. Argument names are no longer abbreviated: abbreviations that 0.1.4 matched, such aspack =,over =or, ininstall_packages(),env =, now abort with a hint that names the full argument.The default
channelsofcreate_env()andinstall_packages()is now"conda-forge"(it wasc("conda-forge", "bioconda")). For bioconda packages, name the channel in the spec ("bioconda::samtools") or passchannels = c("conda-forge", "bioconda"). Whenchannelsis not given and a spec without a channel is on none of the channels, the error says that bioconda is no longer a default channel and names the"bioconda::"spec to use. With the defaultchannels, an environment built from bioconda with 0.1.4 does not count as having a spec without a channel, such as"samtools":create_env("samtools", env_name = ...)aborts with classcondathis_create_env_exists, and the error names the channel of the installed package.channels = NULL,character(0),NAand""abort with classcondathis_invalid_channels(in 0.1.4,NULLmeant the default).The default
channel_priorityofcreate_env()andinstall_packages()is now"strict"(it was"disabled"). Passchannel_priority = "disabled"for the old solver behavior.create_env(overwrite = FALSE)never replaces an existing environment. It keeps it, with status 0, when it already has the requested packages or when nothing is requested. With an environment file, it keeps it only for a lock file whose packages it has exactly (see New features). Otherwise, it aborts with classcondathis_create_env_exists: useinstall_packages()to add packages, oroverwrite = TRUEto rebuild. In 0.1.4, it deleted and rebuilt the environment, which lost the packages added later.create_env()aborts when package specs and an environment file are both given, and whenchannels,additional_channelsorchannel_priorityis given with a lock file passed withenv_definition(), such as an@EXPLICITor conda-lock file (classcondathis_create_env_conflicting_args). In 0.1.4, it ignored them. The deprecatedenv_file =still ignores them, as in 0.1.4. It also aborts, withplatformandoverwrite = FALSE, on an existing environment built for another platform (classcondathis_create_env_platform_mismatch): passoverwrite = TRUEto rebuild it for that platform.Missing environments are no longer created on the fly: create them with
create_env()first.install_packages()into a missing environment,list_packages()of a missing"condathis-env", andrun_bin()in a missing environment (it ran a same-name program fromPATH) now abort. The error has classcondathis_<function>_env_not_found(alsocondathis_env_not_found).run()andrun_bin()give status 127 witherror = "continue". Only the default"condathis-env"is created, empty, byinstall_packages(),run(),run_bin()andrun_pipeline(), and only when it is the environment you asked for.Environment names must be valid directory names on every OS. Names that are empty,
.or.., start with-or end with.are invalid. So are names that contain a path separator,:,#, whitespace, a control character or<>"|?*, and Windows device names such asnul. They abort in every function (classcondathis_invalid_env_name).env_path()still runs commands in an existing environment with such a name (itspathis inlist_envs()). To change one, create it again under a valid name and delete the old directory.run_bin()is superseded byrun(). It stays for code written for 0.1.4, and now runs a command exactly asrun()does: it activates the environment, with theactivate.dscripts of its packages. Pass the newactivate = FALSE(see New features) to skip them, as 0.1.4 did. The command then also getsCONDA_PREFIXand the other variables of a fixed activation, which 0.1.4 left empty. A bare command name is looked up asrun()does it, on thePATHof the command, so a directory that anactivate.dscript puts first wins (see Bug fixes). A name with a directory part is no longer joined to thebindirectory of the environment: it is a path, as inrun(). On Linux and macOS, a command killed by signalnhas status128 + n, as inrun()and a shell (137forSIGKILL), instead of-n.The commands of
run(),run_bin()andrun_pipeline()no longer see the Python settings of the R session, with and withoutactivate, so the python of an environment finds only its own modules:PYTHONPATH,PYTHONHOME,PYTHONUSERBASE,PYTHONSTARTUP,UV_PYTHON,UV_SYSTEM_PYTHONandUV_PROJECT_ENVIRONMENTare removed,PYTHONNOUSERSITEis1(your~/.localpackages are not onsys.path), and an activated virtual environment, also one that reticulate uses, is undone (see?`condathis-options`). So thatrun("python", "-m", "pip", "install", ...)installs into the environment,PIP_USERandPIP_REQUIRE_VIRTUALENVarefalse(also overuserandrequire-virtualenvin a pip configuration file), andPIP_TARGET,PIP_PREFIXandPIP_ROOTare removed (atarget,prefixorrootin a pip configuration file still applies); pass--targetor--prefixto pip to install elsewhere. Your package index, credential, certificate and proxy settings still apply. To give a command aPYTHONPATH, set it in the command, as inrun("env", "PYTHONPATH=/my/modules", "python", "script.py")on Linux and macOS, or add the directory tosys.pathin the script.run()starts the command itself instead of throughmicromamba run, so arguments reach it exactly as given. On Windows,cmd.exere-parsed them (>,<,|and&became redirections, pipes and command separators, and^and%were dropped). Shell builtins such asdirandechoalso worked: run a shell explicitly for them (see?run). Whatactivate.dscripts print is no longer part of the output.verbose = "cmd"shows your command, not micromamba’s. On Linux and macOS, a failingactivate.dscript aborts with classcondathis_run_resolve_failedinstead of a status error.run()andrun_bin()reject acmdthat is not a single, non-empty string, such asc("echo", "x")(classcondathis_invalid_cmd). Pass the arguments of the command in....NAin...aborts with classcondathis_<function>_invalid_args(0.1.4 passed the string"NA").create_env(),install_packages(),remove_env(),clean_cache(),run()andrun_bin()return acondathis_resultobject, which prints as a short summary.status,stdout,stderrandtimeoutwork as before, andcmd,env_nameandpidare new (pidisNAunlessrun()orrun_bin()getsstdin = "|"). A stream that was not captured is nowNAinstead ofNULLor"": test it withis.na().as.list(res)gives a plain list.get_install_dir()andlist_envs()return a data frame (a tibble) instead of a character vector: useget_install_dir("micromamba")$pathandlist_envs()$env_name.methodis a new argument right afterenv_nameinenv_exists(),remove_env(),list_packages()andget_env_dir(), and the first argument oflist_envs()andget_install_dir(). Passverboseby name:list_envs("silent")andenv_exists("x", "silent")abort with classcondathis_invalid_method.remove_env()now defaults toverbose = "output"and reports the removal: passverbose = "silent"to keep it quiet.list_packages()now defaults toverbose = "silent"(passverbose = "output"for the messages of 0.1.4) and always returns its tibble visibly.env_exists()andget_env_dir()abort whenenv_nameis not a single, valid name, such asNULL,NA, a number or several names (classcondathis_invalid_env_name). In 0.1.4,env_exists()returnedFALSE, andget_env_dir()returned one path per name.env_exists()now defaults toenv_name = "condathis-env".install_micromamba():timeout_limitis renamedtimeout, in the same position (timeout_limitstill works, with a warning of classcondathis_deprecated_arg). An explicitmicromamba_versionnow replaces an installed binary of another version, and versions older than 2.8.1 abort with classcondathis_install_micromamba_unsupported_version.parse_output()keeps the text as the command wrote it: pass the newtrim = TRUEfor the 0.1.4 trimming of whitespace and blank lines. Lines end only at\n,\r\nor\r, and empty output givescharacter(0)instead of"", also withtrim = TRUE: test for it withlength(x) == 0L.stream = "both"aborts when neither stream was captured (it returned""), andstream = "plain"aborts onNA(it returned"NA").
New features
Backends: the environment functions and the run family take
methodand dispatch to a backend."micromamba"is built in, and gets every new environment unless you passmethodor set the optioncondathis.backend_priority."auto", the new default ofmethod, uses the backend that owns an existing environment.method = "rattler"uses the backend of the rattlerthis package, which is not on CRAN. The backends article on the package website shows how to install it. condathis loads it when it is installed, and aborts with classcondathis_backend_not_installedotherwise. This backend never downloads micromamba. A backend that does not run the link scripts of packages, such as rattler, makes the call warn with classcondathis_link_scripts_skipped.Other packages can add a backend with the experimental
register_backend()(see?register_backend) and remove it withunregister_backend().list_registered_backend_names()lists the backends, andbackend_root_dir()gives the data directory of one.New
run_pipeline()andrun_step()run a pipeline (cmd1 | cmd2) through operating system pipes, each command in its own environment if needed:run_pipeline(run_step("seq", "1", "3"), run_step("cat")). A command that ends because the next one stopped reading, asseqinseq 1 1000000 | head -n 1, does not count as a failure, also on Windows. Its status is 141 (128 plus the number ofSIGPIPE), as in a shell.parse_output()reads the result. Here,superviseandcleanup_treedefault toTRUE.New
env_path()refers to an environment created outside condathis by its directory, forrun(),run_bin(),run_pipeline()andrun_step():run("python", "--version", env_name = env_path("/opt/envs/py")). condathis never changes such an environment.New
env_definition()givescreate_env()an environment file, in...:create_env(env_definition("environment.yml"), env_name = "tools"). The backend reads the file and detects its format from the contents, or takes it fromformat, as inenv_definition("ci.lock", format = "conda-lock-v1"). The micromamba backend reads environment YAML files, lists of package specs,@EXPLICITfiles, conda-lock files (version 1, with the optioncategories) and mambajs lock files. The name of the file does not matter, except that an environment YAML file must end in.ymlor.yaml, and not in-lock.ymlor-lock.yaml. A file that the backend cannot read, such aspixi.lockwith micromamba, aborts before anything runs (classcondathis_create_env_unsupported_definition). Other backends can read other formats (see?register_backend). Withmethod = "auto", a new environment goes to the first available backend that can read the file.A lock file (
@EXPLICIT, conda-lock or mambajs) is installed as it is, without a solve, and only for a platform it lists:platform, else the native platform, else the emulated one. When it lists none of them,create_env()aborts before anything runs (classcondathis_create_env_platform_not_locked). A lock file ofnoarchpackages installs on any platform.create_env(overwrite = FALSE)keeps an existing environment that has exactly the packages of the lock: the same names, versions and build strings.validate_env(env_definition(<lock>), env_name = ...)makes the same check. Witherror = "continue", itsFALSEhas the new attributeunexpected.install_packages(env_definition("environment.yml"), env_name = ...)installs the packages of an environment file that is solved, such as an environment YAML file or a list of specs (with micromamba,micromamba install -f). A lock file aborts with classcondathis_install_packages_unsupported_definition: create the environment again withcreate_env(..., overwrite = TRUE).New
validate_env()checks that an environment exists and has the requested package specs, using the same check ascreate_env(overwrite = FALSE). It returnsTRUEinvisibly, or aborts with classcondathis_validate_env_unsatisfied(condathis_validate_env_env_not_foundfor a missing environment). Witherror = "continue", it returnsFALSEinstead.-
New arguments of
run()andrun_bin(), also inrun_pipeline():-
timeoutkills the command after that many seconds (status-9, classcondathis_timeout_error). -
inputwrites a character or raw vector to standard input withstdin = "|". -
binary = TRUEreturns stdout and stderr as raw vectors. -
superviseand, on Linux,linux_pdeathsigend the command when R ends, even by a crash.cleanup_treeends the processes that the command started when it finishes. All three default toFALSEinrun()andrun_bin(). -
activate = FALSEruns the command without any code of the backend and without theactivate.dscripts andenv_vars.dfiles of the packages. condathis then sets a fixed activation:CONDA_PREFIX,CONDA_DEFAULT_ENV,CONDA_SHLVL,MAMBA_SHLVL, the prompt modifiers, and the binary directories of the environment in front ofPATH. The default,activate = TRUE, activates the environment with the backend. -
run_bin()also gainsmethod.
-
The errors of a failed or timed-out command of
run(),run_bin()andrun_pipeline()carry the fieldsstatus,stdout,stderrandtimeout.The micromamba backend records the activation of an environment (its
activate.dscripts included) the first time a command runs in it in an R session. It reuses that activation, without running the scripts again, until the environment or the environment variables of the session change.install_micromamba()checks each download against the SHA256 checksum published with the micromamba release. It tries the next mirror when the checksum does not match (warning classcondathis_install_micromamba_checksum_mismatch). When no checksum can be read or no hash computed, it installs the binary and warns with classcondathis_install_micromamba_checksum_unavailable(also when a function that needs micromamba installs it), unlessverbose = "silent". The hash is computed withtools::sha256sum()on R 4.5.0 or later, else with the digest package or asha256sumorshasumprogram, and on Windows also withcertutil.Windows on ARM64: a native ARM64 R gets the
win-arm64micromamba.create_env()falls back towin-64packages, through x64 emulation, when a request cannot be installed forwin-arm64.create_env(),install_packages()andremove_env()lock the environment: another R session that changes it waits, and says so after two seconds (message classcondathis_env_lock_waiting).clean_cache()and package installs of other sessions wait for each other.New help pages
?`condathis-conditions`(condition classes and error fields) and?`condathis-options`(options and environment variables).
Other changes
method = "native", the 0.1.4 default, still works as a deprecated alias for"micromamba". It warns once per session (classcondathis_deprecated_method_native), and not for calls made inside other packages.-
Every error has the class
condathis_errorand every warningcondathis_warning, with classes for the function and the problem (see?`condathis-conditions`). Messages changed too: match classes and error fields, not message text. The 0.1.4 classes are kept as extra classes until 1.0:-
condathis_create_invalid_overwrite_argis nowcondathis_create_env_invalid_overwrite. -
condathis_create_missing_env_fileis nowcondathis_create_env_missing_env_file. -
condathis_error_env_removeis nowcondathis_remove_env_env_not_found. -
condathis_list_packages_missing_envis nowcondathis_list_packages_env_not_found. -
condathis_cmd_status_erroris nowcondathis_micromamba_status_error, with the fieldsstatusandstderr. -
condathis_install_error_missing_bzip2(deprecated) is nowcondathis_install_micromamba_download_failed. -
condathis_run_null_cmdis nowcondathis_run_invalid_cmd. -
condathis_run_stdin_erroris nowcondathis_run_invalid_stdinandcondathis_run_bin_invalid_stdin. -
condathis_run_status_errorofrun_bin()is nowcondathis_run_bin_status_error. -
rlib_error_dots_named, for a named value in...ofrun()andrun_bin(), is nowcondathis_run_invalid_argsandcondathis_run_bin_invalid_args. -
condathis_umamba_*is nowcondathis_micromamba_*.
-
Arguments are checked before anything runs. Invalid values of
verbose,error,method,channel_priority,platform(with a suggestion, such as"linux-aarch64"for"linux-arm64") andenv_file, and package specs such asNAor"", abort with classed errors that name your call. This happens before micromamba is installed or started.run()andrun_bin()checkstdin,stdoutandstderrbefore the command starts.Queries never install micromamba or create an environment:
list_envs(),env_exists(),get_env_dir(),get_install_dir(),list_packages()andvalidate_env()(get_env_dir()andget_install_dir()create only the data directory). Without a usable micromamba, they read the data directory.env_exists(),run(),run_bin()andrun_pipeline()start no micromamba process to check that an environment exists: they read its directory. Soenv_exists(verbose = "cmd")no longer prints a micromamba command. With the recorded activation (see New features), a call ofrun()in an existing environment takes about as long as starting the command itself: about 20 ms on Linux, whererun()of 0.1.4 took about 270 ms.When a function needs micromamba and finds no usable binary, it says that it downloads one, naming the version and the path (message class
condathis_micromamba_downloading), unlessverbose = "silent".The check that an existing environment has the requested packages (
create_env(overwrite = FALSE),validate_env()) compares the name without case, the version, the build string, the channel and the platform. It also compares theversion,build,build_numberandchannelbracket constraints. 0.1.4 compared only the name and the version. Channels compare without credentials or platform subdirectory. Specs for virtual packages, such as"__cuda=12","__unix"or"__glibc>=2.17", are not compared: they describe the host, and the solver checks them when it creates the environment. So repeatingcreate_env()with such a spec keeps the environment instead of aborting.create_env()andinstall_packages()still pass them to the backend.A spec that condathis cannot compare as micromamba reads it never counts as satisfied. Examples are a bracket constraint other than these (
[md5=...]), a regular expression as build string and some uses of*. The error names the spec (see?create_env).install_packages()warns (classcondathis_install_packages_missing_previous_channels) when the environment has packages from a channel that the call leaves out. This happens, for example, with bioconda packages installed with the 0.1.4 default channels. Add that channel tochannelsoradditional_channels.list_packages()always has the columnsname,version,build_number(integer),build_string,channelandplatform. A failed listing aborts with classcondathis_list_packages_failed.The password and the token of a URL, such as a channel URL, show as
*****, as micromamba shows them. This holds in the command line thatverbose = "cmd"and"full"print, in thecmdof results, in messages, warnings and errors, and inlist_packages(). The command still gets them, andstdoutandstderrof results keep them.with_sandbox_dir()returns the value ofcode. It also redirectsXDG_CONFIG_HOME,XDG_STATE_HOMEandR_USER_CONFIG_DIR, and stops the processes that condathis started in it..local_enviris now only the environment thatcoderuns in.condathis keeps files of its own in its data directory (
condathis-micromamba.yamland the directoriescache,home,locksandchannels) and in a.condathisdirectory in each environment that it creates.Messages use cli’s success and information bullets instead of
!, and spell “successfully” correctly.create_env()says that an existing environment “already has the requested packages” instead of “already exists”.micromamba 2.10.0-0 is installed by default (it was 2.8.1-0). Versions from 2.8.1 on still work, and condathis reads the listing format of micromamba 2.9 and later.
install_micromamba()installs micromamba on Linux on RISC-V (linux-riscv64), where micromamba has builds from version 2.9.0 on.condathis now imports filelock (>= 1.0.3) and ps (>= 1.9.3). It needs cli (>= 3.4.0), fs (>= 1.6.7), processx (>= 3.9.0), rlang (>= 1.1.0), stringr (>= 1.5.0) and withr (>= 3.0.2). On Windows and macOS with R 4.3, and on Apple silicon Macs with R 4.4, some of them install from source (see the README). It suggests digest, which checks the micromamba download on R older than 4.5.0 when it is installed.
Bug fixes
-
condathis no longer changes the files of other Conda tools in your home directory, except the lines of its own environments in
~/.conda/environments.txt(see below):-
create_env()no longer deletes~/.mamba(%APPDATA%\.mambaon Windows) when it has nopkgssubdirectory. - micromamba and the commands of its environments use only the condathis package cache, and
clean_cache()deletes only the caches of condathis. It deleted the shared~/.mamba/pkgscache and the whole~/.cache/condadirectory. It no longer installs micromamba when there is no package cache to clean. - micromamba keeps its repodata cache in the condathis data directory, not in
~/.cache/conda, andrun()leaves nomamba/procdirectory in your cache directory. - Listing and removing environments no longer rewrite
~/.conda/environments.txt:remove_env()deletes only the line of the environment it removed.create_env()adds the environment to the file only when micromamba needs your home directory, such as for saved channel credentials, or pip settings or credentials for the pip packages of an environment file (see?get_install_dir). - On Windows, packages no longer add Start Menu shortcuts. Shortcuts that 0.1.4 added stay after
remove_env().
-
condathis no longer changes the environment variables of the R session while a command runs. In 0.1.4, R code that ran meanwhile, such as a condition handler, saw the
R_HOME,TMPDIR,CONDA_*andMAMBA_*values of the child process, and forrun_bin()itsPATH.The processes that condathis starts no longer get the activation of the R session. When R runs in an activated Conda or pixi environment, or in several nested ones, the binary directories of those environments are removed from
PATH, and their variables (such asCONDA_PREFIX_1,CONDA_EXEandPIXI_PROJECT_ROOT) are removed or restored (see?`condathis-options`). A program of R’s own environment so no longer runs in place of one that the environment lacks, with and withoutactivate. On Windows, a command that is itself a program of R’s own Conda environment, such as R’s ownRscript, still gets that environment’s directories, at the end of itsPATH, to load its DLLs. The commands ofrun(),run_bin()andrun_pipeline()always run in exactly one activated environment:CONDA_SHLVLandMAMBA_SHLVLare1and the prompt modifiers are empty, with every backend and in bothactivatemodes. The activation of an environment no longer records the activation of a micromamba that a wrapper, such as a pixi global binary, started (CONDA_SHLVL=2,CONDA_PREFIX_1). A micromamba path that is a pixi global binary (in thecondathis.micromamba_pathoption,CONDATHIS_MICROMAMBA_PATHor onPATH) runs the micromamba it starts, so the activation of an environment has micromamba’scondabindirectory onPATHand its ownMAMBA_EXE. When R was started through a pixi global binary, the variables that the binary set, such as the compiler variablesCC,CFLAGSandCONDA_BUILD_SYSROOTof R’s environment, are removed too. An activated Python virtual environment, also one that reticulate set in the R session, is undone: itsbin(Scripts) directory leavesPATH, andVIRTUAL_ENVis removed. When reticulate has started Python in the R session, thelibdirectories it put in front ofLD_LIBRARY_PATH(Linux) are removed, and so are the directories of a Conda python that it put in front ofPATH, so a command no longer loads that python’s libraries or runs its programs. reticulate’s other changes stay (see?`condathis-options`).The processes that condathis starts no longer get what R’s own startup set. Every
R_*and_R_*variable is removed, also one you set, such asR_LIBS_USER, so an R of the environment never loads packages built for your R.R_HOMEis now unset, not"". R’s defaultEDITOR,PAGER,MAKE,SED,TARandLN_Sare removed, as are R’s directories in front ofLD_LIBRARY_PATH(Linux) andDYLD_FALLBACK_LIBRARY_PATH(macOS), and on Windows R’sCURL_CA_BUNDLEand the Rtools directories in front ofPATH. A value you set yourself stays (see?`condathis-options`).On Windows,
run(),run_bin()andrun_pipeline()look a bare command name up ascmd.exedoes: in the working directory, then on thePATHof the command, with the extensions ofPATHEXT. processx searched the folder of R’s own executable and thePATHof the R session instead, so a name that the environment lacked could run a program of R or of the environment R runs in. A name found nowhere now fails with status 127, as on Linux and macOS.with_sandbox_dir()restores the working directory and every environment variable, those thatcodeset included, and deletes the sandbox before it returns, also after an error (on Windows, also when it holds a junction). At top level, as in examples, 0.1.4 keptHOMEand the data directories redirected for the rest of the session. It also kept the sandbox on disk.micromamba now works when its default root prefix (
$XDG_DATA_HOME/mamba, else~/.local/share/mamba) exists but is not a Conda environment. In 0.1.4, no command worked then.condathis works when the path of its data directory has a
/t/<name>/part, which micromamba 2.9.0 and later hide as an anaconda.org token. With such a micromamba, 0.1.4 failed there with “Failed to realize”.Errors of micromamba commands show micromamba’s message and the exit status. 0.1.4 ran micromamba with
--quiet, which hid the message belowverbose = "full".A failed or interrupted
create_env()no longer deletes the environment it replaces: the environment is moved aside first and moved back. A failed create of a new environment no longer leaves an empty environment behind.On Windows, interrupting
create_env()orinstall_packages()also stops the programs that micromamba started, such as pip.On Windows, a
run()that is interrupted or runs out of time no longer leaves micromamba’s batch files (mamba_act*.bat,mamba_bat_*.bat) in%TEMP%: micromamba writes its temporary files to a directory that condathis deletes when the call returns.remove_env()andcreate_env()no longer delete directories outside the environments directory (env_name = ""deleted every environment, and".."the whole data directory). They delete only a directory that is exactly<root>/envs/<env_name>: on Windows and macOS, a name that differed in case could delete another environment.remove_env()no longer deletes the leftover directory of a name that micromamba does not list.When the
envsdirectory of the data directory is a symbolic link (on Windows, a junction), for example to a larger disk, its environments are found. 0.1.4 did not list them, andcreate_env()deleted such an environment before it created it again.The check that an existing environment has the requested packages no longer hangs on a
*after an operator ("zlib>=1.2.*"). It no longer counts"zlib=1.3.*.*","zlib~=1"or"zlib>=1.2,"as satisfied by versions that micromamba does not match. It no longer treats version numbers above 2147483647 as equal to any other.install_packages()installs packages for the platform of the environment, not for the platform of micromamba. An environment created through Rosetta 2, for example, getsosx-64packages.On Apple Silicon, the Rosetta 2 fallback of
create_env()checks the whole request, with its dependencies and its environment file, and its messages followverbose. The first install into an environment with onlynoarchpackages, such as a new"condathis-env", gets the same fallback.With micromamba, a conda-lock file whose name did not end in
-lock.ymlor-lock.yaml, or a conda-lock file without packages for the platform, gave an empty environment and reported success. condathis now reads the format from the contents of the file, and checks its platforms before anything runs. A lock file that lists packages but gives an empty environment aborts with classcondathis_create_env_failed.-
- lists an environment named
"condathis"(it was hidden, andcreate_env()orremove_env()with that name deleted it). - no longer fails on a stale entry of
~/.conda/environments.txt. - matches the data directory as a path prefix instead of a regular expression.
- lists an environment reached through a symbolic link once.
- no longer prints micromamba’s JSON with
verbose = "output".
- lists an environment named
list_packages()lists only the pip packages of the environment, not those of your user site directory orPYTHONPATH, whatever your pip settings and working directory: apipdirectory in the working directory of R no longer runs in place of the environment’s pip.create_env()andinstall_packages()install thepip:section of an environment file into the environment, whatever your Python and pip settings. pip skipped packages found inPYTHONPATHor your user site directory, installed into your user site directory withPIP_USERoruser = truein a pip configuration file, and failed withPIP_REQUIRE_VIRTUALENV; uv installed into the virtual environment ofVIRTUAL_ENVor the python ofUV_PYTHON. Your package index, credential, certificate and proxy settings still apply (see?`condathis-options`).create_env()andinstall_packages()install thepip:section of an environment file in a directory you cannot write to, such as one installed with a package. micromamba writes a temporary file next to the environment file, so pip failed. condathis now passes a copy of the file, unless the section names paths relative to the file (-r requirements.txt,-e .,./pkg): then it aborts with classcondathis_micromamba_env_file_dir_not_writable.run()andrun_bin()write numbers in...in full:run("head", "-n", 100000)passes"100000", not"1e+05".On Windows,
run(),run_bin()andrun_pipeline()find the programs of an environment inLibrary/bin,Scriptsand the other directories that activation adds toPATH, with the extensions ofPATHEXT. 0.1.4’srun_bin()looked only inbin. On Linux and macOS,run_bin()no longer resolves the symbolic links of a program, which changedargv[0]of multicall programs such as busybox.-
- no longer creates
"condathis-env". - replaces an installed binary only with a download that runs, reports its version and matches the checksum, also with
force = TRUE. A bad download, such as an HTML error page or a truncated archive, no longer breaks a working installation or reports success. The next mirror is tried instead. - extracts the archive with R’s internal
tar, so every mirror works without a systemtarandbzip2. - applies
timeoutalso with the curl package. - takes
Infas no limit (it made every download fail without curl). - lowers a limit above 2147483 seconds (about 24.8 days) to that value.
- no longer tries the micro.mamba.pm mirror, which serves only the latest release.
- on Windows, no longer reports a new binary that antivirus software still holds as missing.
- no longer creates
micromamba discovery skips a broken candidate, such as a stale
CONDATHIS_MICROMAMBA_PATH, a directory or a truncated binary, instead of failing.A local channel in a directory whose path has a space works with
create_env()andinstall_packages()(micromamba failed with “Failed to parse URL”).run()andrun_bin()no longer return an object namedpx_resfrom your workspace when the command cannot start undererror = "continue".parse_output()no longer returns a variable namedraw_textfrom your workspace. Withstream = "both", it no longer joins the last line of stdout with the first line of stderr.condathis works on R 4.3:
%||%is now imported from rlang.
condathis 0.1.4
CRAN release: 2026-06-19
Release Date: 2026-06-19
Development Changelog: 0.1.4
Added
New
channel_priorityargument increate_env()andinstall_packages()to control channel priority strategy.-
Condathis now supports system installed
micromambabinaries. For that we added 1 new option and 1 environment variable to control that behavior.condathis.micromamba_pathand"CONDATHIS_MICROMAMBA_PATH"respectively. The order of discovery is as follows:- User override via
getOption("condathis.micromamba_path"). - User override via
CONDATHIS_MICROMAMBA_PATHenvironment variable. - condathis internal managed path (
micromamba_bin_path()). - R-in-conda: micromamba adjacent to R’s own installation prefix.
- Active conda environment (
CONDA_PREFIX). - condathis managed micromamba-env fallback.
- System PATH (
Sys.which("micromamba")).
- User override via
Changed
Internal
micromambaversion bump to “2.8.1-0”.clean_cache()now also removes any additional cache files created in the path reported bytools::R_user_dir(package = "condathis", which = "cache").Order of
channelsargument changed to have"conda-forge"as the first option as for usingchannel_priority = "strict"the order of the channels matters. Note that relying solely on channel order for priority is not recommended. Use explicit syntax like:bioconda::samtools==X.Y.Zfor better guarantee of reproducibility.create_env()now properly parses MatchSpec version constraints strings to define if environment needs to be recreated using new internal functionsparse_match_spec()andversion_spec_contains()to parse Conda MatchSpec and use VersionSpec to compare versions, following CEP29 and CEP33, respectively.
Fixed
- Fix error in
create_env()when packages were specified with"channel::package"environment was always recreated.
condathis 0.1.3
CRAN release: 2025-11-08
Release Date: 2025-11-07
Development Changelog: 0.1.3
Added
New
clean_cache()function to clean the local package cache.New
verbose = "spinner"strategy to show only spinner animation in interactive sessions. Spinner is always silenced in non-interactive sessions.
Changed
Internal
micromambaversion bump to “2.3.3-0”.Argument
verbose = TRUEis now converted toverbose = "output"by default in all exported functions.Argument
verboseincreate_env(),run(),run_bin(), andinstall_micromamba()are set toverbose = "output"by default. All internal calls to other functions are kept as"silent", unless when calling the user-facing function withverbose = "full".Argument
verbose = "silent"now also silences the spinner animation in interactive sessions.
condathis 0.1.2
CRAN release: 2025-06-02
Release Date: 2025-06-02
Development Changelog: 0.1.2
Added
New
stdinargument torun()andrun_bin()functions, allowing input to be redirected via standard input (stdin) via a text file for commands that require it.Argument
verboseincluded ininstall_micromamba()and other auxiliary functions, allowing message suppression in all package functions.
Changed
Internal
micromambaversion bump to “2.1.1-0”.with_sandbox_dir()now also defines temporary cache directory paths, usingR_USER_CACHE_DIRandXDG_CACHE_HOMEenvironment variables.
condathis 0.1.1
CRAN release: 2025-01-23
Release Date: 2025-01-24
Development Changelog: 0.1.1
Fixed
Fix error in
run_bin()whenerror = "continue"andcmdis not on PATH nor in the environment. The expected behavior is to not fail (#23).Fix error in
create_env()that would fail if debris from failed installation attempts were left in the environment path.
condathis 0.1.0
CRAN release: 2024-12-11
Release Date: 2024-12-10
Development Changelog: 0.1.0
Fixed
-
run()always creates empty base environment if it does not exists yet.
condathis 0.0.8
Breaking changes
env_exists()now errors if no argument is supplied.The base directory path used for creating the environments is now controlled by
tools::R_user_dir()and acceptsR_USER_DATA_DIR, andXDG_DATA_HOME, respectively as environment variables that can control that path. On Unix/Linux it should be"${HOME}/.local/share/R/condathis".The default
TMPDIRfor allrun()andrun_bin()calls is cleaned after execution.All error messages are resurfaced in the exported function call instead of being thrown in the internal
processxcall.New classes were added to the error condition in most functions.
New features
- New
with_sandbox_dir()allow for isolated tests and examples.
Minor improvements and fixes
Improved error message in
list_packages()when environment doesn’t exist (#21).Improved message in
install_packages().Spinner is only active when session is interactive.
condathis 0.0.7
New features
install_micromamba()now tries to download an uncompressed version of the ‘micromamba’ binary ifuntar()fails because of missingbzip2system library. (#10 and #14)New
parse_output()parses lines output streams fromrun()results into character vectors.New
run_bin()runs binary installed in a Conda environment without wrapping inmicromamba run.
Minor improvements and fixes
Internal
micromambaversion bump to “2.0.4-0”.create_env()andremove_env()have improved output.
condathis 0.0.6
Breaking changes
-
method = "auto"no longer exists. For backward compatibility will fall back tomethod = "native".- All container back-end methods were removed and
method = "native"is the onlymethodsupported using just this package. - A method for supplying additional backends from other packages is planned to be implemented.
- All container back-end methods were removed and
Minor improvements and fixes
Remove dependency on
dockerthis.Fix error in
run()whenverboseargument was not supplied.
condathis 0.0.5
Breaking changes
-
verbose, levelsTRUEandFALSEare now soft deprecated. For previous functionality"full"and"silent"should be used respectively.
New features
-
run()now haserrorargument.
Minor improvements and fixes
-
run()output now has class"condathis_run_output"with custom print method. -
run()now exposesstderr. -
verbosenow accepts any ofc("silent", "full", "cmd", "output").TRUEandFALSEare deprecated but still kept for compatibility. - Improved error handling in
run()when invalid arguments are provided.
condathis 0.0.4
Breaking changes
create_env()new argument defaultoverwrite = FALSE, since the previous behavior would allow for the environment to always be overwritten. For previous behavior useoverwrite = TRUE.Across the entire package
verbose = FALSEis default.
New features
New
get_env_dir()retrieves path to environment (v0.0.3.9032).create_env()now hasoverwrite = FALSEargument (v0.0.3.9030).install_micromamba()now hasmicromamba_versionargument (v0.0.3.9025).Add support for internal
micromambaversions above v2.0 (v0.0.3.9024).New
remove_env()created (v0.0.3.9012 #7).
Minor improvements and fixes
native_cmd()now uses additional Environmental Variables for removing warnings when calling nestedmicromamba run(v0.0.3.9029 #13).Standardize argument order passed to
micromamba, since v2.0, order of some arguments starts to conflict (v0.0.3.9027).On Windows, the “BAT” file used by
micromamba runis renamed (v0.0.3.9026 #11).Internal
micromambaversion is upgraded to “2.0.2-0”, fixes warnings about missing prefixes (v0.0.3.9028).The internal
micromambaversion is now fixed (currently “v2.0.1-0”) (v0.0.3.9025).Use GitHub releases as the primary URL for installing
micromamba(v0.0.3.9025).Move
--no-rcand--no-envarguments tonative_cmd()(v0.0.3.9024).Fix path handling in Windows (v0.0.3.9023).
Add
mode = "wb"to internaldownload.file()for handling binary downloads in Windows (v0.0.3.9023).list_envs()andlist_packages()use--no-rcinternally (v0.0.3.9022).create_env_*(),packages_search_*(), andinstall_packages()now uses--no-rcand--override-channels(v0.0.3.9020).Remove “defaults” channel (
-c defaults) from all functions (v0.0.3.9020).create_env_*(),packages_search_*(), andinstall_packages()uses--no-channel-priorityinternally (v0.0.3.9019).