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

View Dependencies as a Tree #26

Closed
schettino72 opened this issue Feb 24, 2015 · 12 comments
Closed

View Dependencies as a Tree #26

schettino72 opened this issue Feb 24, 2015 · 12 comments

Comments

@schettino72
Copy link
Member

This issue was first raised in this discussion

ankostis added a commit to ankostis/doit that referenced this issue Mar 23, 2015
matplotlib.

- Augment `list` with `--graph` option.
- Required networkx & matplotlib libraries.
@ankostis
Copy link
Contributor

Did you have something like this in mind?

I.e., try with project's dodo.py the following:

  doit list --graph
  doit list --graph epydoc package

doit_dependencies_graph

@schettino72
Copy link
Member Author

Cool. I am glad to see some work being done on this :)

  • I think better leave the list command as it is now. And put graph as a separate command, it will probably grow to require its own parameters.
  • I wish there was some kind of plugin system to add commands to doit. Requiring everyone to install matplotlib and networkx is not nice.
  • what I really wish was some kind interactive visualization where you could hide/show nodes, select which type of nodes to show, cluster nodes, etc... but of course that's very ambitious.
  • To start with I was thinking about just generate a text dot file and let graphviz handle the rendering. I am not familiar with networkx but it seems it works too :)

So, making it clear. This is very welcome but due to extra dependencies it cant come into doit core (it might have an "official" status but wont come in the main distribution package).
Something that generate a text file (like dot) that doesnt need extra packages would be accepted on core.

I will create another issue to discuss about a plugin system.

@schettino72
Copy link
Member Author

issue #32 deals with a plugin system

@ankostis
Copy link
Contributor

I think better leave the list command as it is now. And put graph as a separate command, it will probably grow to require its own parameters.

Myself originally had implemented it as a new graph command (i still have the code available) but came to pack it as list option because it really meddles with the workflow:

$ doit list
... 
doit list -g <a_task_from_above_list> 

And if its output is just a list of nodes, as you suggest, then it does make even more sense. I'm having git log as a guiding principle. Something like this: http://stackoverflow.com/a/9074343/548792

I wish there was some kind of plugin system to add commands to doit. Requiring everyone to install matplotlib and networkx is not nice.
...
To start with I was thinking about just generate a text dot file and let graphviz handle the rendering. I am not familiar with networkx but it seems it works too :)
...
Something that generate a text file (like dot) that doesnt need extra packages would be accepted on core.

  • I fully agree for the plugn system.
  • Matplotlib requirement is indeed too heavy and has to be factored out in a plugin.
  • What i don't understand is the no-extra" package rule. The networkx is a pure-python 2 & 3 graph-library with very fast and lightweight data-structures, yet extremely powerful, perfectly fit to the tasks (reporting drawing, researching). I do not think any body will object in installing it.
    The only minor issue i see is that it is not tested on python-version prior to 2.7, but the documents still mention 2.6 and 3.2 as suitable versions. But is this such a showstopper for reinventing the graph-wheel?

@schettino72
Copy link
Member Author

It is not just about adding another dependency. For a graph command I guess it makes sense to add the following options:

  • drawer (one of networkx, dot, jpg, svg, json, etc)
  • include file_dep, targets ?
  • cluster files
  • cluster subcommands
  • i am sure gonna have more

these are just too much to go together with list command.

Also I have strict quality requirements for doit core, like 100% tests, etc. Leaving it outside gives it more freedom to evolve.

I added a basic plugin system 8091428
Check the test for an example of usage.

I suggest you not only move this code to a different command, it also should go into a different repository. I will invite you to join the pydoit group, but of course you are free to host it under your name if you prefer.

@schettino72
Copy link
Member Author

@ankostis I sent an invitation but I am not 100% sure you have permissions to create a new repo... let me know. cheers

@ankostis
Copy link
Contributor

Thank you, i accepted it.

@ankostis
Copy link
Contributor

Ported functionality to new repo: https://github.com/pydoit/doit-graphx

@schettino72
Copy link
Member Author

Great. I am closing this. At some point you should send an email to doit email group to announce this :)

@schettino72
Copy link
Member Author

Also we need to feature it somewhere in the main doit docs...

@goretkin
Copy link

The homepage mentions

DAG Visualisation: create task's dependency-graph image using graphviz

This issue comes up in a search, so I thought it would be helpful to others if I ask here: how do I access this functionality?

@schettino72
Copy link
Member Author

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

Successfully merging a pull request may close this issue.

3 participants