{"action":"opened","issue":{"url":"https://api.github.com/repos/tqdm/tqdm/issues/176","repository_url":"https://api.github.com/repos/tqdm/tqdm","labels_url":"https://api.github.com/repos/tqdm/tqdm/issues/176/labels{/name}","comments_url":"https://api.github.com/repos/tqdm/tqdm/issues/176/comments","events_url":"https://api.github.com/repos/tqdm/tqdm/issues/176/events","html_url":"https://github.com/tqdm/tqdm/issues/176","id":158143445,"number":176,"title":"should not import optional dependencies until actually necessary","user":{"login":"yarikoptic","id":39889,"avatar_url":"https://avatars.githubusercontent.com/u/39889?v=3","gravatar_id":"","url":"https://api.github.com/users/yarikoptic","html_url":"https://github.com/yarikoptic","followers_url":"https://api.github.com/users/yarikoptic/followers","following_url":"https://api.github.com/users/yarikoptic/following{/other_user}","gists_url":"https://api.github.com/users/yarikoptic/gists{/gist_id}","starred_url":"https://api.github.com/users/yarikoptic/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yarikoptic/subscriptions","organizations_url":"https://api.github.com/users/yarikoptic/orgs","repos_url":"https://api.github.com/users/yarikoptic/repos","events_url":"https://api.github.com/users/yarikoptic/events{/privacy}","received_events_url":"https://api.github.com/users/yarikoptic/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-06-02T13:41:01Z","updated_at":"2016-06-02T13:41:01Z","closed_at":null,"body":"while troubleshooting some awkward side effect of my app failing as far as I import tqdm, I discovered that tqdm unconditionally imports ipython (and probably other functionality if present, such as pandas) even if I have no intent on using it.  It adds quite quite an overhead to the import, e.g.\r\n\r\nwith ipython installed/available\r\n```shell\r\nbuildbot@922f7d817f64:~/build-custom$ time python -c 'import tqdm'\r\n\r\nreal    0m0.194s\r\nuser    0m0.168s\r\nsys     0m0.020s\r\n```\r\n\r\nwithout:\r\n```shell\r\n(venv-ci) buildbot@922f7d817f64:~/build-custom$ time python -c 'import tqdm'\r\n\r\nreal    0m0.057s\r\nuser    0m0.040s\r\nsys     0m0.012s\r\n```\r\ni.e. having ipython available contributes now almost 300% penalty\r\nI guess ideally all those imports should happen only if related functionality is requested"}}
{"actor":{"display_login":"yarikoptic"}}