When we are using pytest in packaging process, we may not get the
`/usr/bin/pipdeptree` as we need. So, let's use the `PATH` env to get
the binary instead.
fix: https://github.com/tox-dev/pipdeptree/issues/348
Signed-off-by: cunshunxia <cunshunxia@tencent.com>
* feature: fnmatch based includes and excludes
This is to support wildcards.
* PR Feedback
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
---------
Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
Co-authored-by: Bernát Gábor <bgabor8@bloomberg.net>
* Quote Mermaid nodes and edges labels.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
* Implements mermaid output.
Closes#129.
* Fix linting issues.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This way you can install once (for example via pipx) and reuse it for any
existing python environment.
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
Defined a function 'render_cycles_text' to list the cyclic deps. The
dependencies are now listed in alphabetical order of the package
that's creating the cycle (2nd item in the tuple).
Added tests for this codepath.
While this method is not being used in the script, it's been added for
completeness and to ensure that the APIs of all the classes involved
are clean.
Also, the 'DistPackage.as_required_by' method has been renamed to
'DistPackage.as_parent_of' for clarity.
Tests have been added and modified.
- 'Tree' was used for class representing a direct acyclic
graph (DAG). It has now been appropriately renamed to 'PackageDAG'
- The 'ReverseTree' has been renamed to 'ReversedPackageDAG'
- The optional arg 'base' in the constructor and the instance
attribute havee been removed as they are nowhere being used
- Local variables are renamed, comments are modified and tests are
updated to reflect the above changes
Earlier, in the Tree.filter method, we were checking for conflicts in
'show_only' and 'exclude' sets before normalizing all values to lower
case as a result of which it would miss values that were in both the
sets but in different cases.
This is now fixed by checking for conflicts after normalizing all the
values in both sets to lowercase first.
So that a new 'test_pipdeptree.py' can be added for unit tests (with
mocking etc.).
Integration test suite will still be run during 'make test' but the
state of the test suite is pretty bad at present. In future, we might
replace it with a complete approach for easy maintenance.
The dependencies in test setup were old and in spite of the versions
being pinned, the test results were not consistent locally and
travis.
Note: This is an attempted fix (to be verified only after tests are
run on travis)