-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
84 lines (66 loc) · 2.32 KB
/
setup.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
import codecs
import os.path
from setuptools import setup
from setuptools.command.develop import develop
from setuptools.command.install import install
name = 'cwlkernel'
def install_kernel_specs():
import sys
from jupyter_client.kernelspec import KernelSpecManager
kernel_requirements_directory = os.path.join(
os.path.dirname(os.path.realpath(__file__)),
'kernelmeta'
)
print('Installing IPython kernel spec')
KernelSpecManager().install_kernel_spec(
kernel_requirements_directory,
name,
user=False,
prefix=sys.prefix
)
class PostDevelopCommand(develop):
"""Post-installation for development mode."""
def run(self):
super().run()
install_kernel_specs()
class PostInstallCommand(install):
"""Post-installation for installation mode."""
def run(self):
super().do_egg_install()
install_kernel_specs()
def read(rel_path):
here = os.path.abspath(os.path.dirname(__file__))
with codecs.open(os.path.join(here, rel_path), 'r') as fp:
return fp.read()
def get_version(rel_path):
for line in read(rel_path).splitlines():
if line.startswith('version'):
delim = '"' if '"' in line else "'"
return line.split(delim)[1]
else:
raise RuntimeError("Unable to find version string.")
with open(os.sep.join([os.path.abspath(os.path.dirname(__file__)), "README.md"]), "r") as fh:
long_description = fh.read()
setup(
name=name,
version=get_version(f"{name}/CWLKernel.py"),
packages=['cwlkernel', 'cwlkernel.cwlrepository', 'cwlkernel.git'],
url='https://github.com/giannisdoukas/CWLJNIKernel',
author='Yannis Doukas',
author_email='giannisdoukas2311@gmail.com',
description='CWL Jupyter Notebook Kernel',
long_description=long_description,
long_description_content_type="text/markdown",
python_requires='>=3.6',
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: Apache Software License",
"Operating System :: MacOS",
"Operating System :: POSIX",
"Development Status :: 2 - Pre-Alpha",
"Framework :: IPython",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
],
)