Skip to content

Commit

Permalink
Fix setup (#1128)
Browse files Browse the repository at this point in the history
  • Loading branch information
hainm authored Nov 22, 2024
1 parent a3cc1b2 commit 6d53a34
Show file tree
Hide file tree
Showing 3 changed files with 34 additions and 33 deletions.
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
include nglview/datafiles/*
include nglview/js/*
recursive-include nglview/static *.*
recursive-include nglview/staticlab *.*
include nglview/theme/*
include LICENSE README.md DEVELOPMENT.md CHANGELOG.md
include setup.py
include nglview/_version.py versioneer.py
global-exclude *.pycinclude *.ipynb *.gif *tests/notebooks/*
28 changes: 26 additions & 2 deletions notebooks/trajectory_player.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@
"cells": [
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 2,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "990b22023ae14df1a9cfac55daeae32c",
"model_id": "2900b0275b494bcea1b5b1951bbcb89a",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -28,6 +28,30 @@
"view = nv.show_pytraj(traj)\n",
"view"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "2900b0275b494bcea1b5b1951bbcb89a",
"version_major": 2,
"version_minor": 0
},
"text/plain": [
"NGLWidget(frame=26, max_frame=37, n_components=1)"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"view"
]
}
],
"metadata": {
Expand Down
37 changes: 8 additions & 29 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,13 @@
def update_package_data(distribution):
"""update package_data to catch changes during setup"""
build_py = distribution.get_command_obj('build_py')
# distribution.package_data = find_package_data()
# re-init build_py options which load package_data
build_py.finalize_options()


HERE = Path(__file__).parent.resolve()
# The name of the project
name = "nglview-js-widgets"
lab_path = (HERE / "nglview"/ "staticlab")
lab_path = (HERE / "nglview" / "staticlab")
package_data_spec = {
name: ["*"],
}
Expand All @@ -38,6 +36,8 @@ def update_package_data(distribution):
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(lab_path), "**"),
("etc/jupyter/nbconfig/notebook.d", str(HERE), "nglview-js-widgets.json"),
]

def pre_develop():
Expand All @@ -54,29 +54,20 @@ def pre_dist():
"use_scm_version": True,
"setup_requires": ['setuptools_scm'],
'description': 'IPython widget to interactively view molecular structures and trajectories.',
'description_file': 'README.md',
'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.static": ["*"],
"nglview.staticlab": ["*"],
},
'data_files': [
('share/jupyter/nbextensions/nglview-js-widgets', [
'nglview/static/extension.js',
'nglview/static/index.js',
'nglview/static/index.js.map',
]),
('etc/jupyter/nbconfig/notebook.d' , ['nglview-js-widgets.json'])
],
'tests_require': [
'pytest'
],
'data_files': data_files,
'install_requires': [
'ipywidgets>=8',
'notebook>=7',
'jupyterlab>=3',
'jupyterlab_widgets',
'numpy',
],
Expand All @@ -91,21 +82,9 @@ def pre_dist():
"htmd": ["htmd"],
"qcelemental": ["qcelemental"],
},
'packages': set(find_packages() +
['nglview',
'nglview.static',
'nglview.staticlab',
'nglview.theme',
'nglview.datafiles',
'nglview.utils',
'nglview.tests',
'nglview.sandbox',
'nglview.contrib',
]),
'packages': find_packages(),
'zip_safe': False,
'cmdclass': cmdclass,
'data_files': data_files,

'author': 'Alexander S. Rose, Hai Nguyen',
'author_email': '[email protected]',
'url': 'https://github.com/arose/nglview',
Expand Down

0 comments on commit 6d53a34

Please sign in to comment.