-
Notifications
You must be signed in to change notification settings - Fork 11
/
setup.py
73 lines (59 loc) · 2.16 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
import re
import setuptools
from pathlib import Path
version = re.search(
'^__version__\s*=\s*"(.*)"',
open('jupyterlab_gitplus/__init__.py').read(),
re.M
).group(1)
with open("README.md", "rb") as f:
long_descr = f.read().decode("utf-8")
HERE = Path(__file__).parent.resolve()
# The name of the project
name = "jupyterlab_gitplus"
lab_path = (HERE / name.replace("-", "_") / "labextension")
labext_name = "@reviewnb/jupyterlab_gitplus"
# Representative files that should exist after a successful build
ensured_targets = [
str(lab_path / "package.json"),
str(lab_path / "static/style.js")
]
data_files_spec = [
("share/jupyter/labextensions/%s" % labext_name, str(lab_path), "**"),
("share/jupyter/labextensions/%s" % labext_name, str(HERE), "install.json"),
("etc/jupyter/jupyter_server_config.d", "jupyter-config/server-config", "jupyterlab_gitplus.json"),
# For backward compatibility with notebook server
("etc/jupyter/jupyter_notebook_config.d", "jupyter-config/nb-config", "jupyterlab_gitplus.json"),
]
setup_args = dict(
name = "jupyterlab_gitplus",
packages = ["jupyterlab_gitplus"],
python_requires='>=3',
version = version,
description = "JupyterLab extension to create GitHub pull requests",
long_description = long_descr,
long_description_content_type="text/markdown",
author = "Amit Rathi",
author_email = "amit@reviewnb.com",
url = "https://github.com/ReviewNB/jupyterlab-gitplus",
keywords=['github', 'jupyter', 'notebook', 'pull request', 'version control', 'git'],
include_package_data=True,
platforms="Linux, Mac OS X, Windows",
install_requires=[
'jupyterlab',
'gitpython',
'requests',
'urllib3',
'jupyter_server>=1.6,<3'
]
)
from jupyter_packaging import (
wrap_installers,
npm_builder,
get_data_files
)
post_develop = npm_builder(build_cmd="install:extension", source_dir="src", build_dir=lab_path)
setup_args['cmdclass'] = wrap_installers(post_develop=post_develop, ensured_targets=ensured_targets)
setup_args['data_files'] = get_data_files(data_files_spec)
if __name__ == "__main__":
setuptools.setup(**setup_args)