{"action":"created","comment":{"url":"https://api.github.com/repos/jupyter/jupyter_client/pulls/comments/118120991","pull_request_review_id":39884467,"id":118120991,"diff_hunk":"@@ -250,6 +240,8 @@ def start_kernel(self, **kw):\n             # If kernel_cmd has been set manually, don't refer to a kernel spec\n             # Environment variables from kernel spec are added to os.environ\n             env.update(self.kernel_spec.env or {})\n+        elif self.extra_env:\n+            env.update(self.extra_env)","path":"jupyter_client/manager.py","position":43,"original_position":43,"commit_id":"0befc5c2f188d628aefc858506615d275e0fd060","original_commit_id":"0befc5c2f188d628aefc858506615d275e0fd060","user":{"login":"janschulz","id":890156,"avatar_url":"https://avatars0.githubusercontent.com/u/890156?v=3","gravatar_id":"","url":"https://api.github.com/users/janschulz","html_url":"https://github.com/janschulz","followers_url":"https://api.github.com/users/janschulz/followers","following_url":"https://api.github.com/users/janschulz/following{/other_user}","gists_url":"https://api.github.com/users/janschulz/gists{/gist_id}","starred_url":"https://api.github.com/users/janschulz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/janschulz/subscriptions","organizations_url":"https://api.github.com/users/janschulz/orgs","repos_url":"https://api.github.com/users/janschulz/repos","events_url":"https://api.github.com/users/janschulz/events{/privacy}","received_events_url":"https://api.github.com/users/janschulz/received_events","type":"User","site_admin":false},"body":"Why this change?\r\n\r\nOr better, why not:\r\n\r\n```\r\nif self.extra_env:\r\n   ...\r\n```","created_at":"2017-05-23T22:24:05Z","updated_at":"2017-05-23T22:24:06Z","html_url":"https://github.com/jupyter/jupyter_client/pull/261#discussion_r118120991","pull_request_url":"https://api.github.com/repos/jupyter/jupyter_client/pulls/261","_links":{"self":{"href":"https://api.github.com/repos/jupyter/jupyter_client/pulls/comments/118120991"},"html":{"href":"https://github.com/jupyter/jupyter_client/pull/261#discussion_r118120991"},"pull_request":{"href":"https://api.github.com/repos/jupyter/jupyter_client/pulls/261"}}},"pull_request":{"url":"https://api.github.com/repos/jupyter/jupyter_client/pulls/261","id":121507213,"html_url":"https://github.com/jupyter/jupyter_client/pull/261","diff_url":"https://github.com/jupyter/jupyter_client/pull/261.diff","patch_url":"https://github.com/jupyter/jupyter_client/pull/261.patch","issue_url":"https://api.github.com/repos/jupyter/jupyter_client/issues/261","number":261,"state":"open","locked":false,"title":"Prototype new kernel discovery machinery","user":{"login":"takluyver","id":327925,"avatar_url":"https://avatars0.githubusercontent.com/u/327925?v=3","gravatar_id":"","url":"https://api.github.com/users/takluyver","html_url":"https://github.com/takluyver","followers_url":"https://api.github.com/users/takluyver/followers","following_url":"https://api.github.com/users/takluyver/following{/other_user}","gists_url":"https://api.github.com/users/takluyver/gists{/gist_id}","starred_url":"https://api.github.com/users/takluyver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takluyver/subscriptions","organizations_url":"https://api.github.com/users/takluyver/orgs","repos_url":"https://api.github.com/users/takluyver/repos","events_url":"https://api.github.com/users/takluyver/events{/privacy}","received_events_url":"https://api.github.com/users/takluyver/received_events","type":"User","site_admin":false},"body":"Following jupyter/nbformat#81, this PR introduces extensible kernel finder machinery, to pave the way for different kernel pickers.\r\n\r\nThe kernel finder machinery would work like this:\r\n\r\n* A MetaKernelFinder object holds a collection of different kernel finder objects.\r\n* Each kernel finder has a short ID, and two methods:\r\n  * `find_kernels()` yields pairs of id (str) and kernel attributes (dict). The attributes contain information about the kernel. At present this has no required fields, but we'll probably want to require things similar to the language info in `kernel_info_reply`.\r\n  * `make_manager(kernel_id)` returns an instance of `KernelManager`, or a subclass, ready to start a kernel of the specified kind.\r\n* The implementation here provides two kernel finders: one using kernel specs (the same way we already look for kernels), and one trying to import `ipykernel` in the current Python.\r\n* Other kernel finders could find kernels in conda environments, virtualenvs, docker containers, VMs, or remote hosts. These would be distributed separately and found using entry points (not yet implemented).\r\n* The MetaKernelManager namespaces kernels IDs according to the finder responsible for them, so an ID such as `spec/python3` means the `python3` kernel from the `spec` finder. Other qualified kernel IDs might look like: `conda/myenv` or `docker/ipython/ipykernel-nightly`.\r\n* Specifying a kernel at e.g. a command line will use the qualified ID, e.g. `jupyter console --kernel spec/python3`. I propose that unqualified names (e.g. `python3`) are treated as if they were prefixed with `spec/`, ensuring backwards compatibility.\r\n* Thus, specifying `pyimport/kernel` (or whatever we change that name to) will always get a kernel running on the same Python executable as the process starting it.\r\n* When we start a kernel for a notebook, a KernelPicker object (not yet implemented) will get the IDs and attributes from `find_kernels()` and use it to select the most appropriate one.\r\n\r\nImplementation notes:\r\n\r\n* This involves going back on changes we had previously made to KernelManager to make it aware of kernelspecs. In this design, the kernel discovery machinery sits a level above KernelManager, rather than a level below it. In the long run, I think that we'll be glad of reduced complexity in KernelManager, but in the shorter term, it still needs to be aware of kernelspecs for backwards compatibility.\r\n* We will likely want some finders to cache kernel info, especially if finding kernels involves launching processes or communicating with other systems. I haven't yet tried to design any mechanisms to control gathering or invalidating cache information, but I expect that we'll need these.","created_at":"2017-05-19T14:01:05Z","updated_at":"2017-05-23T22:24:06Z","closed_at":null,"merged_at":null,"merge_commit_sha":"01eb2044cbf754194b075228b7c337b4daa0aaf1","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/jupyter/jupyter_client/pulls/261/commits","review_comments_url":"https://api.github.com/repos/jupyter/jupyter_client/pulls/261/comments","review_comment_url":"https://api.github.com/repos/jupyter/jupyter_client/pulls/comments{/number}","comments_url":"https://api.github.com/repos/jupyter/jupyter_client/issues/261/comments","statuses_url":"https://api.github.com/repos/jupyter/jupyter_client/statuses/0befc5c2f188d628aefc858506615d275e0fd060","head":{"label":"takluyver:discovery","ref":"discovery","sha":"0befc5c2f188d628aefc858506615d275e0fd060","user":{"login":"takluyver","id":327925,"avatar_url":"https://avatars0.githubusercontent.com/u/327925?v=3","gravatar_id":"","url":"https://api.github.com/users/takluyver","html_url":"https://github.com/takluyver","followers_url":"https://api.github.com/users/takluyver/followers","following_url":"https://api.github.com/users/takluyver/following{/other_user}","gists_url":"https://api.github.com/users/takluyver/gists{/gist_id}","starred_url":"https://api.github.com/users/takluyver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takluyver/subscriptions","organizations_url":"https://api.github.com/users/takluyver/orgs","repos_url":"https://api.github.com/users/takluyver/repos","events_url":"https://api.github.com/users/takluyver/events{/privacy}","received_events_url":"https://api.github.com/users/takluyver/received_events","type":"User","site_admin":false},"repo":{"id":34819800,"name":"jupyter_client","full_name":"takluyver/jupyter_client","owner":{"login":"takluyver","id":327925,"avatar_url":"https://avatars0.githubusercontent.com/u/327925?v=3","gravatar_id":"","url":"https://api.github.com/users/takluyver","html_url":"https://github.com/takluyver","followers_url":"https://api.github.com/users/takluyver/followers","following_url":"https://api.github.com/users/takluyver/following{/other_user}","gists_url":"https://api.github.com/users/takluyver/gists{/gist_id}","starred_url":"https://api.github.com/users/takluyver/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/takluyver/subscriptions","organizations_url":"https://api.github.com/users/takluyver/orgs","repos_url":"https://api.github.com/users/takluyver/repos","events_url":"https://api.github.com/users/takluyver/events{/privacy}","received_events_url":"https://api.github.com/users/takluyver/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/takluyver/jupyter_client","description":"Jupyter protocol client APIs","fork":true,"url":"https://api.github.com/repos/takluyver/jupyter_client","forks_url":"https://api.github.com/repos/takluyver/jupyter_client/forks","keys_url":"https://api.github.com/repos/takluyver/jupyter_client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/takluyver/jupyter_client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/takluyver/jupyter_client/teams","hooks_url":"https://api.github.com/repos/takluyver/jupyter_client/hooks","issue_events_url":"https://api.github.com/repos/takluyver/jupyter_client/issues/events{/number}","events_url":"https://api.github.com/repos/takluyver/jupyter_client/events","assignees_url":"https://api.github.com/repos/takluyver/jupyter_client/assignees{/user}","branches_url":"https://api.github.com/repos/takluyver/jupyter_client/branches{/branch}","tags_url":"https://api.github.com/repos/takluyver/jupyter_client/tags","blobs_url":"https://api.github.com/repos/takluyver/jupyter_client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/takluyver/jupyter_client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/takluyver/jupyter_client/git/refs{/sha}","trees_url":"https://api.github.com/repos/takluyver/jupyter_client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/takluyver/jupyter_client/statuses/{sha}","languages_url":"https://api.github.com/repos/takluyver/jupyter_client/languages","stargazers_url":"https://api.github.com/repos/takluyver/jupyter_client/stargazers","contributors_url":"https://api.github.com/repos/takluyver/jupyter_client/contributors","subscribers_url":"https://api.github.com/repos/takluyver/jupyter_client/subscribers","subscription_url":"https://api.github.com/repos/takluyver/jupyter_client/subscription","commits_url":"https://api.github.com/repos/takluyver/jupyter_client/commits{/sha}","git_commits_url":"https://api.github.com/repos/takluyver/jupyter_client/git/commits{/sha}","comments_url":"https://api.github.com/repos/takluyver/jupyter_client/comments{/number}","issue_comment_url":"https://api.github.com/repos/takluyver/jupyter_client/issues/comments{/number}","contents_url":"https://api.github.com/repos/takluyver/jupyter_client/contents/{+path}","compare_url":"https://api.github.com/repos/takluyver/jupyter_client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/takluyver/jupyter_client/merges","archive_url":"https://api.github.com/repos/takluyver/jupyter_client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/takluyver/jupyter_client/downloads","issues_url":"https://api.github.com/repos/takluyver/jupyter_client/issues{/number}","pulls_url":"https://api.github.com/repos/takluyver/jupyter_client/pulls{/number}","milestones_url":"https://api.github.com/repos/takluyver/jupyter_client/milestones{/number}","notifications_url":"https://api.github.com/repos/takluyver/jupyter_client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/takluyver/jupyter_client/labels{/name}","releases_url":"https://api.github.com/repos/takluyver/jupyter_client/releases{/id}","deployments_url":"https://api.github.com/repos/takluyver/jupyter_client/deployments","created_at":"2015-04-29T21:42:07Z","updated_at":"2016-02-17T15:56:15Z","pushed_at":"2017-05-19T13:31:40Z","git_url":"git://github.com/takluyver/jupyter_client.git","ssh_url":"git@github.com:takluyver/jupyter_client.git","clone_url":"https://github.com/takluyver/jupyter_client.git","svn_url":"https://github.com/takluyver/jupyter_client","homepage":null,"size":1322,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"jupyter:master","ref":"master","sha":"84f3f0e6889915b9af384ccb821890c06c808cc0","user":{"login":"jupyter","id":7388996,"avatar_url":"https://avatars2.githubusercontent.com/u/7388996?v=3","gravatar_id":"","url":"https://api.github.com/users/jupyter","html_url":"https://github.com/jupyter","followers_url":"https://api.github.com/users/jupyter/followers","following_url":"https://api.github.com/users/jupyter/following{/other_user}","gists_url":"https://api.github.com/users/jupyter/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyter/subscriptions","organizations_url":"https://api.github.com/users/jupyter/orgs","repos_url":"https://api.github.com/users/jupyter/repos","events_url":"https://api.github.com/users/jupyter/events{/privacy}","received_events_url":"https://api.github.com/users/jupyter/received_events","type":"Organization","site_admin":false},"repo":{"id":33653575,"name":"jupyter_client","full_name":"jupyter/jupyter_client","owner":{"login":"jupyter","id":7388996,"avatar_url":"https://avatars2.githubusercontent.com/u/7388996?v=3","gravatar_id":"","url":"https://api.github.com/users/jupyter","html_url":"https://github.com/jupyter","followers_url":"https://api.github.com/users/jupyter/followers","following_url":"https://api.github.com/users/jupyter/following{/other_user}","gists_url":"https://api.github.com/users/jupyter/gists{/gist_id}","starred_url":"https://api.github.com/users/jupyter/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jupyter/subscriptions","organizations_url":"https://api.github.com/users/jupyter/orgs","repos_url":"https://api.github.com/users/jupyter/repos","events_url":"https://api.github.com/users/jupyter/events{/privacy}","received_events_url":"https://api.github.com/users/jupyter/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/jupyter/jupyter_client","description":"Jupyter protocol client APIs","fork":false,"url":"https://api.github.com/repos/jupyter/jupyter_client","forks_url":"https://api.github.com/repos/jupyter/jupyter_client/forks","keys_url":"https://api.github.com/repos/jupyter/jupyter_client/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jupyter/jupyter_client/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jupyter/jupyter_client/teams","hooks_url":"https://api.github.com/repos/jupyter/jupyter_client/hooks","issue_events_url":"https://api.github.com/repos/jupyter/jupyter_client/issues/events{/number}","events_url":"https://api.github.com/repos/jupyter/jupyter_client/events","assignees_url":"https://api.github.com/repos/jupyter/jupyter_client/assignees{/user}","branches_url":"https://api.github.com/repos/jupyter/jupyter_client/branches{/branch}","tags_url":"https://api.github.com/repos/jupyter/jupyter_client/tags","blobs_url":"https://api.github.com/repos/jupyter/jupyter_client/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jupyter/jupyter_client/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jupyter/jupyter_client/git/refs{/sha}","trees_url":"https://api.github.com/repos/jupyter/jupyter_client/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jupyter/jupyter_client/statuses/{sha}","languages_url":"https://api.github.com/repos/jupyter/jupyter_client/languages","stargazers_url":"https://api.github.com/repos/jupyter/jupyter_client/stargazers","contributors_url":"https://api.github.com/repos/jupyter/jupyter_client/contributors","subscribers_url":"https://api.github.com/repos/jupyter/jupyter_client/subscribers","subscription_url":"https://api.github.com/repos/jupyter/jupyter_client/subscription","commits_url":"https://api.github.com/repos/jupyter/jupyter_client/commits{/sha}","git_commits_url":"https://api.github.com/repos/jupyter/jupyter_client/git/commits{/sha}","comments_url":"https://api.github.com/repos/jupyter/jupyter_client/comments{/number}","issue_comment_url":"https://api.github.com/repos/jupyter/jupyter_client/issues/comments{/number}","contents_url":"https://api.github.com/repos/jupyter/jupyter_client/contents/{+path}","compare_url":"https://api.github.com/repos/jupyter/jupyter_client/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jupyter/jupyter_client/merges","archive_url":"https://api.github.com/repos/jupyter/jupyter_client/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jupyter/jupyter_client/downloads","issues_url":"https://api.github.com/repos/jupyter/jupyter_client/issues{/number}","pulls_url":"https://api.github.com/repos/jupyter/jupyter_client/pulls{/number}","milestones_url":"https://api.github.com/repos/jupyter/jupyter_client/milestones{/number}","notifications_url":"https://api.github.com/repos/jupyter/jupyter_client/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jupyter/jupyter_client/labels{/name}","releases_url":"https://api.github.com/repos/jupyter/jupyter_client/releases{/id}","deployments_url":"https://api.github.com/repos/jupyter/jupyter_client/deployments","created_at":"2015-04-09T06:57:29Z","updated_at":"2017-05-14T00:51:19Z","pushed_at":"2017-05-23T18:28:04Z","git_url":"git://github.com/jupyter/jupyter_client.git","ssh_url":"git@github.com:jupyter/jupyter_client.git","clone_url":"https://github.com/jupyter/jupyter_client.git","svn_url":"https://github.com/jupyter/jupyter_client","homepage":"https://jupyter-client.readthedocs.io","size":1315,"stargazers_count":59,"watchers_count":59,"language":"Python","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":81,"mirror_url":null,"open_issues_count":47,"forks":81,"open_issues":47,"watchers":59,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/jupyter/jupyter_client/pulls/261"},"html":{"href":"https://github.com/jupyter/jupyter_client/pull/261"},"issue":{"href":"https://api.github.com/repos/jupyter/jupyter_client/issues/261"},"comments":{"href":"https://api.github.com/repos/jupyter/jupyter_client/issues/261/comments"},"review_comments":{"href":"https://api.github.com/repos/jupyter/jupyter_client/pulls/261/comments"},"review_comment":{"href":"https://api.github.com/repos/jupyter/jupyter_client/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/jupyter/jupyter_client/pulls/261/commits"},"statuses":{"href":"https://api.github.com/repos/jupyter/jupyter_client/statuses/0befc5c2f188d628aefc858506615d275e0fd060"}}}}
{"actor":{"display_login":"janschulz"}}