summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--HISTORY.rst5
-rw-r--r--MANIFEST.in2
-rw-r--r--Makefile27
-rw-r--r--README.rst14
-rw-r--r--scilab_kernel/kernel.py (renamed from scilab_kernel.py)2
-rw-r--r--setup.py71
6 files changed, 19 insertions, 102 deletions
diff --git a/HISTORY.rst b/HISTORY.rst
index 2cbe046..09cead6 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -3,6 +3,11 @@
Release History
---------------
+0.6 (2016-01-16)
+++++++++++++++++
+- Switch to 2-step installation.
+
+
0.4 (2014-10-19)
++++++++++++++++
- Update for compatibility with Scilab2py 0.5
diff --git a/MANIFEST.in b/MANIFEST.in
deleted file mode 100644
index da66723..0000000
--- a/MANIFEST.in
+++ /dev/null
@@ -1,2 +0,0 @@
-include *.rst
-graft kernelspec
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 80386ab..0000000
--- a/Makefile
+++ /dev/null
@@ -1,27 +0,0 @@
-# Note: This is meant for Scilab2Py developer use only
-.PHONY: all clean test release
-
-export KILL_SCILAB="from scilab2py import kill_scilab; kill_scilab()"
-export NAME=scilab_kernel
-export VERSION=`python -c "import $(NAME); print($(NAME).__version__)"`
-
-all: clean
- python setup.py install
-
-clean:
- rm -rf build
- rm -rf dist
- find . -name "*.pyc" -o -name "*.py,cover"| xargs rm -f
- python -c $(KILL_SCILAB)
-
-release: clean
- pip install wheel
- python setup.py register
- python setup.py sdist --formats=gztar,zip upload
- git tag v$(VERSION)
- git push origin --all
-
-test: clean
- python setup.py install
- cd ~; ipython qtconsole --kernel scilab
- make clean
diff --git a/README.rst b/README.rst
index ea5e1a8..abac0e1 100644
--- a/README.rst
+++ b/README.rst
@@ -1,6 +1,18 @@
A Jupyter kernel for Scilab
-Install as `pip install scilab_kernel`.
+To install::
+
+ pip install scilab_kernel
+ python -m scilab_kernel.install
+
+To use it, run one of:
+
+.. code:: shell
+
+ ipython notebook
+ # In the notebook interface, select Scilab from the 'New' menu
+ ipython qtconsole --kernel scilab
+ ipython console --kernel scilab
See the installation instructions for `scilab2py <http://blink1073.github.io/scilab2py/source/installation.html>`_ and `Jupyter Notebook <http://jupyter.readthedocs.org/en/latest/install.html>`_, which are dependencies.
diff --git a/scilab_kernel.py b/scilab_kernel/kernel.py
index f682d94..4f40e55 100644
--- a/scilab_kernel.py
+++ b/scilab_kernel/kernel.py
@@ -19,7 +19,7 @@ import base64
from shutil import rmtree
from xml.dom import minidom
-__version__ = '0.5.4'
+from . import __version__
version_pat = re.compile(r'version "(\d+(\.\d+)+)')
diff --git a/setup.py b/setup.py
deleted file mode 100644
index 0b46fb1..0000000
--- a/setup.py
+++ /dev/null
@@ -1,71 +0,0 @@
-from distutils.core import setup
-import os
-import json
-import sys
-
-try:
- from jupyter_client.kernelspec import install_kernel_spec
-except ImportError:
- from IPython.kernel.kernelspec import install_kernel_spec
-from IPython.utils.tempdir import TemporaryDirectory
-
-
-kernel_json = {"argv": [sys.executable, "-m", "scilab_kernel", "-f",
- "{connection_file}"],
- "display_name": "Scilab",
- "language": "scilab",
- "codemirror_mode": "Octave",
- "name": "scilab_kernel",
- }
-
-# get the library version from the file
-with open('scilab_kernel.py') as f:
- lines = f.readlines()
-for line in lines:
- if line.startswith('__version__'):
- version = line.split()[-1][1:-1]
-
-svem_flag = '--single-version-externally-managed'
-if svem_flag in sys.argv:
- # Die, setuptools, die.
- sys.argv.remove(svem_flag)
-
-
-def _is_root():
- try:
- return os.geteuid() == 0
- except AttributeError:
- return False # assume not an admin on non-Unix platforms
-
-
-if 'develop' in sys.argv or 'install' in sys.argv:
- user = '--user' in sys.argv or not _is_root()
- with TemporaryDirectory() as td:
- os.chmod(td, 0o755) # Starts off as 700, not user readable
- with open(os.path.join(td, 'kernel.json'), 'w') as f:
- json.dump(kernel_json, f, sort_keys=True)
- kernel_name = kernel_json['name']
- try:
- install_kernel_spec(td, kernel_name, user=user,
- replace=True)
- except:
- install_kernel_spec(td, kernel_name, user=not user,
- replace=True)
-
-setup(name='scilab_kernel',
- version=version,
- description='A Scilab kernel for IPython',
- long_description=open('README.rst', 'r').read(),
- author='Steven Silvester',
- author_email='steven.silvester@ieee.org',
- url='https://github.com/blink1073/scilab_kernel',
- py_modules=['scilab_kernel'],
- install_requires=['scilab2py >= 0.3', 'IPython >= 3.0'],
- classifiers=[
- 'Framework :: IPython',
- 'License :: OSI Approved :: BSD License',
- 'Programming Language :: Python :: 2',
- 'Programming Language :: Python :: 3',
- 'Topic :: System :: Shells',
- ]
- )