From 6d53a34e9a3c7d31ccf53f416701a819e3a1da6f Mon Sep 17 00:00:00 2001 From: Hai Nguyen Date: Fri, 22 Nov 2024 18:08:25 -0500 Subject: [PATCH] Fix setup (#1128) --- MANIFEST.in | 2 -- notebooks/trajectory_player.ipynb | 28 +++++++++++++++++++++-- setup.py | 37 +++++++------------------------ 3 files changed, 34 insertions(+), 33 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 958af5b6..1c418733 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -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/* diff --git a/notebooks/trajectory_player.ipynb b/notebooks/trajectory_player.ipynb index c17af018..2864670e 100644 --- a/notebooks/trajectory_player.ipynb +++ b/notebooks/trajectory_player.ipynb @@ -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 }, @@ -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": { diff --git a/setup.py b/setup.py index 5beb4699..cf8969ca 100644 --- a/setup.py +++ b/setup.py @@ -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: ["*"], } @@ -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(): @@ -54,8 +54,8 @@ 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": ["*"], @@ -63,20 +63,11 @@ def pre_dist(): "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', ], @@ -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': 'alexander.rose@weirdbyte.de', 'url': 'https://github.com/arose/nglview',