If the installed version of some pkg is guessable, then use that version
to find if it's conflicting with the required version. Earlier it
considered all pkgs without an available 'dist' object as conflicting.
Fixes#55
As of 6.0.0 pip will default to excluding the usual things we were
hardcoding here, so this just lets pip do its thing naturally.
This also removes 'pipdeptree' from the exclusion list, which seems
mandatory if your application actually *uses* pipdeptree and it's not
just for manual invocation (i.e.humans typing on keyboards)
* '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.
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.
With the '--json' flag specified, pipdeptree will output the dependency
tree as json list. The resulting json output is intended to be consumed
by external tools.
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.
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.