Skip to content

Latest commit

 

History

History
57 lines (43 loc) · 2.11 KB

cep-0015.md

File metadata and controls

57 lines (43 loc) · 2.11 KB

CEP 15 - Hosting repodata.json and packages separately by adding a base_url property

Title Hosting repodata.json and packages separately by adding a base_url property
Status Accepted
Author(s) Daniel Holth <[email protected]>
Created Aug 24, 2023
Updated Jan 22, 2024
Discussion #61
Implementation

Abstract

Conda packages need to be stored in the same directory as repodata.json.

This can be inconvenient especially when using alternative repodata.json for the same set of packages. For example, a user might be interested in installing packages based on an older snapshot of the index data that points to packages from the original index. Or a user might want to subset repodata.json based on policy.

Specification

A minimal repodata.json looks like this.

{"info": {"subdir": "linux-64"},
 "packages": {},
 "packages.conda": {"some-package-filename.conda":{...}},
 "removed": [],
 "repodata_version": 1}

Add base_url to the info object. Increment repodata_version.

{"info": {"subdir": "...", "base_url":"https://repo.anaconda.com/repo/main/linux-64/"},
 "packages": {},
 "packages.conda": {"some-package-filename.conda":{...}},
 "removed": [],
 "repodata_version": 2}

Prepend base_url to the package filename when composing a download URL for a package. For the example above the resulting download URL would be https://repo.anaconda.com/repo/main/linux-64/some-package.conda.

base_url can be an absolute or a relative URL.

In the absence of base_url, packages are loaded relative to the repodata.json. Index data without the new base_url will continue to have "repodata_version": 1, but index data including base_url will have "repodata_version": 2.

Copyright

All CEPs are explicitly CC0 1.0 Universal.