|
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.6') |
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 |
| -lab3_path = pjoin(HERE, name, 'labextension') |
33 | 33 |
|
34 | 34 | # Representative files that should exist after a successful build
|
35 | 35 | jstargets = [
|
36 |
| - pjoin(nb_path, 'index.js'), |
| 36 | + pjoin(HERE, name, 'nbextension', 'index.js'), |
37 | 37 | pjoin(HERE, 'lib', 'plugin.js'),
|
38 | 38 | ]
|
39 | 39 |
|
| 40 | + |
40 | 41 | package_data_spec = {
|
41 | 42 | name: [
|
42 |
| - 'nbextension/static/**js*', |
43 |
| - # 'labextension/*.tgz', |
44 |
| - 'labextension/*' |
| 43 | + 'nbextension/**js*', |
| 44 | + 'labextension/**' |
45 | 45 | ]
|
46 | 46 | }
|
47 | 47 |
|
48 |
| -labext_name = "{{ cookiecutter.npm_package_name }}" |
49 | 48 |
|
50 | 49 | data_files_spec = [
|
51 |
| - ('share/jupyter/nbextensions/{{ cookiecutter.python_package_name}}', |
52 |
| - nb_path, '*.js*'), |
53 |
| - ("share/jupyter/labextensions/%s" % labext_name, lab3_path, "**"), |
54 |
| - ("share/jupyter/labextensions/%s" % labext_name, str(HERE), "install.json"), |
55 |
| -# ('share/jupyter/lab/extensions', lab_path, '*.tgz'), |
56 |
| - ('etc/jupyter/nbconfig/notebook.d' , HERE, '{{ cookiecutter.python_package_name}}.json') |
| 50 | + ('share/jupyter/nbextensions/{{ cookiecutter.npm_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'), |
57 | 54 | ]
|
58 | 55 |
|
59 | 56 |
|
|
0 commit comments