Skip to content

index#

S3Credentials dataclass #

Credentials for accessing an S3 backend.

index_fs async #

index_fs(
    channel_directory,
    target_platform=None,
    repodata_patch=None,
    write_zst=True,
    write_shards=True,
    force=False,
    max_parallel=None,
)

Indexes dependencies in the channel_directory for one or more subdirectories within said directory. Will generate repodata.json files in each subdirectory containing metadata about each present package, or if target_platform is specified will only consider the subdirectory corresponding to this platform. Will always index the "noarch" subdirectory, and thus this subdirectory should always be present, because conda channels at a minimum must include this subdirectory.

Parameters:

Name Type Description Default
channel_directory PathLike[str]

A os.PathLike[str] that is the directory containing subdirectories of dependencies to index.

required
target_platform Optional[Platform]

A Platform to index dependencies for.

None
repodata_patch Optional[str]

The name of the conda package (expected to be in the noarch subdir) that should be used for repodata patching.

None
write_zst bool

Whether to write repodata.json.zst.

True
write_shards bool

Whether to write sharded repodata.

True
force bool

Whether to forcefully re-index all subdirs.

False
max_parallel int | None

The maximum number of packages to process in-memory simultaneously.

None

index_s3 async #

index_s3(
    channel_url,
    credentials=None,
    target_platform=None,
    repodata_patch=None,
    write_zst=True,
    write_shards=True,
    force=False,
    max_parallel=None,
    precondition_checks=True,
)

Indexes dependencies in the channel_url for one or more subdirectories in the S3 directory. Will generate repodata.json files in each subdirectory containing metadata about each present package, or if target_platform is specified will only consider the subdirectory corresponding to this platform. Will always index the "noarch" subdirectory, and thus this subdirectory should always be present, because conda channels at a minimum must include this subdirectory.

Parameters:

Name Type Description Default
channel_url str

An S3 URL (e.g., s3://my-bucket/my-channel that containins the subdirectories of dependencies to index.

required
credentials Optional[S3Credentials]

The credentials to use for accessing the S3 bucket. If not provided, will use the default credentials from the environment.

None
target_platform Optional[Platform]

A Platform to index dependencies for.

None
repodata_patch Optional[str]

The name of the conda package (expected to be in the noarch subdir) that should be used for repodata patching.

None
write_zst bool

Whether to write repodata.json.zst.

True
write_shards bool

Whether to write sharded repodata.

True
force bool

Whether to forcefully re-index all subdirs.

False
max_parallel int | None

The maximum number of packages to process in-memory simultaneously.

None
precondition_checks bool

Whether to perform precondition checks before indexing on S3 buckets which helps to prevent data corruption when indexing with multiple processes at the same time. Defaults to True.

True