This repository has been archived by the owner on Jun 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathsetup.py
60 lines (55 loc) · 1.67 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
import setuptools
from distutils.command.build import build
from distutils.command.sdist import sdist
from distutils.command.bdist import bdist
from setuptools.command.develop import develop
import subprocess
import os
HERE = os.path.abspath(os.path.dirname(__file__))
def build_static_first(cls):
"""
Return a command that builds static assets before calling command Cls
"""
class Command(cls):
def run(self):
commands = [
["npm", "install"],
["npm", "run", "build"]
]
for command in commands:
subprocess.check_call(command, cwd=HERE)
super().run()
return Command
setuptools.setup(
name="simplest-notebook",
version='0.0.9',
url="https://github.com/yuvipanda/simplest-notebook",
author="Yuvi Panda",
author_email="[email protected]",
license="BSD 3-Clause",
packages=setuptools.find_packages(),
install_requires=['notebook'],
python_requires='>=3.5',
classifiers=[
'Framework :: Jupyter',
],
data_files=[
('etc/jupyter/jupyter_notebook_config.d', ['simplest_notebook/etc/jupyter_notebook_config.d/simplest-notebook-serverextension.json']),
],
package_data={
'': ['build/*', 'index.html']
},
zip_safe=False,
cmdclass={
# This doesn't actually when installing sdist
"sdist": build_static_first(sdist),
"bdist": build_static_first(bdist),
"build": build_static_first(build),
"develop": build_static_first(develop),
},
entry_points={
'console_scripts': [
'jupyter-simplest-notebook = simplest_notebook:main'
]
}
)