c0fec0de / anytree

Python tree data library
Apache License 2.0
955 stars 133 forks source link

Option to skip certain tests #102

Open Gunni opened 5 years ago

Gunni commented 5 years ago

Hey,

I'm not using dot at all, and my CI system gets this error:

======================================================================
ERROR: test_dotexport.test_tree_png
Tree to png.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/xKi9Azf8/rpms/python-anytree/rpmbuild/BUILD/anytree-2.6.0/.eggs/nose-1.3.7-py3.6.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/tmp/xKi9Azf8/rpms/python-anytree/rpmbuild/BUILD/anytree-2.6.0/tests/test_dotexport.py", line 84, in test_tree_png
    RenderTreeGraph(root).to_picture(join(GENPATH, "tree1.png"))
  File "/tmp/xKi9Azf8/rpms/python-anytree/rpmbuild/BUILD/anytree-2.6.0/anytree/exporter/dotexporter.py", line 232, in to_picture
    check_call(cmd)
  File "/usr/lib64/python3.6/subprocess.py", line 306, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib64/python3.6/subprocess.py", line 287, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dot': 'dot'

======================================================================
ERROR: test_dotexporter.test_tree_png
Tree to png.
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/xKi9Azf8/rpms/python-anytree/rpmbuild/BUILD/anytree-2.6.0/.eggs/nose-1.3.7-py3.6.egg/nose/case.py", line 198, in runTest
    self.test(*self.arg)
  File "/tmp/xKi9Azf8/rpms/python-anytree/rpmbuild/BUILD/anytree-2.6.0/tests/test_dotexporter.py", line 112, in test_tree_png
    DotExporter(root).to_picture(join(GENPATH, "tree1.png"))
  File "/tmp/xKi9Azf8/rpms/python-anytree/rpmbuild/BUILD/anytree-2.6.0/anytree/exporter/dotexporter.py", line 232, in to_picture
    check_call(cmd)
  File "/usr/lib64/python3.6/subprocess.py", line 306, in check_call
    retcode = call(*popenargs, **kwargs)
  File "/usr/lib64/python3.6/subprocess.py", line 287, in call
    with Popen(*popenargs, **kwargs) as p:
  File "/usr/lib64/python3.6/subprocess.py", line 729, in __init__
    restore_signals, start_new_session)
  File "/usr/lib64/python3.6/subprocess.py", line 1364, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'dot': 'dot'

----------------------------------------------------------------------
Ran 76 tests in 0.106s

FAILED (errors=2)
Test failed: <unittest.runner.TextTestResult run=76 errors=2 failures=0>
error: Test failed: <unittest.runner.TextTestResult run=76 errors=2 failures=0>
error: Bad exit status from /var/tmp/rpm-tmp.xpP9kw (%check)

RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.xpP9kw (%check)

I'm building it using an rpm spec file and this section is failing:

%check
%{__python3} setup.py test
c0fec0de commented 4 years ago

I would recommend, to add graphviz to the RPM dependencies. So dot will be there. As the dotexport is quite famous, it would be good to keep it included.

jtojnar commented 4 years ago

The issue is that graphviz depends on pango, which depends on glib, which depends on gtk-doc, which depends on anytree.

Would it make sense to move anytree exporters into a separate packages?

c0fec0de commented 4 years ago

Will fix it.

Jan Tojnar notifications@github.com schrieb am Sa., 14. Dez. 2019, 15:52:

The issue is that graphviz depends on cairo, which depends on glib, which depends on gtk-doc, which depends on anytree.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/c0fec0de/anytree/issues/102?email_source=notifications&email_token=AE77IH3ROZBDWZQPV7DTFP3QYTXLJA5CNFSM4JC6RZHKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEG4EK4I#issuecomment-565724529, or unsubscribe https://github.com/notifications/unsubscribe-auth/AE77IHZJEJOXV4UVHRUWGX3QYTXLJANCNFSM4JC6RZHA .

jtojnar commented 4 years ago

Would it make sense to move anytree exporters into a separate packages? That way we can still hhave this tested and break the dependency cycles.

c0fec0de commented 4 years ago

yes. May take a moment.

c0fec0de commented 4 years ago

The idea is to have a anytreelib project, which only includes the anytree core functionality as you need it. anytree will stay as is, as many users make use of the importers and exporters. anytree may then depend on anytreelib. Just not sure if this might frustrate users, as anytree tried to keep the deps to zero (except six).