Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

no documentation #8

Open
ssbarnea opened this issue Jul 10, 2019 · 5 comments
Open

no documentation #8

ssbarnea opened this issue Jul 10, 2019 · 5 comments

Comments

@ssbarnea
Copy link

I was not able to find any documentation in README file about how to install and run the tool, only its description. Adding some steps may be a good idea.

@mgedmin
Copy link
Owner

mgedmin commented Jul 10, 2019

This is a great idea!

@arLevi
Copy link

arLevi commented Jul 15, 2019

how the hell to run the tool ? that's what I'm asking myself as well ...

@arLevi
Copy link

arLevi commented Jul 15, 2019

I'm not sure, but instead of pip install it - I just copied this link into a file: https://github.com/mgedmin/findimports/blob/master/findimports.py - and run

./findimports.py src/main.py

But the list is only for the imports in main, I don't see how I can request it to be recursive ... ?

@mgedmin
Copy link
Owner

mgedmin commented Jul 18, 2019

Did pip install fail for you? It worked for me:

$ virtualenv /tmp/wtf
$ /tmp/wtf/bin/pip install findimports
$ /tmp/wtf/bin/findimports --help
Usage: findimports [options] [filename|dirname ...]

FindImports is a script that processes Python module dependencies.  Currently
it can be used for finding unused imports and graphing module dependencies
(with graphviz).

Options:
  -h, --help            show this help message and exit
  -i, --imports         print dependency graph (default action)
  -d, --dot             print dependency graph in dot (graphviz) format
  -n, --names           print dependency graph with all imported names
  -u, --unused          print unused imports
  -a, --all             don't ignore unused imports when there's a comment on
                        the same line (only affects -u)
  --duplicate           warn about duplicate imports
  -v, --verbose         print more information (currently only affects
                        --duplicate)
  -N, --noext           omit external dependencies
  -p, --packages        convert the module graph to a package graph
  -l PACKAGELEVEL, --level=PACKAGELEVEL
                        collapse subpackages to the topmost Nth levels
  -c, --collapse        collapse dependency cycles
  -T, --tests           collapse packages named 'tests' and 'ftests' with
                        parent packages
  -w FILE, --write-cache=FILE
                        write a pickle cache of parsed imports; provide the
                        cache filename as the only non-option argument to load
                        it back

But something somewhere is clearly wrong, since neither pipx run findimports nor pipx install findimports works right.

@mgedmin
Copy link
Owner

mgedmin commented Jul 18, 2019

The pipx problem I had was probably pypa/pipx#56.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants