@@ -311,6 +311,7 @@ class ShieldsBlock:
311311 :param platforms: List of supported platforms.
312312 :param pre_commit: Whether to show a shield for pre-commit
313313 :param on_pypi:
314+ :param primary_conda_channel: The Conda channel the package can be downloaded from.
314315
315316 .. versionadded:: 2020.12.11
316317 """
@@ -363,6 +364,7 @@ def __init__(
363364 platforms : Optional [Iterable [str ]] = None ,
364365 pre_commit : bool = False ,
365366 on_pypi : bool = True ,
367+ primary_conda_channel : Optional [str ] = None ,
366368 ):
367369
368370 if unique_name and not unique_name .startswith ('_' ):
@@ -382,6 +384,7 @@ def __init__(
382384 self .platforms : Iterable [str ] = set (platforms or ())
383385 self .pre_commit : bool = pre_commit
384386 self .on_pypi : bool = on_pypi
387+ self .primary_conda_channel : str = primary_conda_channel or self .username
385388
386389 self .set_readme_mode ()
387390
@@ -536,8 +539,10 @@ def make(self) -> str:
536539
537540 if self .conda :
538541 sections ["Anaconda" ] = ["conda-version" , "conda-platform" ]
539- substitutions ["conda-version" ] = self .make_conda_version_shield (pypi_name , username )
540- substitutions ["conda-platform" ] = self .make_conda_platform_shield (pypi_name , username )
542+ substitutions ["conda-version" ] = self .make_conda_version_shield (pypi_name , self .primary_conda_channel )
543+ substitutions ["conda-platform" ] = self .make_conda_platform_shield (
544+ pypi_name , self .primary_conda_channel
545+ )
541546
542547 if self .docker_shields :
543548 docker_name = self .docker_name
0 commit comments