Appearance
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 and explains the decisions you should make before automating the workflow.
Looking for a step-by-step walkthrough? Read How to create a private Conda channel with RepoForge.io on the RepoForge.io blog for a practical tutorial.
Understand RepoForge.io Channels
Every Conda channel in RepoForge.io is scoped to an organization and can be public or private. Private channels give you fine-grained control over who can install proprietary artifacts, while public channels let you share pre-built environments with the community. Use separate channels for stable releases and experimental builds so that developers can choose the level of risk they are willing to accept.
Metadata Retention
RepoForge.io preserves build metadata such as platform, Python version, and dependencies. Capture this information in your package description so that consumers know when an upgrade is safe. Cleaning up superseded builds keeps your channel searchable and shortens download times for continuous integration jobs.
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
Recommended Best Practices
- Pin Dependencies – Reference exact versions of critical libraries when building Conda packages so that consumers can reproduce your environment in automation.
- Automate Verification – Add smoke tests to confirm that your packages install cleanly on supported platforms before publishing to a production channel.
- Document Authentication – For private channels, provide installation snippets with the
conda-auth
plugin so that teammates can copy, paste, and start working immediately.
Troubleshooting Common Issues
- HTTP 401 Errors – Verify that the API token has the correct scope and has not expired. Free accounts cannot authenticate to private channels.
- Unsatisfiable Dependencies – Check that the uploaded package metadata references versions that are available in your channel or in the default Conda repositories.
- Slow Downloads – Remove unused builds, especially large platform-specific archives, to reduce the size of the channel index generated by RepoForge.io.