Commit Graph

38 Commits

Author SHA1 Message Date
Vineet Naik b37c7961a9 Revert "Merge pull request #65 from kdeldycke/filter-dep-tree-before-rendering"
This reverts commit f4fd8b1c25, reversing
changes made to cad03ba86a.
2017-03-19 17:06:46 +05:30
Vineet Naik d3a8efa05b Merge branch 'python_3_graphviz' of https://github.com/jmbowman/pipdeptree into jmbowman-python_3_graphviz
* 'python_3_graphviz' of https://github.com/jmbowman/pipdeptree:
  Install graphviz Python package on Travis
  Fix binary GraphViz output on Python 3
2017-03-05 19:34:06 +05:30
Kevin Deldycke 9c1de2e0b6
Do not replace local tree variable. 2017-02-05 01:11:34 +01:00
Kevin Deldycke 6551d1f2e0
Unittest filter_tree() usage. 2017-02-05 01:08:51 +01:00
Kevin Deldycke b4f0a7be07
Align unittests to new function signatures. 2017-02-05 01:00:05 +01:00
Jeremy Bowman f79143fd04 Fix binary GraphViz output on Python 3 2017-01-25 11:36:18 -05:00
Vineet Naik 67d37e03fa Use 'Any' if specific version is required
Earlier the output said 'None' if a dependency didn't mention a specific
version to install. 'Any' is definitely a better term for this case.

Fixes #57
2017-01-07 12:40:19 +05:30
Vineet Naik a44baabaa5 Try guessing versions of pkgs not listed by pip
* 'pip.get_installed_distributions' doesn't include some packages such
  as 'pip', 'setuptools' etc. so the installed versions for these is not
  available. This change tries to guess the installed version by
  importing the module and checking if the version is defined in
  '__version__' variable.

* Another related change is that the 'required' and 'installed' versions
  will be shown for all intermediate packages. When 'required' is not
  specified, it will show 'None' and when 'installed' is not available,
  it will show '?'. This is to keep the output consistent with the confusing deps
  output.

* Fix indentation in output.

Kind of fixes #46.
2016-08-06 19:14:16 +05:30
Vineet Naik 4ccd84f4de Fix incorrect output in reverse mode
Fixes issues #45 and #49
2016-08-06 17:33:49 +05:30
Vineet Naik ea17d2e558 Simplify code to show confusing deps 2016-08-06 16:08:38 +05:30
Vineet Naik 07bc2c143c Fix failing build
This is done by:

* Forcing tox to install pip version >=8.0.2 inside the virtualenv
* Commenting out a failing assertion. The reason for this failure is
  that the pkgs loaded from the pickled file lose a bit of information
  w.r.t editable packages. This will be fixed properly in soon.
2016-02-14 19:03:41 +05:30
Tom Terrace 41b3fbf9ee replace confusing deps warning with conflicting deps 2015-12-26 09:02:06 -05:00
Tom Terrace 0364d7c2da Add a warning for dependencies that are missing/unsatisfied 2015-12-04 16:17:22 -05:00
Vineet Naik 49965622af Make code compatible with 2.6 and 3.x
- Replaced '.iteritems()' with '.items()'
- Replaced '{k: v for k,v in ..}' with 'dict((k, v) for k,v ..)'
2015-11-09 00:51:37 +05:30
Vineet Naik fdbe63116f Add --reverse flag for showing dep tree in reverse 2015-11-09 00:32:40 +05:30
Vineet Naik 8db536eab3 Majorly refactor the code
The primary reason behind refactoring the code is to be able to make it
straightforward to implement the --reverse mode (ie. instead of showing
package and their sub-deps, it will show the sub-deps and the packages
that need them).

As a part of this change, wrapper classes have been added for
Distribution and Requirements instances that pip returns. These wrapper
classes have handle the rendering of the pkg as a root (top level) and a
branch (non-top level) accordingly. As a result the same function
`render_tree` can be used for --reverse mode.

This change doesn't include the --reverse mode implementation. It will
be added in the subsequent commit.
2015-11-09 00:32:39 +05:30
Vineet Naik d13ff8bdef Modify test workflow
This commit decouples the test virtualenv creation from tox and simplify
it for running both locally and on travis-ci. Creation of the test
virtualenvs now happen via Makefile target 'test-env' which will create
2 virtualenvs in the dir tests/virtualenvs and also dump their
respective package data in .pickle files that will be used by the tests.

Also, builds on travis now no longer depend on tox but reuses some of
the Makefile targets for test virtualenv creation/cleanup.
2015-07-30 00:07:15 +05:30
Vineet Naik db33a5d788 Don't show bullets if freeze option is enabled
This makes the output of pipdeptree (with freeze flag) pip friendly
ie. the output can be saved in a requirements.txt file. At the same time
it's human readable due to indentations for sub-dependencies.

There is however one gotcha! In case pip finds a dependency multiple
times in the requirements.txt file, it fails. So the user will need to
take care about this when dumping the output in requirements.txt.

Fixes #31.
2015-07-26 23:12:10 +05:30
Vineet b429baf01b Use relative paths in pickled virtualenv files
Absolute path causes tests to fail on travis-ci.
2015-03-29 13:30:46 +05:30
Vineet 2eacd1e11b Update venv pickle files fixing tox tests
The pickle files for test virtualenv data were created using an older
version of pip. As tox started using the newer version of pip, these
files were obsolete and it lead to failure of tests run via tox. This is
now fixed by regenerating the pickle files for pip ver. 6.0.8
2015-03-29 13:10:20 +05:30
Vineet 617c46e889 Add tests for function 'peek_into' 2014-10-07 23:28:25 +05:30
Vineet 717e07d492 Move cyclic_deps.pickle inside tests/virtualenvs
for consistency
2014-06-22 21:31:35 +05:30
Marc Abramowitz fd0c477192 Restore Python 2.6 compatibility
c70525bb84 broke Python 2.6 compatibility
by using a dict comprehension, which is a Python 2.7 feature. I replaced
it with calling dict with a generator expression, which looks almost as
good and it works in Python 2.6.
2014-06-17 23:06:46 -07:00
Vineet c70525bb84 Fix failing tests
The tests were failing due to pull requests #14 and #16, which passed tests
individually but lead to failure after both were merged.
2014-06-18 10:28:15 +05:30
Marc Abramowitz e5c03eb91d Fix infinite recursion for cyclic deps
Fixes #13 (https://github.com/naiquevin/pipdeptree/issues/13)
2014-06-17 16:57:08 -07:00
Marc Abramowitz b6eea3084a Add test_render_tree_cyclic_dependency
Test for issue in #13 (https://github.com/naiquevin/pipdeptree/issues/13)
2014-06-16 10:05:30 -07:00
Marc Abramowitz b94fabc8dc Workaround for pip issue 1867
https://github.com/pypa/pip/issues/1867

When hash randomization is enabled, pip can return different names for
git editables from run to run.

This change accounts for that in the tests for freezed output.
2014-06-16 07:50:16 -07:00
Vineet 6d094a049c Resolve merge conflicts 2014-06-14 23:44:16 +05:30
Vineet 0f0d3d21ff Resolve merge conflicts in tox.ini 2014-06-14 23:07:23 +05:30
Marc Abramowitz aea387bcb3 Add script for creating test virtualenv
so that tests are not reliant on /home/vineet/.virtualenvs/equimapper
2014-06-14 09:05:25 -07:00
Marc Abramowitz 092a3e7e06 Support Python 2.6 2014-06-13 11:28:45 -07:00
Marc Abramowitz 32c30cb800 Switch from nose to pytest
Nicer output when asserts fail

Also more actively maintained and more flexible (e.g.: fixtures,
conftest.py)
2014-06-12 15:55:52 -07:00
Vineet 29650c3975 Warn about possibly confusing deps + refactor
* Added code to show warnings about possibly confusing dependencies
* A command line option '-w' or '--nowarn' added to allow for inhibition
  of the warnings
* A lot of code had to be refactored to do this cleanly
2014-05-11 12:12:48 +05:30
Vineet 435dfa6ada Add --freeze flag for writing to requirement files
When this flag is active, the source of repos installed via VCS and
whether or not they are editable will also be printed
2014-05-11 00:20:15 +05:30
Vineet 352a5ec333 Fix tests 2014-02-05 23:40:44 +05:30
Vineet 36e8baab36 Fix loading of the pickled fixture under py3 2014-02-05 22:44:42 +05:30
Vineet d6c56673e3 Change extension of pickle file to .pickle 2014-02-02 23:18:06 +05:30
Vineet 45ae660dea Add tests 2014-02-02 23:14:29 +05:30