git-graph icon indicating copy to clipboard operation
git-graph copied to clipboard

Issue for plotting a graph as a python module

Open neodark opened this issue 5 years ago • 4 comments

Hi,

Could you please help? I am unable to plot a graph as a Python module.

I am constantly getting this issue with dg.DotGraph() function: File "git_graph/git_functions.py", line 9, in execute_git_command if not (path / '.git').is_dir(): TypeError: unsupported operand type(s) for /: 'str' and 'str'

To reproduce the issue. You can create a quick git repository and then use your package as a python module as mentioned in the documentation

Thanks for your help!

neodark avatar Aug 28 '20 00:08 neodark

Hi. Sorry the documentation to run git-graph as a python module is outdated. The parameter of dg.DotGraph() should definitely be a pathlib.Path and not a string. You can check existing calls to dg.DotGraph() in cli.py and test_dot_graph.py. You will see that both pass a pathlib.Path as parameter.

hoduche avatar Sep 07 '20 23:09 hoduche

Hi, No problem. Thanks for your answer. I made a pull request to fix this issue.

neodark avatar Sep 08 '20 08:09 neodark

Hi, Sorry just re-read your post. This makes sense. Ok so the documentation only requires a fix. Thanks!

neodark avatar Sep 10 '20 15:09 neodark

Exactly. I'll try to do that as soon as I get a little time. Thank you for your contribution.

hoduche avatar Sep 12 '20 22:09 hoduche