{"action":"created","issue":{"url":"https://api.github.com/repos/aiidateam/aiida-core/issues/3293","repository_url":"https://api.github.com/repos/aiidateam/aiida-core","labels_url":"https://api.github.com/repos/aiidateam/aiida-core/issues/3293/labels{/name}","comments_url":"https://api.github.com/repos/aiidateam/aiida-core/issues/3293/comments","events_url":"https://api.github.com/repos/aiidateam/aiida-core/issues/3293/events","html_url":"https://github.com/aiidateam/aiida-core/issues/3293","id":487183674,"node_id":"MDU6SXNzdWU0ODcxODM2NzQ=","number":3293,"title":"verdi shell imports deprecated module","user":{"login":"ltalirz","id":1053245,"node_id":"MDQ6VXNlcjEwNTMyNDU=","avatar_url":"https://avatars0.githubusercontent.com/u/1053245?v=4","gravatar_id":"","url":"https://api.github.com/users/ltalirz","html_url":"https://github.com/ltalirz","followers_url":"https://api.github.com/users/ltalirz/followers","following_url":"https://api.github.com/users/ltalirz/following{/other_user}","gists_url":"https://api.github.com/users/ltalirz/gists{/gist_id}","starred_url":"https://api.github.com/users/ltalirz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ltalirz/subscriptions","organizations_url":"https://api.github.com/users/ltalirz/orgs","repos_url":"https://api.github.com/users/ltalirz/repos","events_url":"https://api.github.com/users/ltalirz/events{/privacy}","received_events_url":"https://api.github.com/users/ltalirz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2019-08-29T21:26:03Z","updated_at":"2019-08-29T22:02:51Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"The following happens in the tutorial VM:\r\n\r\n```\r\n$ verdi shell\r\n/home/max/codes/aiida-core/aiida/backends/profile.py:23: AiidaDeprecationWarning: this module is deprecated\r\n  warnings.warn('this module is deprecated', AiidaDeprecationWarning)  # pylint: disable=no-member\r\nPython 3.6.8 (default, Jan 14 2019, 11:02:34)\r\nType \"copyright\", \"credits\" or \"license\" for more information.\r\n\r\nIPython 5.8.0 -- An enhanced Interactive Python.\r\n?         -> Introduction and overview of IPython's features.\r\n%quickref -> Quick reference.\r\nhelp      -> Python's own help system.\r\nobject?   -> Details about 'object', use 'object??' for extra details.\r\n```\r\n\r\nI really wonder why... I've searched throughout the codebase and don't really understand what triggers the import of `aiida.backends.profile`.\r\n\r\nNote: This does not happen with other `verdi` commands that use the database, e.g. `verdi process list`...\r\n"},"comment":{"url":"https://api.github.com/repos/aiidateam/aiida-core/issues/comments/526379510","html_url":"https://github.com/aiidateam/aiida-core/issues/3293#issuecomment-526379510","issue_url":"https://api.github.com/repos/aiidateam/aiida-core/issues/3293","id":526379510,"node_id":"MDEyOklzc3VlQ29tbWVudDUyNjM3OTUxMA==","user":{"login":"ltalirz","id":1053245,"node_id":"MDQ6VXNlcjEwNTMyNDU=","avatar_url":"https://avatars0.githubusercontent.com/u/1053245?v=4","gravatar_id":"","url":"https://api.github.com/users/ltalirz","html_url":"https://github.com/ltalirz","followers_url":"https://api.github.com/users/ltalirz/followers","following_url":"https://api.github.com/users/ltalirz/following{/other_user}","gists_url":"https://api.github.com/users/ltalirz/gists{/gist_id}","starred_url":"https://api.github.com/users/ltalirz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ltalirz/subscriptions","organizations_url":"https://api.github.com/users/ltalirz/orgs","repos_url":"https://api.github.com/users/ltalirz/repos","events_url":"https://api.github.com/users/ltalirz/events{/privacy}","received_events_url":"https://api.github.com/users/ltalirz/received_events","type":"User","site_admin":false},"created_at":"2019-08-29T22:02:51Z","updated_at":"2019-08-29T22:02:51Z","author_association":"CONTRIBUTOR","body":"There are a couple of `sys.path.insert` in the AiiDA codebase, and I'm not sure these are really needed.\r\n\r\nhttps://github.com/ltalirz/aiida_core/blob/a500d2b2801efa393ce6f567dc9893a62696b8f1/aiida/cmdline/commands/cmd_run.py#L113\r\nIs this really needed? Won't the current directory in the sys.path anyhow?\r\n\r\nhttps://github.com/aiidateam/aiida-core/blob/d750d513f7adf5126d43a230c9fb378de02f0772/aiida/sphinxext/tests/workchain_source/conf.py#L32\r\nThis looks dangerous...\r\n\r\nhttps://github.com/aiidateam/aiida-core/blob/cc94a1e0127cd9cab0a4049e69a9fa31cb82941c/utils/validate_consistency.py#L190\r\nOk... this script is just called by pre-commit hooks. Still, do we need to insert at position 0?\r\n\r\nhttps://github.com/aiidateam/aiida-core/blob/cc94a1e0127cd9cab0a4049e69a9fa31cb82941c/aiida/common/files.py#L194\r\nThis function is supposedly copied from `shutil.which`, and the branch only occurs when `sys.platform == 'win32'`. Still, this looks nasty - we're calling `which` and, as a side effect, `sys.path` changes?"}}
{"actor":{"display_login":"ltalirz"}}