Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

buildall() does not work for simplest graph #3

Open
noblige opened this issue Sep 27, 2020 · 1 comment
Open

buildall() does not work for simplest graph #3

noblige opened this issue Sep 27, 2020 · 1 comment

Comments

@noblige
Copy link

noblige commented Sep 27, 2020

i, dep = queue.pop(0)
should this have roots added to the list? E.g.:

            ...
            i, dep = queue.pop(0)
            marks[dep] = i
            ...

Otherwise I'm not seeing any code that would produce items that don't have any parents?
Simple code:

from depgraph import Dataset, buildall
parent = Dataset('parent-does-not-exists', tool=None)
child = Dataset('child-does-not-exists', tool=None)
child.dependson(parent)
for stage in buildall(child):
    for dep, reason in stage:
        print("Building {0} with {1} because {2}".format(dep.name, dep.tool, reason))

Output only builds child, not the parent:

Building child-does-not-exists with None because the dataset doesn't exist
noblige added a commit to noblige/depgraph that referenced this issue Sep 27, 2020
@njwilson23
Copy link
Owner

njwilson23 commented Sep 27, 2020

Perhaps! I think every case where I've used this, the inputs (e.g. a dataset, source code, a config file) have already existed. Being able to generate a parent from nothing is an interesting idea, and I agree the current behaviour isn't right.

And thanks for the patch! I'll take a closer look and get back to you in a bit.

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

No branches or pull requests

2 participants