-
Notifications
You must be signed in to change notification settings - Fork 133
/
setup.py
116 lines (102 loc) · 3.71 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
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
"""Use `pip install` rather than `python setup.py install`
to correctly distribute the notebook and lab extensions.
"""
import os
from distutils import log
from pathlib import Path
from setuptools import find_packages, setup
from jupyter_packaging import wrap_installers, get_data_files
here = os.path.dirname(os.path.abspath(__file__))
node_root = os.path.join(here, 'js')
is_repo = os.path.exists(os.path.join(here, '.git'))
log.set_verbosity(log.DEBUG)
log.info('setup.py entered')
log.info('$PATH=%s' % os.environ['PATH'])
def update_package_data(distribution):
"""update package_data to catch changes during setup"""
build_py = distribution.get_command_obj('build_py')
build_py.finalize_options()
HERE = Path(__file__).parent.resolve()
# The name of the project
lab_path = (HERE / "nglview" / "labextension")
nb_path = (HERE / "nglview" / "nbextension")
assert (nb_path/"index.js").exists(), "index.js not found in %s. Make sure to build the frontend assets and install the JupyterLab extension." % nb_path
assert (lab_path/"package.json").exists(), "package.json not found in %s. Make sure to build the frontend assets and install the JupyterLab extension." % lab_path
labext_name = "nglview-js-widgets"
package_data_spec = {
labext_name: ["*"],
}
data_files_spec = [
("share/jupyter/labextensions/%s" % labext_name, str(lab_path), "**"),
("share/jupyter/labextensions/%s" % labext_name, str(HERE), "install.json"),
("share/jupyter/nbextensions/%s" % labext_name, str(nb_path), "**"),
("etc/jupyter/nbconfig/notebook.d", str(HERE), "nglview-js-widgets.json"),
]
def pre_develop():
pass
def pre_dist():
pass
cmdclass = wrap_installers(pre_develop=pre_develop, pre_dist=pre_dist)
data_files = get_data_files(data_files_spec)
setup_args = {
'name': 'nglview',
"use_scm_version": True,
"setup_requires": ['setuptools_scm'],
'description': 'IPython widget to interactively view molecular structures and trajectories.',
'long_description': open('README.md').read(),
'long_description_content_type': 'text/markdown',
'license': "MIT",
'package_data': {
"nglview.datafiles": ["*"],
"nglview.theme": ["*"],
"nglview.nbextension": ["*"],
"nglview.labextension": ["*"],
},
'data_files': data_files,
'install_requires': [
'ipywidgets>=8',
'notebook>=7',
'jupyterlab>=3',
'jupyterlab_widgets',
'numpy',
],
'extras_require': {
"simpletraj": ["simpletraj"],
"mdtraj": ["mdtraj"],
"pytraj": ["pytraj"],
"MDAnalysis": ["MDAnalysis"],
"ParmEd": ["parmed"],
"rdkit": ["rdkit"],
"ase": ["ase"],
"htmd": ["htmd"],
"qcelemental": ["qcelemental"],
},
'packages': find_packages(),
'zip_safe': False,
'cmdclass': cmdclass,
'author': 'Alexander S. Rose, Hai Nguyen',
'author_email': '[email protected]',
'url': 'https://github.com/arose/nglview',
'keywords': [
'ipython',
'jupyter',
'widgets',
],
'python_requires': '>=3.7',
'classifiers': [
'Framework :: IPython',
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: JavaScript',
'Programming Language :: Python :: 3 :: Only',
'Topic :: Multimedia :: Graphics',
'Topic :: Scientific/Engineering :: Bio-Informatics',
'Topic :: Scientific/Engineering :: Chemistry',
'Topic :: Scientific/Engineering :: Visualization',
'Operating System :: Microsoft :: Windows',
'Operating System :: POSIX',
'Operating System :: Unix',
'Operating System :: MacOS',
],
}
setup(**setup_args)