Skip to content

Commit 5f92aeb

Browse files
authored
Merge pull request #141 from vidartf/setupbase
Update setupbase for dist fixes
2 parents 24c3e59 + 10906e6 commit 5f92aeb

File tree

3 files changed

+357
-78
lines changed

3 files changed

+357
-78
lines changed

setup.cfg

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ universal=1
33

44
[manifix]
55
known_excludes =
6-
.git
7-
.gitignore
8-
**/node_modules
6+
.git/**
7+
.git*
8+
**/node_modules/**
99
**/*.pyc
1010
.travis.yml
1111
screencast.gif

setup.py

Lines changed: 30 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,60 @@
11
# -*- coding: utf-8 -*-
22

33
from __future__ import print_function
4-
from setuptools import setup, find_packages
54
import os
65
import sys
76

87
from setupbase import (
8+
setup,
9+
log,
910
create_cmdclass,
1011
install_npm,
12+
combine_commands,
13+
ensure_targets,
14+
get_version,
1115
)
1216

1317

14-
from distutils import log
1518
log.set_verbosity(log.DEBUG)
1619
log.info('setup.py entered')
1720
log.info('$PATH=%s' % os.environ['PATH'])
1821

1922
LONG_DESCRIPTION = 'A Python/ThreeJS bridge utilizing the Jupyter widget infrastructure.'
2023

21-
2224
here = os.path.abspath(os.path.dirname(sys.argv[0]))
25+
name = 'pythreejs'
26+
version = get_version(os.path.join(here, name, '_version.py'))
2327

2428

25-
version_ns = {}
26-
with open(os.path.join(here, 'pythreejs', '_version.py')) as f:
27-
exec(f.read(), {}, version_ns)
28-
29-
30-
cmdclass = create_cmdclass(['js'])
31-
cmdclass['js'] = install_npm(
32-
path=os.path.join(here, 'js'),
33-
build_dir=os.path.join(here, 'pythreejs', 'static'),
34-
source_dir=os.path.join(here, 'js'),
29+
cmdclass = create_cmdclass('js',
30+
data_files_spec=[
31+
('share/jupyter/nbextensions/jupyter-threejs', [
32+
name + '/static/*.js',
33+
name + '/static/*.js.map',
34+
]),
35+
],
36+
)
37+
cmdclass['js'] = combine_commands(
38+
install_npm(
39+
path=os.path.join(here, 'js'),
40+
build_dir=os.path.join(here, name, 'static'),
41+
source_dir=os.path.join(here, 'js'),
42+
),
43+
ensure_targets([
44+
name + '/static/extension.js',
45+
name + '/static/index.js',
46+
'js/src/core/BufferAttribute.autogen.js',
47+
name + '/core/BufferAttribute_autogen.py',
48+
]),
3549
)
3650

3751
setup_args = {
38-
'name': 'pythreejs',
39-
'version': version_ns['__version__'],
52+
'name': name,
53+
'version': version,
4054
'description': 'Interactive 3d graphics for the Jupyter notebook, using Three.js from Jupyter interactive widgets.',
4155
'long_description': LONG_DESCRIPTION,
4256
'license': 'BSD',
4357
'include_package_data': True,
44-
'data_files': [
45-
('share/jupyter/nbextensions/jupyter-threejs', [
46-
'pythreejs/static/extension.js',
47-
'pythreejs/static/index.js',
48-
'pythreejs/static/index.js.map',
49-
]),
50-
],
5158
'install_requires': [
5259
'ipywidgets>=7,<8',
5360
'ipydatawidgets>=1.1.1',
@@ -64,7 +71,7 @@
6471
'scikit-image'
6572
],
6673
},
67-
'packages': ['pythreejs'], # Manually specify here, update after autogen
74+
'packages': [name], # Manually specify here, update after autogen
6875
'zip_safe': False,
6976
'cmdclass': cmdclass,
7077
'author': 'PyThreejs Development Team',

0 commit comments

Comments
 (0)