Skip to content

Commit 21d169e

Browse files
committed
Clean up extension spec version
1 parent b538d93 commit 21d169e

File tree

9 files changed

+34
-13
lines changed

9 files changed

+34
-13
lines changed

js/src/_base/Renderable.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ var $ = require('jquery');
66
var THREE = require('three');
77

88
var pkgName = require('../../package.json').name;
9+
var EXTENSION_SPEC_VERSION = require('../../version').EXTENSION_SPEC_VERSION;
910
var RendererPool = require('./RendererPool');
1011

1112
var ThreeModel = require('./Three').ThreeModel;
@@ -16,8 +17,10 @@ var RenderableModel = widgets.DOMWidgetModel.extend({
1617
return _.extend(widgets.DOMWidgetModel.prototype.defaults.call(this), {
1718
_model_module: pkgName,
1819
_view_module: pkgName,
20+
_model_module_version: EXTENSION_SPEC_VERSION,
1921
_model_name: 'RenderableModel',
2022
_view_name: 'RenderableView',
23+
_view_module_version: EXTENSION_SPEC_VERSION,
2124

2225
_width: 200,
2326
_height: 200,

js/src/_base/Three.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ var Enums = require('./enums');
1010

1111
var utils = require('./utils');
1212

13-
var version = require('../../package.json').version;
13+
var EXTENSION_SPEC_VERSION = require('../../version').EXTENSION_SPEC_VERSION;
1414

1515

1616
/**
@@ -59,7 +59,7 @@ var ThreeModel = widgets.WidgetModel.extend({
5959
return _.extend(widgets.WidgetModel.prototype.defaults.call(this), {
6060
_model_name: this.constructor.model_name,
6161
_model_module: this.constructor.model_module,
62-
_model_version: this.constructor.model_module_version
62+
_model_module_version: this.constructor.model_module_version
6363
});
6464
},
6565

@@ -767,7 +767,7 @@ var ThreeModel = widgets.WidgetModel.extend({
767767
}, {
768768
model_module: 'jupyter-threejs',
769769
model_name: 'ThreeModel',
770-
model_module_version: version,
770+
model_module_version: EXTENSION_SPEC_VERSION,
771771
});
772772

773773
module.exports = {

js/src/jupyterlab-plugin.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module.exports = {
88
activate: function(app, widgets) {
99
widgets.registerWidget({
1010
name: 'jupyter-threejs',
11-
version: jupyter_threejs.version,
11+
version: jupyter_threejs.EXTENSION_SPEC_VERSION,
1212
exports: jupyter_threejs
1313
});
1414
},

js/src/version.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
2+
// Copyright (c) pythreejs Developers.
3+
// Distributed under the terms of the Modified BSD License.
4+
/**
5+
* The version of the attribute spec that this package
6+
* implements. This is the value used in
7+
* _model_module_version/_view_module_version.
8+
*
9+
* Update this value when attributes are added/removed from
10+
* the widget models, or if the serialized format changes.
11+
*/
12+
module.exports['EXTENSION_SPEC_VERSION'] = '1.0.0-beta.3';

pythreejs/_base/Three.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
from traitlets import Unicode
33

44
from .._package import npm_pkg_name
5-
from .._version import EXTENSION_VERSION
5+
from .._version import EXTENSION_SPEC_VERSION
66

77

88
class ThreeWidget(Widget):
99
"""Base widget type for all pythreejs widgets"""
1010

1111
_model_module = Unicode(npm_pkg_name).tag(sync=True)
12-
_model_module_version = Unicode(EXTENSION_VERSION).tag(sync=True)
12+
_model_module_version = Unicode(EXTENSION_SPEC_VERSION).tag(sync=True)
1313

1414
_previewable = True
1515

pythreejs/_base/renderable.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from traitlets import Unicode, CInt, CFloat, Enum, Bool, Instance, List
33

44
from .._package import npm_pkg_name
5-
from .._version import EXTENSION_VERSION
5+
from .._version import EXTENSION_SPEC_VERSION
66

77
from .Three import ThreeWidget
88
from ..enums import ToneMappings
@@ -13,8 +13,8 @@
1313
class RenderableWidget(DOMWidget):
1414
_view_module = Unicode(npm_pkg_name).tag(sync=True)
1515
_model_module = Unicode(npm_pkg_name).tag(sync=True)
16-
_view_module_version = Unicode(EXTENSION_VERSION).tag(sync=True)
17-
_model_module_version = Unicode(EXTENSION_VERSION).tag(sync=True)
16+
_view_module_version = Unicode(EXTENSION_SPEC_VERSION).tag(sync=True)
17+
_model_module_version = Unicode(EXTENSION_SPEC_VERSION).tag(sync=True)
1818

1919
# renderer properties
2020
_width = CInt(200).tag(sync=True)

pythreejs/_version.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,10 @@
55
__version__ = '%s.%s.%s%s'%(version_info[0], version_info[1], version_info[2],
66
'' if version_info[3]=='final' else _specifier_[version_info[3]]+str(version_info[4]))
77

8-
EXTENSION_VERSION = '1.0.0-beta.3'
8+
# The version of the attribute spec that this package
9+
# implements. This is the value used in
10+
# _model_module_version/_view_module_version.
11+
#
12+
# Update this value when attributes are added/removed from
13+
# the widget models, or if the serialized format changes.
14+
EXTENSION_SPEC_VERSION = '1.0.0-beta.3'

pythreejs/animation/AnimationAction.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from traitlets import Unicode, Union, CInt, CFloat
33

44
from .._package import npm_pkg_name
5-
from .._version import EXTENSION_VERSION
5+
from .._version import EXTENSION_SPEC_VERSION
66

77
from .._base.Three import ThreeWidget
88
from .AnimationAction_autogen import AnimationAction as AnimationActionBase
@@ -16,7 +16,7 @@ class AnimationAction(AnimationActionBase, DOMWidget):
1616
"""
1717
_view_name = Unicode('AnimationActionView').tag(sync=True)
1818
_view_module = Unicode(npm_pkg_name).tag(sync=True)
19-
_view_module_version = Unicode(EXTENSION_VERSION).tag(sync=True)
19+
_view_module_version = Unicode(EXTENSION_SPEC_VERSION).tag(sync=True)
2020

2121
_previewable = False
2222

pythreejs/pythreejs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
import numpy as np
1717

1818
from ._package import npm_pkg_name
19-
from ._version import EXTENSION_VERSION
19+
from ._version import EXTENSION_SPEC_VERSION
2020

2121

2222
from .core.BufferAttribute import BufferAttribute

0 commit comments

Comments
 (0)