Skip to content

Using Conda with RepoForge.io

RepoForge.io now supports Conda, enabling you to manage and distribute Conda packages through your own private or public channels. This guide will walk you through creating and installing Conda packages on RepoForge.io.

Creating a Conda Package

To upload a Conda package to RepoForge.io, you can use any tool or language that supports HTTP POST requests. Here's an example in Python:

python
import requests

with open("mypackage-1.0.0-py311_0.tar.bz2", "rb") as f:
    files = {'file': f}
    auth = ("your-email@example.com", "$REPOFORGE_PASSWORD")
    response = requests.post(
        'https://api.repoforge.io/conda/unique-hash-id/my-channel',
        files=files,
        auth=auth
    )
    assert response.status_code == 200

Replace:

  • unique-hash-id with your organization's unique ID.
  • my-channel with the name of your desired Conda channel.
  • your-email@example.com and $REPOFORGE_PASSWORD with your RepoForge.io credentials.

Important Note for Free Users

Free accounts can only create public packages, so authentication (auth=auth) is not required. Simply omit the auth parameter when making the POST request.

Installing a Conda package

To install a package from your RepoForge.io channel, follow these steps:

Step 1: Add Your channel

Add your RepoForge.io Conda channel:

conda config --set custom_channels.my-channel https://api.repoforge.io/conda/unique-hash-id

Replace my-channel with your preferred channel name and unique-hash-id with your organization's ID.

Step 2: Install and authenticate with the conda-auth plugin

This section only applies to paid accounts where your Conda channel is private

Install the conda-auth plugin if you haven't already:

conda install --name base --channel conda-forge conda-auth

Step 3: Install the package

Finally, install the desired package from your channel:

conda install -c my-channel package-name=1.0.0