forked from AlbertDeFusco/jupyter-fs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.py
122 lines (110 loc) · 3.62 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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
# *****************************************************************************
#
# Copyright (c) 2019, the jupyter-fs authors.
#
# This file is part of the jupyter-fs library, distributed under the terms of
# the Apache License 2.0. The full license can be found in the LICENSE file.
from jupyter_packaging import (
combine_commands,
create_cmdclass,
ensure_targets,
install_npm,
skip_if_exists,
)
from pathlib import Path
import setuptools
# project name is also name of labextension npm package
name = labext_name = "jupyter-fs"
# relative paths to python pkg dir and labextension pkg dir
js_pkg, py_pkg = Path("js"), Path("jupyterfs")
# relative path to labextension dist that gets built at the root of the python package
labext_dist = py_pkg / "labextension"
# Representative files that should exist after a successful build
jstargets = [labext_dist / "package.json"]
# POSIX_PREFIX/(APP_SUFFIX, CONFIG_SUFFIX) determines the install location of the (labextension dist, extension config)
APP_SUFFIX = Path("share/jupyter/labextensions/")
CONFIG_SUFFIX = Path("etc/jupyter/")
data_files_spec = [
# distribute the labextension dist via the data_files of the python package
(str(APP_SUFFIX / labext_name), str(labext_dist), "**"),
# include a record of installation method (ie pip) in the labextension install
(str(APP_SUFFIX / labext_name), ".", "install.json"),
# config to enable server extension 'for free' on normal pip install:
(
str(CONFIG_SUFFIX / "jupyter_server_config.d"),
"jupyter-config/jupyter_server_config.d",
"jupyterfs.json",
),
]
package_data_spec = {name: ["*"]}
cmdclass = create_cmdclass(
"jsdeps",
package_data_spec=package_data_spec,
data_files_spec=data_files_spec,
)
js_command = combine_commands(
install_npm(js_pkg, build_cmd="build:prod", npm=["jlpm"]),
ensure_targets(jstargets),
)
cmdclass["jsdeps"] = (
js_command if Path(".git").exists() else skip_if_exists(jstargets, js_command)
)
requires = [
"fs>=2.4.11",
"fs-s3fs>=1.1.1",
"fs.smbfs>=0.6.3",
"jupyterlab>=3.0.0",
"jupyter_server>=1.8.0",
]
test_requires = [
"boto3",
"docker",
"fs-miniofs",
"mock",
"pysmb",
"pytest",
"pytest-cov",
]
dev_requires = test_requires + [
"black>=20.0*",
"bump2version>=1.0.0",
"flake8>=3.7.8",
"flake8-black>=0.2.1",
"pytest",
"pytest-cov>=2.6.1",
"pytest-xdist",
"Sphinx>=1.8.4",
"sphinx-markdown-builder>=0.5.2",
]
with open("README.md", "r") as fh:
long_description = fh.read()
setup_args = dict(
name=name,
version="0.4.0alpha0",
description="A Filesystem-like mult-contents manager backend for Jupyter",
long_description=long_description,
long_description_content_type="text/markdown",
url="https://github.com/jpmorganchase/jupyter-fs",
author="jupyter-fs authors",
license="Apache 2.0",
classifiers=[
"License :: OSI Approved :: Apache Software License",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Framework :: Jupyter",
],
cmdclass=cmdclass,
keywords="jupyter jupyterlab",
packages=setuptools.find_packages(exclude=("js", "js.*")),
install_requires=requires,
extras_require={"dev": dev_requires, "test": test_requires},
include_package_data=True,
zip_safe=False,
python_requires=">=3.7",
)
if __name__ == "__main__":
setuptools.setup(**setup_args)