Commit graph

199 commits

Author SHA1 Message Date
dickmao
bcf1c2ac55 purge
purge

align pm:get-span no major mode error with diagnostic

purge
2019-11-08 16:05:11 -05:00
dickmao
f6116d0ede like previous revision but more 2019-11-08 12:14:57 -05:00
dickmao
6752e006cb fix basic New Notebook still getting the first kernel 2019-11-08 12:12:23 -05:00
dickmao
b3179a12d1 ein:notebooklist cannot see ein:jupyter-default-server-command on startup.
move default-kernel defcustom to ein:jupyter
2019-09-30 18:36:01 -04:00
dickmao
e4e04fdc3d Specifying default kernel
```
M-x customize-group RET ein
Select Ein:Notebooklist-Default-Kernel
```

Closes #82
2019-09-29 12:19:10 -04:00
John Miller
ce419a12a5
Appveyor iterating (WIP) (#573)
* ob-ein: Bring back old functionality.

Bring back some old features to babel edit buffers while trying to respect
recent addition of polymode support.

* Override polymode if the user really wants.

Polymode is really for notebook buffers in any case, but this will override
whatever completion backmode a user has configured for python-mode.

* Install cask using python2.

For now python2 is the easiest option for testing on Windows since cask does
not properly support python3 when in Windows.

* Let's throw in the ert-runner, see what happens.

* Can I use my fork of cask?

Work around smartrep weirdness, try to live without command line wildcard
expansion.

* Get the url for the fork right.

* Experiment with python37, use test_script.

* Unstick appveyor, I hope.

* Fix parsing error.

* test_script is not executing. Why?

* Add ert testing.

But why are the test_script commands not executing?

* tasks: Automate building and testing using invoke.

Invoke leverages Python, which I hope will allow us to abstract out differences
in platforms when it comes to building and testing ein.

* Use invoke on appveyor.

* appveyor: Use the environment python.

So we can test versions other than python 2.7.

* Parsing error.

Is
https://packaging.python.org/guides/supporting-windows-using-appveyor/#setting-up
lying to me?

* Quote commands, just in case.

* Get python onto the path.

* Appveyor is catching up to travis.

* Parsing error.

* Update pip, try to get quoted syntax right.

* Still not liking my pip call.

Last try, next step we go to a requirements.txt file.

* Go to using a requirements file for pip.

* ecukes needs bash to work.

* Cleaning up and fiddling.

Seems like the emacs-jupyter guy has his act together - maybe we can take some
inspiration for our appveyor config.

* Syntax error in environment.

* More syntax errros.

* Maybe we need quoting.

* I give up.

* Formatting and cleanup.

* Add customization, yet another syntax error.

New customizable variable `ob-ein-babel-edit-polymode-ignore' to override
keybinding for \C-c\C-c in an org source code edit buffer.

* John learned some Powershell today.

* Fix the executable path.

Sometimes there is more than one curl installed on the system, make sure we can
account for that in testing.

* Handle updating the path inside invoke.

* Report which curl we are using before starting functional tests.

* Enable RDP so we can see error logs.

* Keep the build alive even when it finishes.

* Fix #568.

Apparently we need to specify the user agent when on windows, otherwise tornado
will start throwing 403 responses. Currently using Mozilla/4.0 as the agent, but
might be a good idea to make this value customizable.

* Clean up emacs config.

* Why is appveyor dropping the xsrf token?

* xsrf cookie found, what does the header look like?

* Try different user-agent header, reenable rdp.

* JSON encoding issues on Python side, it appears. Let's try an older Python.

Login works, contents query to get notebooklist works (i.e. GET on
/contents/api), but creating a notebook (i.e. POST on /contents/api) fails with
invalid JSON. ein and emacs-request appear to be generating the proper json, but
jupyter notebook does not see the same thing that is being written. Could be
bytes vs. text issue with modern v3.x python, so let us see how this all works
with Python 2.7.

* Python27 does not have pathlib out of the box.

* Make amends with Python27

* Back to python37.

Tornado/notebook still isn't reading the POST'ed json correctly.

* Do we need to specify content type?

* Must be selective in specifying application/json content.

* Re-enable rdp.

* Let's try a different curl.

* Ensure most recent curl is on path

* Try a different path.

* Try to warn user if suspicious curl detected.

* Remove debugging statements.

* EVM depends on trusty for 26.x

See issue #125 (https://github.com/rejeep/evm/issues/125). Let's hope I got the
travis.yml syntax right.

* Minimal support for ecukes from invoke.

* Cleaner server shutdowns, better ecukes support from invoke.

Use the /api/shutdown REST API call now to shutdown running server. Also support
more command line options for ecukes from invoke.

* Almost full support of ecukes using invoke.

But! Also disabling integration testing for the time being until I understand
why ecukes fails even though everything else is working.

* Just do integration and functional testing on appveyor.

Better than nothing while I work out what is breaking the integration tests.
2019-07-28 18:20:13 -06:00
dickmao
e491ac6f1c Ob-ein Improvements
Bring the org offering to feature parity.
2019-05-20 10:59:43 -04:00
John Miller
70845a3411
Use completing-read instead of ido-completing-read. (#514)
* Use completing-read instead of ido-completing-read.

Per @seagle0128 and issue #496.

* lisp/ein-notebook.el:

* Wrap all calls to completing-read with ein:completing-read

Use `ein:completing-read' everywhere we need to do completion as it wraps Emacs
completing-read functionality and tries to use sane defaults.
2019-04-16 10:04:11 -05:00
dickmao
921b3a94e4 need to see websocket output of eldoc call 2019-04-14 14:39:46 -04:00
John Miller
5736cb3716 Fortify tests, tweak cursor motion in notebooklist buffers. 2019-04-03 17:34:37 -05:00
John Miller
57ca951933 fix for #503 2019-04-03 14:27:32 -05:00
dickmao
041a66cf28 need to reorder interactive arguments after function signature change 2019-03-15 00:14:22 -04:00
dickmao
2f19904fe7 travis buttressing 2019-02-19 15:29:18 -05:00
dickmao
ed6482096e Add ob-ein tests
Also, speed up login and other cleanups
2019-02-19 10:06:15 -05:00
dickmao
fbda27ba7f Surface curl errors
In light of #425 and #456, provide more guidance on curl errors.

Also, clean up eldoc stub.  Leveraging elpy's eldoc perfection seems
the only sensible choice, however.
2019-01-21 13:42:35 -05:00
Sam Steingold
48fa153435 Use standard functionality instead of ad hoc functions
(ein:filter identity ...) ---> (delete nil ...)
ein:filter --> seq-filter
hash-vals --> hash-table-values
hash-keys --> hash-table-keys
2019-01-15 11:26:09 -05:00
dickmao
129afa5fb4 Respect cursor_start and cursor_end in matches
The :cursor_start and :cursor_end fields tell us whether we need to
prepend the prefix ourselves.

Fixes #436
2018-12-28 21:14:11 -05:00
dickmao
e328e86105 Clarify what notebook version means
Say `Contents API 5.7.4` instead of `Notebook v5` in notebooklist.

EIN doesn't care about the python version (2.7, 3.5) or the
ipython version (5.8.0, 6.2.1).  The "jupyter notebook contents api"
version (currently at 5.7.4) is the thing that matters.
2018-12-25 10:59:18 -05:00
dickmao
3c18cda125 reverse hunks 2018-12-11 08:48:40 -05:00
dickmao
bead667ee0 Clean up multilang
Do not assume python... leverage ESS to improve R interaction.
Fix both undo and fontify in the presence of toggling cells (`C-c
C-t`)
Fix and test switching kernels
2018-12-08 21:25:48 -05:00
dickmao
f0984eab55 jupyterhub basic (PAM only)
`ein:login` or `ein:notebooklist-login` is the preferred way to access
jupyterhub, although `ein:jupyterhub-connect` is still autoloaded.
2018-12-04 18:31:44 -05:00
dickmao
fb1b527121 the whir is occluding the prompt 2018-12-02 15:23:20 -05:00
dickmao
6ca6752319 C-c C-q improved visual feedback
As `ein:notebok-kill-kernel-then-close-cmmand` must wait for the
server to delete the session, the buffer wouldn't disappear right
away, leaving the user nonplussed whether the `C-c C-q` took.  Display
a status message "Ending session" with a modest animation instead.

Also add a "Stop" test for notebooklist.  Sorry about breaking "Stop"
in ee3b0f0
2018-11-10 00:09:44 -05:00
John Miller
6f19d8bf83 Correct typos, make some code more succinct.
Let this be a lesson kids - never program while under the influence of
power antihistamines...
2018-11-09 18:53:40 -06:00
John Miller
573b745509 Reintroduce proper behavior for kernel stop from nblist buffer.
Once upon a time it was possible to stop/delete/kill running kernels from the
notebooklist buffer regardless of whether there were any open notebooks
associated with the kernel session.

Some commmits ago this behavior was changed, and the code has recently required
that there a notebook buffer associated with the active kernel/session exist
before the stop command will proceed. This is incorrect behavior and is
inconsistent with the interface provided by the notebook web browser interface.
Kernels and notebooks are independent entities and should be treated as such in
the code.
2018-11-09 18:27:23 -06:00
John Miller
e4e0fc4abc Merge branch 'pr-397' 2018-11-08 20:52:29 -06:00
dickmao
52ae7c2e31 remove f.el dependency 2018-11-08 14:41:48 -05:00
dickmao
270f157751 squash one of possibly many bugs that could cause intermittent travis failure 2018-11-08 11:36:10 -06:00
Sam Steingold
1c6270c425 update the code base to avoid compilation warnings about obsolete functions
call-next-method -> cl-call-next-method
set-slot-value -> (setf slot-value)
*-child-p -> cl-typep
oref <keyword> -> slot-value <symbol>
object-p -> eieio-object-p
Closes https://github.com/millejoh/emacs-ipython-notebook/issues/394
2018-11-08 09:36:35 -05:00
John Miller
6438d078fd Merge branch 'pr-382' 2018-11-05 19:48:30 -06:00
Sam Steingold
0469fd0e35 there may be NO local jupyter installation
(ein:crib-token--all-local-tokens): wrap execution of
  `ein:jupyter-default-server-command' in `condition-case'
2018-11-05 11:46:20 -05:00
dickmao
ee3b0f095c Follow-up to cleaning up websockets
Renaming of functions with better understanding of reconnects.  Under
the original logic, reconnecting blithely created a new session if
the original no longer existed.  Now it will alert the user when this
happens.

Also hopefully fixes #381 as there was a bug of missing argument not
being caught by lisp's undisciplined typing.
2018-11-04 21:38:20 -06:00
dickmao
d621944797 Clean up websocket callbacks
Coursera appears to kill websockets every minute or so, and I'm
observing firsthand the buggy behaviors described in #356.  This PR
cleans up the websocket code and kernel restart logic.  Removed
backwards compatibility for the v2 messaging api
as keeping it in the presence of the refactoring would make it more
broken that it already was.
2018-10-31 23:38:45 -04:00
dickmao
c9be1f1120 a quick hack to fix #239 (coursera) that ignores the url-retrieve way
of doing things
2018-10-29 02:00:57 -04:00
dickmao
80839a1d77 finish previous commit 2018-10-28 14:38:53 -04:00
dickmao
aaeffa4596 end deferred chain on bad login 2018-10-28 13:48:53 -04:00
dickmao
0490031ec8 Sane File Navigation
As emacs users we prefer and have the luxury of fuzzy file navigation
via ido and projectile.  From a notebook or notebooklist buffer, the commands

`C-c C-f` ein:file-open
`C-c C-o` ein:notebook-open

offer an ido alternative to point and click navigation.

To populate the ido lists, retrieving the content hierarchy is on by
default.  Two custom variables determine how wide and deep the content query
probes (currently at 2 levels deep and 6 directories wide).  Set both
to zero to turn off.

tkf half finished code to quickly go from local file buffers to notebook
mode via `C-c C-z` or `C-c C-o`.  This is now possible.  EIN will
start the server from a suitable parent directory of the visited file.

Enable ido completion for `notebooklist-login`.

Remove the albatross `ein-loaddefs.el` in favor of more standard
`ein-autoloads.el` that is not git tracked.

Convenience `make install` from git source (local alternative to
melpa).
2018-10-26 18:40:19 -04:00
dickmao
2aa5d004b4 fix a spoonerism 2018-10-26 12:20:07 -04:00
John Miller
ab8f881bff ein-notebooklist: Fix check for multiple servers on same port.
If `notebook list` returns more than one entry for the same url:port the
resulting structure won't be a list of lists, but rather a list of multiple
paired elements.
2018-10-23 09:02:17 -05:00
dickmao
e693a53e5a master fixes
ein:url normalization issue (fails the passworded server test).
"No servers running here" warning is unsettling for I think the
majority of users who do not run jupyter locally.
2018-10-23 02:12:45 -04:00
John Miller
6944fb0a3f ein-notebooklist: Fix format string.
Format string was missing a parameter. Also some doc string cleanup.
2018-10-22 14:52:46 -05:00
John Miller
a26ca7fa7d ein-notebooklist: Fix corner case in token autodetection.
There appears to be a (hopefully very rare) possibility of `jupyter notebook
list --json` returning multiple tokens for the same url. This will result in
some perplexing behavior in ein, so these changes try to bring clarity when such
a situation occurs.
2018-10-22 14:49:45 -05:00
dickmao
0345ed0b33 Try to address windows NT unseen. Add osx. Add ipython 7.0.1. 2018-10-20 00:12:34 -04:00
dickmao
c89a0a8887 it a'int easy being green. 2018-10-18 16:23:49 -04:00
dickmao
6e3a062e98 travis is a harsh taskmaster 2018-10-17 17:45:19 -04:00
dickmao
c5bfb0dca1 expose ein:notebooklist-open as a bonafide function (but obsolete) 2018-10-17 17:24:34 -04:00
dickmao
085a188b20 Streamline login
Merge the login and open commands (open aliased to login).  Add login
tests described in #352.

Attempt to improve user experience by synchronously executing
`ein:jupyter-server-start`.  `ein:dev-prefer-deferred` custom variable
allows easy switch to compare sychronous versus old asynchronous behavior.
2018-10-17 16:52:10 -04:00
dickmao
257331f32c Revert "Normalize url-or-port"
This reverts commit 435d001b03.
2018-10-15 14:13:51 -04:00
dickmao
cea40017fa fix bug 2018-10-15 10:29:11 -04:00
dickmao
435d001b03 Normalize url-or-port
```
"http://localhost:8888"
"http://localhost:8888/"
"http://127.0.0.1:8888"
"http://127.0.0.1:8888/"
"8888"
8888
```

Ideally these should converge to the same thing.  Since many hash
tables are keyed off `url-or-port`, forgetting to
normalize `url-or-port` with `ein:url` leads to missed cache hits and
general malaise.  So we try to do that.

Address a FIXME: apply callbacks to `ein:notebook-list-login-and-open`.

Removed py3.5 from travis build matrix to reduce developer strain.
2018-10-14 20:36:49 -05:00