This is mostly a refactor of the old behavior except now the removal
of connection files happens in `kill-emacs-hook` and also when
cleaning up dead kernel processes.
* jupyter-env.el
(jupyter-write-connection-file): Turn into a `defun`. Remove the
connection file removal code.
* jupyter-kernel-process-manager.el
(jupyter--kernel-processes): Mention new form of elements in doc.
(jupyter-delete-connection-files): New function. Add it to
`kill-emacs-hook` at top-level.
(jupyter--gc-kernel-processes):
(jupyter--start-kernel-processes): Use new form of
`jupyter--kernel-processes`.
(jupyter-local-tcp-conn-info): Relocate to...
* test/jupyter-test.el: ...here.
(jupyter-write-connection-file): Update test.
This is in preparation for merging `jupyter-command-kernel` and
`jupyter-spec-kernel` into just the `jupyter-kernel-process` class.
* jupyter-env.el
(jupyer-session-with-random-ports): New function.
* jupyter-kernelspec.el
(jupyter-expand-environment-variables)
(jupyter-process-environment)
(jupyter-kernel-argv): New functions.
* test/jupyter-test.el
(jupyer-session-with-random-ports)
(jupyter-expand-environment-variables)
(jupyter-process-environment)
(jupyter-kernel-argv): New tests.
The function writes to `jupyter-runtime-directory` and does not depend on
anything in`jupyter-kernel-process-manager.el` so it is more appropriate in
`jupyter-env.el`.
* jupyter-env.el (jupyter-write-connection-file): New function.
* jupyter-kernel-process-manager.el (jupyter-write-connection-file): Remove.
* jupyter-env.el (jupyter-runtime-directory): Remove custom status.
New function definition.
* jupyter-kernel-manager.el (jupyter-write-connection-file):
Use new function.
* ob-jupyter.el (org-babel-jupyter--run-repl):
Remove setting of `jupyter-runtime-directory`.
* test/jupyter-test.el (jupyter-runtime-directory): New test.
Fixes#137
* jupyter-base.el (jupyter-kernelspec): Un-require.
(jupyter-command, jupyter-locate-python)
(jupyter-runtime-directory): Move to new file `jupyter-env.el`
(jupyter-include-other-output, jupyter-iopub-message-hook)
(jupyter-shell-message-hook)
(jupyter-stdin-message-hook): Move to `jupyter-client.el`
(jupyter-sha256, jupyter-hmac-sha256):
(jupytern-new-uuid): Move to `jupyter-messages.el`. Add declaration of
`jupyter-new-uuid` to account for its removal.
(jupyter-create-connection-info)
(jupyter-write-connection-file): Move to `jupyter-kernel-manager.el`
(jupyter-connect-endpoint, jupyter-connect-channel): Move to `jupyter-channels.el`
* jupyter-channels.el: Accept moved functions.
* jupyter-client.el: Accept moved variables.
* jupyter-kernel-manager.el: Accept moved functions.
(jupyter-env, jupyter-kernelspec): New requires.
* jupyter-kernelspec (jupyter-env): New require.
(jupyter-command): Remove declaration.
(jupyter-read-plist-from-string): New declaration.
* jupyter-messages.el: Accept moved functions.
(hmac-def, json): New requires.
* jupyter-org-extensions.el (jupyter-kernelspec): New require.
* jupyter-repl.el (jupyter-kernelspec): New require.
* jupyter-env.el: New file.
* ob-jupyter.el (jupyter-env, jupyter-kernelspec): New requires.
* test/jupyter-test.el (jupyter-env): New require.