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

.tox directory makes Prospector take a very long time to start up #202

Closed
daisylb opened this issue Jan 23, 2017 · 1 comment
Closed

.tox directory makes Prospector take a very long time to start up #202

daisylb opened this issue Jan 23, 2017 · 1 comment

Comments

@daisylb
Copy link

daisylb commented Jan 23, 2017

When I run prospector, it takes a very long time:

code/lorikeet → time prospector lorikeet/api_views_test.py 
Check Information
=================
         Started: 2017-01-23 11:30:59.638718
        Finished: 2017-01-23 11:30:59.881305
      Time Taken: 0.24 seconds
       Formatter: grouped
        Profiles: default, no_doc_warnings, no_test_warnings, strictness_medium, strictness_high, strictness_veryhigh, no_member_warnings
      Strictness: None
  Libraries Used: 
       Tools Run: dodgy, mccabe, pep8, profile-validator, pyflakes, pylint
  Messages Found: 0

        9.62 real         7.13 user         1.78 sys

Running pyinstrument on prospector showed that most of the time was being spent in prospector/autodetect.py:find_from_path, so I tried disabling autodetection and removing my .tox folder, and both helped.

code/lorikeet → time prospector -A --uses django lorikeet/api_views_test.py 
(snip output)
        0.85 real         0.67 user         0.06 sys
code/lorikeet → rm -rf .tox
code/lorikeet → time prospector lorikeet/api_views_test.py 
(snip output)
        0.92 real         0.76 user         0.14 sys

The weird thing is, the contents of .tox is just a bunch of virtualenvs, which should be picked up by the is_virtualenv heuristic tox uses, but aren't:

code/lorikeet → tree -L 2 .tox/
.tox/
├── dist
│   └── lorikeet-0.1.dev64+nd5efff6.zip
├── log
│   └── tox-0.log
├── py34-dj110
│   ├── bin
│   ├── include
│   ├── lib
│   ├── log
│   ├── pip-selfcheck.json
│   └── tmp
(snip 5 more virtualenvs that look identical)
@daisylb
Copy link
Author

daisylb commented Jan 23, 2017

Oops, I forgot about hidden files! Turns out Tox creates a .tox-config1 file in the root of each virtualenv, which together with the six visible files and the hidden .Python file pushes the number of items in the directory to eight, and the heuristic tests for 7 or less.

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

No branches or pull requests

1 participant