Skip to content

Commit

Permalink
Fix data_files
Browse files Browse the repository at this point in the history
  • Loading branch information
jtpio committed Dec 15, 2020
1 parent 89a316f commit 2d77aa3
Showing 1 changed file with 33 additions and 25 deletions.
58 changes: 33 additions & 25 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,25 @@

HERE = os.path.abspath(os.path.dirname(__file__))

# The name of the project
name="voila-gridstack"

labext_name = "jupyterlab-gridstack"
lab_extension_dest = os.path.join(HERE, name, "labextension")
lab_extension_source = os.path.join(HERE, "packages", labext_name)

# Representative files that should exist after a successful build
jstargets = [
os.path.join(lab_extension_source, "lib", "index.js"),
os.path.join(lab_extension_dest, "package.json"),
]

package_data_spec = {
name: [
"*"
]
}


class DevelopCmd(develop):
prefix_targets = [
Expand Down Expand Up @@ -47,37 +66,26 @@ def run(self):
super(DevelopCmd, self).run()


# The name of the project
name="voila-gridstack"

labext_name = "jupyterlab-gridstack"
lab_extension_dest = os.path.join(HERE, name, "labextension")
lab_extension_source = os.path.join(HERE, "packages", labext_name)
def get_data_files():
data_files_spec = [
("share/jupyter/labextensions/%s" % labext_name, lab_extension_dest, "**"),
("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"),
("etc/jupyter/jupyter_server_config.d", "etc/jupyter/jupyter_server_config.d", "voila-gridstack.json"),
("etc/jupyter/jupyter_notebook_config.d", "etc/jupyter/jupyter_notebook_config.d", "voila-gridstack.json"),
("etc/jupyter/nbconfig/notebook.d", "etc/jupyter/nbconfig/notebook.d", "voila-gridstack.json"),
("share/jupyter/nbextensions/voila-gridstack", "voila-gridstack/static", "**")
]

# Representative files that should exist after a successful build
jstargets = [
os.path.join(lab_extension_source, "lib", "index.js"),
os.path.join(lab_extension_dest, "package.json"),
]
# Add all the templates
for root, dirs, files in os.walk('share'):
data_files_spec += [[root, root, f] for f in files]

package_data_spec = {
name: [
"*"
]
}
return data_files_spec

data_files_spec = [
("share/jupyter/labextensions/%s" % labext_name, lab_extension_dest, "**"),
("share/jupyter/labextensions/%s" % labext_name, HERE, "install.json"),
("etc/jupyter/jupyter_server_config.d", "etc/jupyter/jupyter_server_config.d", "voila-gridstack.json"),
("etc/jupyter/jupyter_notebook_config.d", "etc/jupyter/jupyter_notebook_config.d", "voila-gridstack.json"),
("etc/jupyter/nbconfig/notebook.d", "etc/jupyter/nbconfig/notebook.d", "voila-gridstack.json"),
("share/jupyter/nbextensions/voila-gridstack", "voila-gridstack/static", "**")
]

cmdclass = create_cmdclass("jsdeps",
package_data_spec=package_data_spec,
data_files_spec=data_files_spec
data_files_spec=get_data_files()
)

cmdclass["jsdeps"] = combine_commands(
Expand Down

0 comments on commit 2d77aa3

Please sign in to comment.