mirror of
https://github.com/vale981/emacs-ipython-notebook
synced 2025-03-04 16:51:38 -05:00
make test-compile and make install
test-compile attempts to egrep "bad" warnings with hardcoded strings. This is better than nothing, but misses a lot. We are close to elimiinating this hack in favor of `(setq byte-compile-error-on-warn t)` to enforce no warnings whatsoever. Until then, keep adding egrep strings to `test-compile`. Without `(package-refresh-contents)`, the `make install` won't be able to download and install dependencies for new users. Remedy this. Retire files that will never be used.
This commit is contained in:
parent
16c14fa695
commit
20de508c52
12 changed files with 20 additions and 102 deletions
22
Makefile
22
Makefile
|
@ -22,9 +22,16 @@ clean:
|
|||
cask clean-elc
|
||||
rm -rf test/test-install
|
||||
|
||||
.PHONY: dist-clean
|
||||
dist-clean: clean
|
||||
rm -rf dist
|
||||
|
||||
|
||||
.PHONY: test-compile
|
||||
test-compile: clean autoloads
|
||||
! ( cask build 2>&1 | awk '{if (/^ /) { gsub(/^ +/, " ", $$0); printf "%s", $$0 } else { printf "\n%s", $$0 }}' | egrep -a "not known|Error|free variable|error for|Use of gv-ref" )
|
||||
# TODO When we are ready to properly compile, replace the disaster here
|
||||
# with (setq byte-compile-error-on-warn t) --dickmao
|
||||
! ( cask build 2>&1 | awk '{if (/^ /) { gsub(/^ +/, " ", $$0); printf "%s", $$0 } else { printf "\n%s", $$0 }}' | egrep -a "not known|Error|free variable|error for|Use of gv-ref|multiple times|Unused|but requires" )
|
||||
cask clean-elc
|
||||
|
||||
.PHONY: quick
|
||||
|
@ -71,9 +78,14 @@ test-install:
|
|||
--eval "(package-build--package rcp (package-build--checkout rcp))" \
|
||||
--eval "(package-install-file (car (file-expand-wildcards (concat package-build-archive-dir \"ein*.tar\"))))" 2>&1 | egrep -a "Error: " )
|
||||
|
||||
.PHONY: install
|
||||
install:
|
||||
rm -rf dist/
|
||||
.PHONY: dist
|
||||
dist:
|
||||
rm -rf dist
|
||||
cask package
|
||||
emacs -Q --batch --eval "(package-initialize)" --eval "(package-install-file (car (file-expand-wildcards \"dist/ein*.tar\")))"
|
||||
|
||||
.PHONY: install
|
||||
install: dist
|
||||
emacs -Q --batch --eval "(package-initialize)" \
|
||||
--eval "(add-to-list 'package-archives '(\"melpa\" . \"http://melpa.org/packages/\"))" \
|
||||
--eval "(package-refresh-contents)" \
|
||||
--eval "(package-install-file (car (file-expand-wildcards \"dist/ein*.tar\")))"
|
||||
|
|
|
@ -169,7 +169,7 @@ This variable has effect on notebook buffers and connected buffers."
|
|||
;; This should only happen if ein-pytools is not loaded, which can
|
||||
;; happen if the user restarts the kernel. Could probably use better logic
|
||||
;; to determine if pytools have been loaded or not.
|
||||
(ein:pytools-load-safely)
|
||||
(ein:pytools-load-safely kernel)
|
||||
(ein:log 'verbose "ein:completions--prepare-oinfo: %S" (plist-get content :traceback)))))
|
||||
;; It's okay, bad things happen. Not everything in python is going to have a
|
||||
;; pdef, which might cause the call to the json parser to fail. No need to
|
||||
|
|
|
@ -83,34 +83,6 @@
|
|||
:type 'string
|
||||
:group 'ein)
|
||||
|
||||
(defun ein:process-divine-dir (pid args &optional error-buffer)
|
||||
(if (string-match "\\bnotebook-dir\\(=\\|\\s-+\\)\\(\\S-+\\)" args)
|
||||
(directory-file-name (match-string 2 args))
|
||||
(if (executable-find ein:process-lsof)
|
||||
(ein:trim-right
|
||||
(with-output-to-string
|
||||
(shell-command (format "%s -p %d -a -d cwd -Fn | grep ^n | tail -c +2"
|
||||
ein:process-lsof pid)
|
||||
standard-output error-buffer))))))
|
||||
|
||||
(defun ein:process-divine-port (pid args &optional error-buffer)
|
||||
"Returns port on which PID is listening or 0 if none. Supply ERROR-BUFFER to capture stderr"
|
||||
(if (string-match "\\bport\\(=\\|\\s-+\\)\\(\\S-+\\)" args)
|
||||
(string-to-number (match-string 2 args))
|
||||
(if (executable-find ein:process-lsof)
|
||||
(string-to-number
|
||||
(ein:trim-right
|
||||
(with-output-to-string
|
||||
(shell-command (format "%s -p %d -a -iTCP -sTCP:LISTEN -Fn | grep ^n | sed \"s/[^0-9]//g\""
|
||||
ein:process-lsof pid)
|
||||
standard-output error-buffer)))))))
|
||||
|
||||
(defun ein:process-divine-ip (pid args)
|
||||
"Returns notebook-ip of PID"
|
||||
(if (string-match "\\bip\\(=\\|\\s-+\\)\\(\\S-+\\)" args)
|
||||
(match-string 2 args)
|
||||
"localhost"))
|
||||
|
||||
(defstruct ein:$process
|
||||
"Hold process variables.
|
||||
|
||||
|
|
|
@ -31,9 +31,9 @@
|
|||
;; which was in turn inspired by the scimax starter kit by @jkitchin: https://github.com/jkitchin/scimax
|
||||
|
||||
;;; Code:
|
||||
(eval-when-compile (require 'cl))
|
||||
(require 'ob)
|
||||
(require 'ob-python)
|
||||
(require 'cl)
|
||||
(require 'ein-shared-output)
|
||||
(require 'ein-utils)
|
||||
(require 'python)
|
||||
|
@ -242,7 +242,7 @@ jupyter kernels.
|
|||
path
|
||||
kernelspec
|
||||
(apply-partially
|
||||
(lambda (session* kernelspec* notebook created)
|
||||
(lambda (session* kernelspec* _notebook _created)
|
||||
(org-babel-ein-initiate-session session* kernelspec*))
|
||||
session kernelspec)))))
|
||||
|
||||
|
|
|
@ -1,40 +0,0 @@
|
|||
"""
|
||||
Emacs Lisp Display object/Formatter for IPython.
|
||||
|
||||
Usage::
|
||||
|
||||
In [1]:
|
||||
%run path/to/emacslisp.py
|
||||
|
||||
In [2]:
|
||||
EmacsLisp('(+ 1 2 3)')
|
||||
Out [2]:
|
||||
6
|
||||
|
||||
"""
|
||||
|
||||
from IPython.core.formatters import BaseFormatter, Unicode, ObjectName
|
||||
from IPython.core.display import DisplayObject
|
||||
|
||||
|
||||
def add_display_formatter(new_formatter):
|
||||
from IPython.core.formatters import FormatterABC
|
||||
FormatterABC.register(new_formatter)
|
||||
from IPython.core.interactiveshell import InteractiveShell
|
||||
inst = InteractiveShell.instance()
|
||||
f = new_formatter(config=inst.display_formatter.config)
|
||||
inst.display_formatter.formatters[f.format_type] = f
|
||||
|
||||
|
||||
class EmacsLispFormatter(BaseFormatter):
|
||||
format_type = Unicode('application/emacs-lisp')
|
||||
print_method = ObjectName('_repr_emacs_lisp_')
|
||||
|
||||
|
||||
class EmacsLisp(DisplayObject):
|
||||
|
||||
def _repr_emacs_lisp_(self):
|
||||
return self.data
|
||||
|
||||
if __name__ == '__main__':
|
||||
add_display_formatter(EmacsLispFormatter)
|
|
@ -1,3 +0,0 @@
|
|||
ipython==0.13
|
||||
pyzmq==14.0.1
|
||||
tornado==3.1.1
|
|
@ -1,4 +0,0 @@
|
|||
ipython==2.2.0
|
||||
pyzmq
|
||||
jinja2
|
||||
tornado
|
|
@ -1,4 +0,0 @@
|
|||
ipython==2.4.1
|
||||
pyzmq
|
||||
jinja2
|
||||
tornado
|
|
@ -1,5 +0,0 @@
|
|||
ipython==3.2.1
|
||||
pyzmq
|
||||
jinja2
|
||||
tornado
|
||||
jsonschema
|
|
@ -1,5 +0,0 @@
|
|||
jupyter-notebook==4.0.0
|
||||
pyzmq
|
||||
jinja2
|
||||
tornado
|
||||
jsonschema
|
|
@ -1 +0,0 @@
|
|||
ipython==5.8.0
|
|
@ -1,4 +0,0 @@
|
|||
-e git://github.com/ipython/ipython.git#egg=ipython
|
||||
pyzmq
|
||||
tornado
|
||||
jinja2
|
Loading…
Add table
Reference in a new issue