Skip to content

Commit 1239184

Browse files
committed
Merge pull request #105 from minrk/no-notebook
prepare for release
2 parents 4da7e47 + 10b18ce commit 1239184

File tree

12 files changed

+211
-33
lines changed

12 files changed

+211
-33
lines changed

.bowerrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"directory": "less_include/components"
3+
}

.gitignore

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ docs/man/*.gz
66
docs/source/api/generated
77
docs/gh-pages
88
ipywidgets/static/components
9-
ipywidgets/static/widgets/css/*.min.css*
9+
ipywidgets/static/widgets/css
10+
ipywidgets/tests/bin
11+
less_include
1012
node_modules
1113
*.py[co]
1214
__pycache__
@@ -20,4 +22,3 @@ __pycache__
2022
.#*
2123
.coverage
2224
.xunit.xml
23-
bin

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,9 @@ before_install:
1313
- git clone --quiet --depth 1 https://github.com/minrk/travis-wheels travis-wheels
1414
install:
1515
- pip install -f travis-wheels/wheelhouse -r requirements.txt
16-
- pip install -f travis-wheels/wheelhouse -e file://$PWD#egg=ipywidgets[test] coveralls
16+
- pip install -f travis-wheels/wheelhouse file://$PWD#egg=ipywidgets[test] coveralls
1717
script:
18+
- mkdir /tmp/ipywidgets && cd /tmp/ipywidgets
1819
- 'if [[ $GROUP == js ]]; then python -m ipywidgets.jstest; fi'
1920
- 'if [[ $GROUP == python ]]; then nosetests --with-coverage --cover-package=ipywidgets ipywidgets; fi'
2021
matrix:

MANIFEST.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
include COPYING.md
22
include CONTRIBUTING.md
33
include README.md
4+
include package.json
5+
include bower.json
6+
include .bowerrc
7+
include build_css.js
48

59
# Documentation
610
graft docs
711
exclude docs/\#*
812

913
# Examples
1014
graft examples
15+
graft ipywidgets/tests
16+
graft ipywidgets/static
1117

1218
# docs subdirs we want to skip
1319
prune docs/build

bower.json

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"name": "ipywidget-less-deps",
3+
"version": "0.0.1",
4+
"dependencies": {
5+
"bootstrap": "components/bootstrap#~3.3",
6+
"font-awesome": "components/font-awesome#~4.2.0"
7+
}
8+
}

build_css.js

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,34 @@
1+
var path = require('path');
2+
3+
var spawn = require('spawn-sync');
4+
15
var source = './ipywidgets/static/widgets/less/widgets.less';
26
var css_destination = './ipywidgets/static/widgets/css/widgets.css';
37
var min_destination = './ipywidgets/static/widgets/css/widgets.min.css';
48

5-
var spawn = require('spawn-sync');
6-
var p = spawn('python', ['-c',
7-
"import os,notebook; print(os.path.join(notebook.DEFAULT_STATIC_FILES_PATH))"]);
8-
spawn('lessc', [
9-
'--include-path=' + p.stdout.toString().trim(),
9+
function run(cmd) {
10+
// run a command, with some help:
11+
// - echo command
12+
// - die on failure
13+
// - show stdout/err
14+
console.log('> ' + cmd.join(' '));
15+
var p = spawn(cmd[0], cmd.slice(1));
16+
process.stdout.write(p.stdout.toString());
17+
process.stderr.write(p.stderr.toString());
18+
if (p.status !== 0) {
19+
console.error("`%s` failed with status=%s", cmd.join(' '), p.status);
20+
process.exit(p.status);
21+
}
22+
return p.stdout.toString();
23+
}
24+
25+
run(['lessc',
26+
'--include-path=./less_include',
1027
source,
11-
css_destination
28+
css_destination,
1229
]);
13-
spawn('cleancss', [
30+
31+
run(['cleancss',
1432
'--source-map',
1533
'--skip-restructuring ',
1634
'-o',

ipywidgets/jstest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def __init__(self, section, *args, **kwargs):
2525
extra_args = kwargs.pop('extra_args', None)
2626
super(WidgetTestController, self).__init__(section, *args, **kwargs)
2727

28-
test_cases = os.path.join(here, '..', 'bin', 'tests', 'tests', self.section)
28+
test_cases = os.path.join(here, 'tests', 'bin', 'tests', self.section)
2929
self.cmd = ['casperjs', 'test', test_cases, '--engine=%s' % self.engine]
3030

3131
if extra_args is not None:
Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
2+
/* Flexible box model classes */
3+
/* Taken from Alex Russell http://infrequently.org/2009/08/css-3-progress/ */
4+
5+
/* This file is a compatability layer. It allows the usage of flexible box
6+
model layouts accross multiple browsers, including older browsers. The newest,
7+
universal implementation of the flexible box model is used when available (see
8+
`Modern browsers` comments below). Browsers that are known to implement this
9+
new spec completely include:
10+
11+
Firefox 28.0+
12+
Chrome 29.0+
13+
Internet Explorer 11+
14+
Opera 17.0+
15+
16+
Browsers not listed, including Safari, are supported via the styling under the
17+
`Old browsers` comments below.
18+
*/
19+
20+
21+
.hbox() {
22+
/* Old browsers */
23+
display: -webkit-box;
24+
-webkit-box-orient: horizontal;
25+
-webkit-box-align: stretch;
26+
27+
display: -moz-box;
28+
-moz-box-orient: horizontal;
29+
-moz-box-align: stretch;
30+
31+
display: box;
32+
box-orient: horizontal;
33+
box-align: stretch;
34+
35+
/* Modern browsers */
36+
display: flex;
37+
flex-direction: row;
38+
align-items: stretch;
39+
}
40+
41+
.vbox() {
42+
/* Old browsers */
43+
display: -webkit-box;
44+
-webkit-box-orient: vertical;
45+
-webkit-box-align: stretch;
46+
47+
display: -moz-box;
48+
-moz-box-orient: vertical;
49+
-moz-box-align: stretch;
50+
51+
display: box;
52+
box-orient: vertical;
53+
box-align: stretch;
54+
55+
/* Modern browsers */
56+
display: flex;
57+
flex-direction: column;
58+
align-items: stretch;
59+
}
60+
61+
.box-flex0() {
62+
/* Old browsers */
63+
-webkit-box-flex: 0;
64+
-moz-box-flex: 0;
65+
box-flex: 0;
66+
67+
/* Modern browsers */
68+
flex: none;
69+
width: auto;
70+
}
71+
72+
.box-flex1() {
73+
/* Old browsers */
74+
-webkit-box-flex: 1;
75+
-moz-box-flex: 1;
76+
box-flex: 1;
77+
78+
/* Modern browsers */
79+
flex: 1;
80+
}
81+
82+
.box-flex() {
83+
/* Old browsers */
84+
.box-flex1();
85+
}
86+
87+
.box-flex2() {
88+
/* Old browsers */
89+
-webkit-box-flex: 2;
90+
-moz-box-flex: 2;
91+
box-flex: 2;
92+
93+
/* Modern browsers */
94+
flex: 2;
95+
}
96+
97+
.align-start() {
98+
/* Old browsers */
99+
-webkit-box-align: start;
100+
-moz-box-align: start;
101+
box-align: start;
102+
103+
/* Modern browsers */
104+
align-items: flex-start;
105+
}
106+
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
// Mixin CSS classes
2+
3+
.border-box-sizing() {
4+
box-sizing: border-box;
5+
-moz-box-sizing: border-box;
6+
-webkit-box-sizing: border-box;
7+
}
8+
9+
.corner-all() {
10+
border-radius: @border-radius-base;
11+
}
12+

ipywidgets/static/widgets/less/widgets.less

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,9 @@
66
@import "/components/font-awesome/less/variables.less";
77

88
// import variables, mixins from Notebook
9-
@import "/base/less/variables.less";
10-
@import "/base/less/mixins.less";
11-
@import "/base/less/flexbox.less";
12-
13-
@import "/notebook/less/variables.less";
9+
// layout mixins
10+
@import "./flexbox.less";
11+
@import "./mixins.less";
1412

1513
@widget-width: 350px;
1614
@widget-width-short: 150px;
@@ -58,7 +56,6 @@
5856
content: @fa-var-chain-broken;
5957
font-family: 'FontAwesome';
6058
color: @brand-danger;
61-
font-size: @notebook_font_size;
6259
top: 3px;
6360
padding: 3px;
6461
}
@@ -133,7 +130,6 @@
133130
.ui-slider-range {
134131
height : 12px;
135132
margin-top : -4px;
136-
background : @page-backdrop-color;
137133
}
138134
}
139135
}
@@ -178,7 +174,6 @@
178174
.ui-slider-range {
179175
width : 12px;
180176
margin-left : -1px;
181-
background : @page-backdrop-color;
182177
}
183178
}
184179
}

0 commit comments

Comments
 (0)