Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions cppdep/cppdep.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def path_common(paths):
"""Returns common prefix path for the argument absolute normalized paths."""
if not paths:
return ''
path = os.path.commonprefix(paths)
path = os.path.commonprefix(list(paths))
assert os.path.isabs(path)
if path[-1] == os.path.sep:
return os.path.dirname(path)
Expand Down Expand Up @@ -372,6 +372,8 @@ def __init__(self, name, group, src_paths, include_paths, alias_paths,
self.ignore_paths = set()
self.alias_paths = set()
self.include_patterns = include_patterns
if src_paths is None:
raise Exception("No src_paths for {}".format(name))
self.__init_paths(src_paths, include_paths, alias_paths, ignore_paths)
self.root = path_common(self.src_paths)
self.components = []
Expand All @@ -395,10 +397,10 @@ def _update(path_container, arg_paths, check_dir=True):
'%s is not a directory in %s (group %s).' %
(path, self.group.path, self.group.name))
if abs_path in path_container:
raise InvalidArgumentError(
'%s is duplicated in %s.%s' %
warn('%s is duplicated in %s.%s' %
(abs_path, self.group.name, self.name))
path_container.add(abs_path)
else:
path_container.add(abs_path)

_update(self.src_paths, src_paths, check_dir=False)
_update(self.ignore_paths, ignore_paths, check_dir=False)
Expand Down Expand Up @@ -809,7 +811,7 @@ def _dep_filter(nodes):
for group_name, package_group in self.internal_groups.items():
for pkg_name, package in package_group.packages.items():
if not package.components:
assert not package.src_paths
assert not package.src_paths, pkg_name
continue
printer('\n' + '#' * 80)
printer('analyzing dependencies among components in '
Expand Down
2 changes: 1 addition & 1 deletion requirements-test.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
mock
pytest
pytest=3.6
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
networkx
networkx=2.0
pydot
pydotplus
PyYAML
Expand Down
2 changes: 1 addition & 1 deletion test/test_cppdep.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
import platform
import re

import mock
from unittest import mock
import pytest

from cppdep import cppdep
Expand Down