Conda Package Registry
To work with the Conda registry, you need to obtain a GitFlic transport token. You can find instructions on how to obtain the token on this page.
The documentation below mentions the attribute {gitflic_domain}. Replace it with the appropriate domain, depending on your version:
- For the SaaS version:
registry.gitflic.ru - For the Self-hosted version:
localhost:8080
The domain and port for the Self-hosted version may differ.
| Level | CONDA_REGISTRY_URL |
|---|---|
| Project | http://{username}:{transport_token}@{gitflic_domain}/project/{ownerAlias}/{projectAlias}/package/-/conda |
| Company | http://{username}:{transport_token}@{gitflic_domain}/company/{companyAlias}/package/-/conda |
| Instance | http://{username}:{transport_token}@{gitflic_domain}/registry/package/-/conda |
| URL Variable | Description |
|---|---|
ownerAlias |
Project owner's alias |
projectAlias |
Project alias |
companyAlias |
Company alias |
username |
User login |
transport_token |
User's transport token |
Login and transport token are only used for working with registries that have anonymous access disabled.
Configuring the Conda Registry
To use the Conda registry, you need to create/edit the configuration file ~/.condarc.
Example configuration for using the registry from the root channel of the selected level:
channels:
- {CONDA_REGISTRY_URL}/
default_channels:
- {CONDA_REGISTRY_URL}/
channel_priority: strict
After configuring the file, Conda will search for and install packages from the GitFlic registry by default, without specifying channels in every command.
Named Channels
Named channels (e.g., $CONDA_REGISTRY_URL/main) are supported, but some versions of libmamba may have errors when using them.
We recommend accessing the root channel $CONDA_REGISTRY_URL/ or running commands with the option: --solver=classic.
Publishing Packages
Packages in .conda format with names in the following format are accepted for upload to the registry: <name>-<version>-<build>.conda.
To upload a package via the transport method, use the HTTP method:
PUT $CONDA_REGISTRY_URL/{optional_channel}/{filename}
{optional_channel}— an optional channel subdirectory (e.g.,main). If the subdirectory is not specified, the package is published to the root channel.
Usage examples:
curl --user "{username}:{transport_token}" \
--upload-file dist/test-gf-0.1.1-py_0.conda \
"$CONDA_REGISTRY_URL/test-gf-0.1.1-py_0.conda"
curl --user "{username}:{transport_token}" \
--upload-file dist/test-gf-0.1.1-py_0.conda \
"$CONDA_REGISTRY_URL/main/test-gf-0.1.1-py_0.conda"
Updating the Index on Clients
The package is available immediately after upload.
If a client does not see the new version, try clearing the local index cache: conda clean --index-cache -y
Searching and Installing Packages
After configuring the ~/.condarc file, use the following commands to search for and install packages:
# Search for a package
conda search test-gf
# Install a package
conda install test-gf
# Install a package from a named channel
conda install -c main test-gf
You can specify the channel explicitly without changing the global configuration:
conda search --override-channels -c "$CONDA_REGISTRY_URL/" test-gf
conda install --override-channels -c "$CONDA_REGISTRY_URL/" test-gf
For packages in a named channel:
conda search --override-channels -c "$CONDA_REGISTRY_URL/main" test-gf
conda install --override-channels -c "$CONDA_REGISTRY_URL/main" test-gf
Package Versioning
Conda respects semantic versioning. When installing a package without specifying a version, the package with the highest version will be installed, even if it is a pre-release.
# Install the highest available version
conda install test-gf
# Install a stable version
conda install 'test-gf<1.0.0a0'
# Install a specific version
conda install 'test-gf==1.0.0a1'
Dependencies
Conda registry is fully compatible with the standard dependency mechanism. If a package and its dependencies are published in the same channel, they will be installed from there without additional configuration.
For installing dependencies, you can use metapackages. Such packages do not contain files but only declare requirements. By installing a metapackage, you automatically install all its dependencies.
Metapackage Example:
package:
name: needs-test-gf
version: 0.1.0
build:
noarch: generic
requirements:
run:
- test-gf >=0.1.0
The metapackage is published as a regular package (.conda). After publication, you can install the metapackage in the standard way:
conda install needs-test-gf
Conda will automatically select and install a suitable version of the test-gf package from the same channel (taking into account versioning and channel priorities in your configuration).
Automated translation!
This page was translated using automatic translation tools. The text may contain inaccuracies.