Skip to main content

hatch-conda

CI/CD CI - Test CD - Build
Package PyPI - Version PyPI - Python Version
Meta code style - black types - Mypy imports - isort License - MIT

This provides a plugin for Hatch that allows the use of conda environments.

This project is a copied and modified version of the hatch-containers plugin by Ofek Lev.

Table of Contents

Installation

pip install hatch-conda

Configuration

The environment plugin name is conda.

  • pyproject.toml

    [tool.hatch.envs.<ENV_NAME>]
    type = "conda"
    
  • hatch.toml

    [envs.<ENV_NAME>]
    type = "conda"
    

Python

If the Python version is set to a multi-character integer like 310 then it will be interpreted as its <MAJOR>.<MINOR> form e.g. 3.10.

If not set, then the <MAJOR>.<MINOR> version of the first python found along your PATH will be used, defaulting to the Python executable Hatch is running on.

Command

The command option specifies the command that will be used to setup the environment. The possible options are conda, mamba and micromamba.

Default:

[envs.<ENV_NAME>]
command = "conda"

Conda-forge

Indicates if the conda-forge index should be used.

Default:

[envs.<ENV_NAME>]
conda-forge = true

Environment file

By default packages will be installed using pip. However, to install packages using conda, conda-forge, or any other channel, you can specify a conda environment file:

[envs.<ENV_NAME>]
environment-file = "environment.yml"

When using an environment file, the channel and python version specified in the environment file will be used. After installing the environment, any extra packages specified in the dependencies will be installed, as well as the local package.

Prefix environments

It's possible to identify environment py prefix (the path in the filesytem) rather than by name.

[envs.<ENV_NAME>]
prefix = .venv/

Will create a conda environment in the .venv/ folder. This is useful because a text editor might check for this location to use the virtual environment.

Notes

License

hatch-conda is distributed under the terms of the MIT license.

Metadata

Release files for hatch-conda 0.5.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hatch-conda 0.5.2
File Size Uploaded
hatch_conda-0.5.2.tar.gz 9.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for hatch-conda 0.5.2
File Interpreter ABI Platform
hatch_conda-0.5.2-py3-none-any.whl Python 3 none any Details

Total release size: 16.2 kB

Release files / hatch_conda-0.5.2.tar.gz

Download URL hatch_conda-0.5.2.tar.gz
Size 9.4 kB
Tags Source
SHA-256 checksum
How to use checksums
2bcd4d4ab3510adc587e9a44126069c42c101350e9768024a3343a80cd46051b
BLAKE2b-256 checksum
How to use checksums
21291e6e38e82683ad970cc9e2b071a66c4d6b464e2a9b2dcfde036f0f6bb551
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release files / hatch_conda-0.5.2-py3-none-any.whl

Download URL hatch_conda-0.5.2-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
763e3900d469fdc9af580400aca20a1b9edfa85ba1eb356035392ad87338bf72
BLAKE2b-256 checksum
How to use checksums
a092f788d908543faad645c794cc080b221f8c90139b96611ab72911918e29c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release history Release notifications | RSS feed

This release

0.5.2 This release

2 release files

0.5.1

2 release files

0.5.0

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page