Ephemeral package execution for conda -- run any conda package without installing it
Project description
conda-exec
Ephemeral package execution for conda. Run commands from conda packages without installing them permanently.
conda exec ruff check .
ce ruff check .
conda-exec creates a cached, isolated environment for the tool, runs it,
and exits. The environment is reused on later runs but is not added to
PATH permanently.
conda run, conda exec, or conda global?
| Tool | Use it when | Pros | Tradeoffs |
|---|---|---|---|
conda run |
You already have a named or prefix environment and want to run a command inside it. | Built into conda. Works with user-managed project environments. Best fit when an environment is meant to be inspected, activated, exported, or maintained. | You must create and maintain the environment yourself. It does not install the requested command for you. One environment can still become a compatibility bottleneck. |
conda exec |
You want the command or script invocation to declare the environment it needs. | Keeps base and project environments untouched. Caches isolated environments by spec. Supports extra packages, channels, PEP 723 script metadata, and script locks. |
First run solves and installs. Cached environments are an implementation detail, not environments to edit by hand. Commands are not exposed on PATH. |
conda global |
You want a CLI tool permanently available from your shell. | Installs each tool into an isolated persistent environment. Exposes commands on PATH through trampolines. Records tools in a manifest for update and sync. |
It is a tool-install lifecycle, not a per-invocation dependency declaration. Less direct for one-off commands, inline script dependencies, or locked script handoffs. |
For Anaconda Project-style command catalogs, use conda exec when each
command should carry its own dependency specs, use conda global when a
tool should feel installed everywhere, and use conda run when the
customer already owns named environments.
Installation
conda install -c conda-forge conda-exec
Install conda-pypi for scripts with PyPI dependencies, and
conda-lockfiles for script lock support.
Usage
# Run a tool (creates cached environment on first use)
conda exec ruff check .
ce ruff check . # standalone alias
# Pin a version
conda exec "ruff>=0.4,<0.5" check .
# Add extra packages
conda exec --with pytest ruff check .
conda exec --with "python=3.12" jupyter lab
# Use a specific channel
conda exec -c bioconda samtools view file.bam
# Run a script with inline dependencies (PEP 723)
conda exec script.py
# Record a repeatable script environment
conda exec --lock script.py
# Force re-creation of cached environment
conda exec --refresh ruff check .
How it works
- Computes a cache key from the tool name, specs, and channels
- Checks
~/.conda/exec/envs/for a cached environment - On cache miss: solves and installs via conda's configured solver backend
- Finds the binary in the environment's
bin/directory - Runs it directly via
subprocess.runwith PATH prepended - Forwards the tool's exit code
Documentation
Full documentation at conda-incubator.github.io/conda-exec.
Contributing
pixi install
pixi run check # lint + format + typecheck
pixi run -e test test # run tests
License
BSD-3-Clause
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file conda_exec-0.4.0.tar.gz.
File metadata
- Download URL: conda_exec-0.4.0.tar.gz
- Upload date:
- Size: 5.9 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
14b9af6c937e07403fc900eee64c85970708014efce9287765417b7e8e2cfc1c
|
|
| MD5 |
cf045fad10097ff8237bb7e850da4ebb
|
|
| BLAKE2b-256 |
9a4c464448ef0b29568dec9ee0f1cdb2e0ec6c6f12f0019b2130035aafb4075f
|
Provenance
The following attestation bundles were made for conda_exec-0.4.0.tar.gz:
Publisher:
release.yml on conda-incubator/conda-exec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
conda_exec-0.4.0.tar.gz -
Subject digest:
14b9af6c937e07403fc900eee64c85970708014efce9287765417b7e8e2cfc1c - Sigstore transparency entry: 1916321016
- Sigstore integration time:
-
Permalink:
conda-incubator/conda-exec@3346c772937ce2fcb9d1a5049ba67af5024d8db8 -
Branch / Tag:
refs/tags/0.4.0 - Owner: https://github.com/conda-incubator
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3346c772937ce2fcb9d1a5049ba67af5024d8db8 -
Trigger Event:
push
-
Statement type:
File details
Details for the file conda_exec-0.4.0-py3-none-any.whl.
File metadata
- Download URL: conda_exec-0.4.0-py3-none-any.whl
- Upload date:
- Size: 29.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d7e859ac8533f92f04bc20cd09d6e5246d6bc05bda9ec0446a835668dac673c
|
|
| MD5 |
ef4860ca15626d2c676317fb17aee1a0
|
|
| BLAKE2b-256 |
ad7d307b89a70460ef817aaa18487d519fb7fb3882726905ee2210715b3e7d14
|
Provenance
The following attestation bundles were made for conda_exec-0.4.0-py3-none-any.whl:
Publisher:
release.yml on conda-incubator/conda-exec
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
conda_exec-0.4.0-py3-none-any.whl -
Subject digest:
4d7e859ac8533f92f04bc20cd09d6e5246d6bc05bda9ec0446a835668dac673c - Sigstore transparency entry: 1916321213
- Sigstore integration time:
-
Permalink:
conda-incubator/conda-exec@3346c772937ce2fcb9d1a5049ba67af5024d8db8 -
Branch / Tag:
refs/tags/0.4.0 - Owner: https://github.com/conda-incubator
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@3346c772937ce2fcb9d1a5049ba67af5024d8db8 -
Trigger Event:
push
-
Statement type: