Commit Graph

85 Commits

Author SHA1 Message Date
Stanislav Filin c2245d6050
Print resolved interpreter when using env detection (#379)
Signed-off-by: Stanislav Filin <stasfilin@hotmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kemal Zebari <60799661+kemzeb@users.noreply.github.com>
2024-06-17 12:44:58 -07:00
Kemal Zebari 9bda77ef1d
Use non-deprecated pytest-console-scripts API (#377)
This removes a deprecation warning message that appears when running the
automated tests.
2024-06-07 11:06:16 -07:00
Cunshun Xia 6d4d4a706d
Fix test_console failure finding pipdeptree in other environments (#351)
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>
2024-04-13 15:55:38 +00:00
pre-commit-ci[bot] 312818a357
[pre-commit.ci] pre-commit autoupdate (#317)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2024-02-12 18:07:42 -08:00
Bernát Gábor afad7b8138
Fix entrypoints (#264) 2023-07-15 08:16:38 -07:00
Bernát Gábor 2a526184e6
Split project to parts (#261) 2023-07-15 07:43:08 -07:00
Kemal Zebari 9507f19817
Avoid changing `t` in `randomized_dag_copy()` by shallow copying (#260) 2023-07-14 15:32:47 -07:00
Bernát Gábor 00020a8a5f
Add type information (#258) 2023-07-10 17:58:44 -07:00
Bernát Gábor 390feab1ee
Allow to force encoding (#255)
Co-authored-by: Douglas Parkinson <douglasbebo@gmail.com>
2023-07-07 10:29:58 -07:00
Kemal Zebari 69c08e4a97
Retain casing of required package names (#248) 2023-06-15 17:24:07 -07:00
Bernát Gábor 5bf5ed06e0
Fix relative venv inspections fails (#247) 2023-06-15 09:23:42 -07:00
Bernát Gábor b92d95ec96
Fix test_render_pdf fails on illumos (#246) 2023-06-15 09:19:40 -07:00
Bernát Gábor 35f885a052
Add ruff (#243) 2023-06-14 13:02:41 -07:00
Kemal Zebari b12a6ddf45
Implement -d/--depth argument (#240) 2023-06-07 09:40:48 -07:00
Kemal Zebari c010e73a96
Use unicode characters when rendering text (#239) 2023-06-05 18:53:32 -07:00
Bernát Gábor 0019dcbdb9
Add 3.12 support (#228) 2023-05-01 08:18:33 -07:00
Bernát Gábor 14c8abe618
Bump deps and tools (#224)
Committed via https://github.com/asottile/all-repos

Signed-off-by: Bernát Gábor <bgabor8@bloomberg.net>
2023-04-19 13:06:58 -07:00
Jens W. Klein 3d3c805777
Implement: Use fnmatch for include and exclude #213 (#215)
* 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>
2023-03-25 13:24:21 -07:00
AJ Kerrigan 4f499e5cff
Handle and test mermaid output for a reversed tree (#209)
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2023-03-18 14:03:43 -07:00
Kevin Deldycke 0812041e92
Produce unique node IDs that does not collides wit Mermaid's reserved keywords. (#201)
Refs: https://github.com/mermaid-js/mermaid/issues/4182
2023-03-04 09:32:45 -08:00
Kevin Deldycke ae8c103837
Quote Mermaid node and edge labels (#200)
* 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>
2023-03-04 00:10:09 -08:00
Kevin Deldycke a0c9c3204f
Implements Mermaid output (#195)
* 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>
2023-02-18 07:44:01 -08:00
Kevin Deldycke 96a23415b0
Make the output of the dot format deterministic and stable (#189)
Fixes https://github.com/tox-dev/pipdeptree/issues/188
2023-02-17 07:31:45 -08:00
Saaket Prakash 2c2c5098f0
Use importlib.metadata for guess_version instead of importing the module (#171)
Co-authored-by: Bernát Gábor <bgabor8@bloomberg.net>
2022-09-07 23:32:38 -07:00
Bernát Gábor ab9abfeab1
Simplify code a bit
Signed-off-by: Bernát Gábor <gaborjbernat@gmail.com>
2022-09-06 01:08:29 -07:00
Bernát Gábor 6bae9969c1
Add linter and formatter
Signed-off-by: Bernát Gábor <gaborjbernat@gmail.com>
2022-09-03 09:51:13 -07:00
Bernat Gabor 360ceb7a0f
Handle PyPy different starting dependencies
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
2020-09-21 14:00:17 +01:00
Bernat Gabor c8fbbba497
Also support --python= arg format
Signed-off-by: Bernat Gabor <bgabor8@bloomberg.net>
2020-09-21 13:46:44 +01:00
Bernat Gabor b4e3fd866a
Allow querying non-host python intepreters
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>
2020-09-21 13:46:43 +01:00
Stephen Weber 2f989b09bb Avoid crashing when some dependencies aren't installed 2020-07-01 11:02:51 -07:00
Vineet Naik a5e77913cf Fix tests on python 2.7, 3.4 and 3.5
The tests pass on python>=3.6 but the behaviour is different on older
versions.
2020-06-12 01:22:28 +05:30
Vineet Naik 01b479fd3b Rewrite 'render_text' tests using pytest.mark.parametrize 2020-06-07 20:02:30 +05:30
Vineet Naik 2f31989448 Refactor code to render cyclic deps as text and add tests
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.
2020-06-07 17:58:30 +05:30
Vineet Naik 8a0659fbfd Refactor code to render conflicts as text and add tests
Defined a function to render conflicting deps as text for ease of
testing and added tests.
2020-06-07 17:24:05 +05:30
Vineet Naik 28045c10e1 Add tests for cyclic_deps function 2020-06-07 16:32:55 +05:30
Vineet Naik 4aac03b788 Add tests for conflicting_deps function 2020-06-07 16:32:55 +05:30
Vineet Naik 59e75296c6 Add unit tests for render_text function 2020-06-07 16:32:55 +05:30
Vineet Naik 8225e8ec0b Add tests for argparse parser
These are copied from test_integration.py (to be removed once all
unit/mocked tests are copied to test_pipdeptree.py)
2020-06-05 00:18:57 +05:30
Vineet Naik 02709dbb1d Add tests for graph outputs 2020-06-04 01:19:34 +05:30
Vineet Naik 40c5ce6b4c Improve mock pkgs in tests with version and specs attrs 2020-06-04 01:17:48 +05:30
Vineet Naik 1d7555f2d8 Add unit tests with mocks for Package class and it's subclasses 2020-05-10 18:33:55 +05:30
Vineet Naik c26603865d Implement 'ReversedPackageDAG.reverse' method
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.
2020-04-14 19:15:52 +05:30
Vineet Naik 8766baa89a Refactored code to correct nomenclature and remove redundant code
- '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
2020-04-14 19:14:49 +05:30
Vineet Naik 1cb347c35b Check for conflicts in 'show_only' and 'exclude' after handling case
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.
2019-10-27 16:07:52 +05:30
Vineet Naik 906e05147b Define Tree and ReverseTree classes representing dependency tree 2019-07-17 00:33:33 +05:30
Vineet Naik 4b74f7b4fe Rename 'test_pipdeptree.py' to 'test_integration.py'
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.
2019-07-13 13:28:22 +05:30
Vineet Naik d5c3ce7bf5 Update test setup dependencies
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)
2018-07-01 19:17:16 +05:30
ciarancourtney d4bc9f487c tests: render_tree() expects exclude arg to be set, not list 2018-05-01 19:36:47 +01:00
ciarancourtney 1a15137510 restore arg-less main(), abstart args to _get_args() and monkeypatch in tests 2018-05-01 19:29:13 +01:00
ciarancourtney 1bcd65dc3a Using --packages and --exclude together is fine as long as they are distinct
* pass args into main() to make testing easier
2018-04-22 11:39:22 +01:00