|
6 | 6 |
|
7 | 7 | from __future__ import print_function
|
8 | 8 | from glob import glob
|
| 9 | +import os |
9 | 10 | from os.path import join as pjoin
|
| 11 | +from setuptools import setup, find_packages |
10 | 12 |
|
11 | 13 |
|
12 |
| -from setupbase import ( |
13 |
| - create_cmdclass, install_npm, ensure_targets, |
14 |
| - find_packages, combine_commands, ensure_python, |
15 |
| - get_version, HERE |
| 14 | +from jupyter_packaging import ( |
| 15 | + create_cmdclass, |
| 16 | + install_npm, |
| 17 | + ensure_targets, |
| 18 | + combine_commands, |
| 19 | + get_version, |
16 | 20 | )
|
17 | 21 |
|
18 |
| -from setuptools import setup |
| 22 | +HERE = os.path.dirname(os.path.abspath(__file__)) |
| 23 | + |
| 24 | + |
19 | 25 |
|
20 | 26 |
|
21 | 27 | # The name of the project
|
22 | 28 | name = '{{ cookiecutter.python_package_name }}'
|
23 | 29 |
|
24 |
| -# Ensure a valid python version |
25 |
| -ensure_python('>=3.4') |
26 |
| - |
27 |
| -# Get our version |
| 30 | +# Get the version |
28 | 31 | version = get_version(pjoin(name, '_version.py'))
|
29 | 32 |
|
30 |
| -nb_path = pjoin(HERE, name, 'nbextension', 'static') |
31 |
| -lab_path = pjoin(HERE, name, 'labextension') |
32 | 33 |
|
33 | 34 | # Representative files that should exist after a successful build
|
34 | 35 | jstargets = [
|
35 |
| - pjoin(nb_path, 'index.js'), |
| 36 | + pjoin(HERE, name, 'nbextension', 'index.js'), |
36 | 37 | pjoin(HERE, 'lib', 'plugin.js'),
|
37 | 38 | ]
|
38 | 39 |
|
| 40 | + |
39 | 41 | package_data_spec = {
|
40 | 42 | name: [
|
41 |
| - 'nbextension/static/*.*js*', |
42 |
| - 'labextension/*.tgz' |
| 43 | + 'nbextension/**js*', |
| 44 | + 'labextension/**' |
43 | 45 | ]
|
44 | 46 | }
|
45 | 47 |
|
| 48 | + |
46 | 49 | data_files_spec = [
|
47 |
| - ('share/jupyter/nbextensions/{{ cookiecutter.python_package_name}}', |
48 |
| - nb_path, '*.js*'), |
49 |
| - ('share/jupyter/lab/extensions', lab_path, '*.tgz'), |
50 |
| - ('etc/jupyter/nbconfig/notebook.d' , HERE, '{{ cookiecutter.python_package_name}}.json') |
| 50 | + ('share/jupyter/nbextensions/{{ cookiecutter.python_package_name }}', '{{ cookiecutter.python_package_name }}/nbextension', '**'), |
| 51 | + ('share/jupyter/labextensions/{{ cookiecutter.npm_package_name }}', '{{ cookiecutter.python_package_name }}/labextension', '**'), |
| 52 | + ('share/jupyter/labextensions/{{ cookiecutter.npm_package_name }}', '.', 'install.json'), |
| 53 | + ('etc/jupyter/nbconfig/notebook.d', '.', '{{ cookiecutter.npm_package_name }}.json'), |
51 | 54 | ]
|
52 | 55 |
|
53 | 56 |
|
54 | 57 | cmdclass = create_cmdclass('jsdeps', package_data_spec=package_data_spec,
|
55 | 58 | data_files_spec=data_files_spec)
|
56 | 59 | cmdclass['jsdeps'] = combine_commands(
|
57 |
| - install_npm(HERE, build_cmd='build:all'), |
| 60 | + install_npm(HERE, build_cmd='build:prod'), |
58 | 61 | ensure_targets(jstargets),
|
59 | 62 | )
|
60 | 63 |
|
|
85 | 88 | 'Framework :: Jupyter',
|
86 | 89 | ],
|
87 | 90 | include_package_data = True,
|
| 91 | + python_requires=">=3.6", |
88 | 92 | install_requires = [
|
89 | 93 | 'ipywidgets>=7.0.0',
|
90 | 94 | ],
|
|
0 commit comments