-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
79 lines (70 loc) · 2.31 KB
/
setup.py
File metadata and controls
79 lines (70 loc) · 2.31 KB
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
from pathlib import Path
from setuptools import setup, find_packages
from setupbase import (
get_data_files,
wrap_installers,
npm_builder,
get_version,
)
MODULE_DIR = Path(__file__).resolve().parent
README = (MODULE_DIR / "README.md").read_text()
BASE = [
f"{_.strip()}"
for _ in (MODULE_DIR / "requirements.txt").read_text().splitlines()
if " " not in _
]
DEV = [
f"{_.strip()}"
for _ in (MODULE_DIR / "requirements_dev.txt").read_text().splitlines()
if " " not in _
]
NAME = "ipywidgets_extended"
NB_PATH = MODULE_DIR / NAME / "nbextension" / "static"
LAB_PATH = MODULE_DIR / NAME / "labextension"
# Representative files that should exist after a successful build
jstargets = [
NB_PATH / "index.js",
MODULE_DIR / "lib/plugin.js",
]
data_files_spec = [
(f"share/jupyter/nbextensions/{NAME}", NB_PATH, "*.js*"),
("share/jupyter/lab/extensions", LAB_PATH, "*.tgz"),
("etc/jupyter/nbconfig/notebook.d", MODULE_DIR, f"{NAME}.json"),
]
builder = npm_builder(path=MODULE_DIR, build_cmd="build:all")
cmdclass = wrap_installers(
pre_develop=builder,
pre_dist=builder,
ensured_targets=jstargets,
)
setup(
name=NAME.replace("_", "-"),
version=get_version(Path(NAME) / "version.py"),
license="BSD",
author="Casper Welzel Andersen",
author_email="casper+github@welzel.nu",
cmdclass=cmdclass,
description="Extensions to the Jupyter Widgets in the `ipywidgets` package.",
long_description=README,
long_description_content_type="text/markdown",
url="https://github.com/CasperWA/ipywidgets-extended",
python_requires=">=3.7",
packages=find_packages(),
include_package_data=True,
install_requires=BASE,
extras_require={"dev": DEV},
data_files=get_data_files(data_files_spec),
classifiers=[
"Development Status :: 3 - Alpha",
"Framework :: Jupyter",
"License :: OSI Approved :: BSD License",
"Operating System :: MacOS :: MacOS X",
"Operating System :: POSIX :: Linux",
"Operating System :: Microsoft :: Windows",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Topic :: Software Development :: Widget Sets",
],
)