Skip to content
This repository has been archived by the owner on Mar 10, 2024. It is now read-only.

Track feedstocks #20

Open
CJ-Wright opened this issue Jun 20, 2018 · 2 comments
Open

Track feedstocks #20

CJ-Wright opened this issue Jun 20, 2018 · 2 comments

Comments

@CJ-Wright
Copy link
Member

We need to track the feedstock graph for the bot to work properly.

@CJ-Wright
Copy link
Member Author

CJ-Wright commented Jun 20, 2018

We need a bijective map between the feedstocks and the packages.
Some feedstocks produce multiple packages (airflow).
Some packages have multiple feedstocks (packages undergoing migration).

packages = db.packages
fs_to_pk = {}
pk_to_fs = {p: set() for p in packages if 'conda-forge' in p.channels)
for feedstock in feedstocks:
    feedstock_packages = extract_packages_from(feedstock)
    fs_to_pk[feedstock.name] = feedstock_packages
    for package in feedstock_packages:
        pk_to_fs[package].add(feedstock)

Note that if a feedstock has selectors then we need to cycle through the available archs to extract all the packages.

def extract_packages_from_feedstock(feedstock, arch=None):
    packages = set()
    if has_arch_selectors(feedstock.meta_yaml) and not arch:
        for arch in arch_selectors:
            packages.update(extract_packages_from(feedstock, arch=arch)
    elif arch:
        return get_packages_from_recipe(parse_meta_yaml(feedstock.meta_yaml, arch=arch))
    else:
        return packages.update(get_packages_from_recipe(parse_meta_yaml(feedstock.meta_yaml))

@mariusvniekerk
Copy link
Contributor

We should probably store these mappings in libcfgraph at a per package level something like
./mappings/{package}/{channe}/{arch?}/repo_metadata.json

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants