Skip to content

Commit b968a96

Browse files
committed
Resource group name is widget name.
1 parent c000934 commit b968a96

File tree

9 files changed

+73
-32
lines changed

9 files changed

+73
-32
lines changed

.gitignore

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,12 @@
11
*.egg-info
22
*.pyc
33
*.pyo
4-
*#*
5-
*~
64
/.coverage
7-
/bin/
8-
/coverage/
95
/dist/
10-
/include/
6+
/htmlcov/
117
/js/karma/
12-
/lib/
13-
/lib64
14-
/local/
158
/node_modules/
169
/package-lock.json
17-
/pyvenv.cfg
18-
/share/
10+
/py2/
11+
/py3/
12+
/pypy3/

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"karma-typescript": "^5.5.3",
1616
"karma-viewport": "^1.0.9",
1717
"qunit": "^2.19.1",
18-
"rollup": "^2.74.1",
18+
"rollup": "^2.75.3",
1919
"rollup-plugin-cleanup": "^3.2.1",
2020
"rollup-plugin-export-default": "^1.4.0",
2121
"rollup-plugin-terser": "^7.0.2",

scripts/clean.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,15 @@
55
set -e
66

77
to_remove=(
8-
.coverage bin dist include htmlcov js/karma lib64 lib
9-
node_modules package-lock.json pyvenv.cfg share
8+
.coverage
9+
dist
10+
htmlcov
11+
js/karma
12+
node_modules
13+
package-lock.json
14+
py2
15+
py3
16+
pypy3
1017
)
1118

1219
for item in "${to_remove[@]}"; do

scripts/coverage.sh

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,22 @@
1-
#!/bin/sh
1+
#!/bin/bash
22

33
set -e
44

5-
./bin/coverage run \
6-
--source src/yafowil/widget/tiptap \
7-
--omit src/yafowil/widget/tiptap/example.py \
8-
-m yafowil.widget.tiptap.tests
9-
./bin/coverage report
10-
./bin/coverage html
5+
function run_coverage {
6+
local target=$1
7+
8+
if [ -e "$target" ]; then
9+
./$target/bin/coverage run \
10+
--source src/yafowil/widget/tiptap \
11+
--omit src/yafowil/widget/tiptap/example.py \
12+
-m yafowil.widget.tiptap.tests
13+
./$target/bin/coverage report
14+
./$target/bin/coverage html
15+
else
16+
echo "Target $target not found."
17+
fi
18+
}
19+
20+
run_coverage py2
21+
run_coverage py3
22+
run_coverage pypy3

scripts/install.sh

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,21 @@ npm --prefix . --save install \
4949

5050
npm --prefix . --no-save install https://github.com/jquery/jquery#main
5151

52+
function install {
53+
local interpreter=$1
54+
local target=$2
5255

53-
python3 -m venv .
54-
./bin/pip install wheel
55-
./bin/pip install coverage
56-
./bin/pip install yafowil[test]
57-
./bin/pip install -e .[test]
56+
if [ -x "$(which $interpreter)" ]; then
57+
virtualenv --clear -p $interpreter $target
58+
./$target/bin/pip install wheel coverage
59+
./$target/bin/pip install https://github.com/conestack/webresource/archive/master.zip
60+
./$target/bin/pip install https://github.com/conestack/yafowil/archive/master.zip
61+
./$target/bin/pip install -e .[test]
62+
else
63+
echo "Interpreter $interpreter not found. Skip install."
64+
fi
65+
}
66+
67+
install python2 py2
68+
install python3 py3
69+
install pypy3 pypy3

scripts/test.sh

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,16 @@
22
#
33
# Run python tests.
44

5-
./bin/python -m yafowil.widget.tiptap.tests
5+
function run_tests {
6+
local target=$1
7+
8+
if [ -e "$target" ]; then
9+
./$target/bin/python -m yafowil.widget.tiptap.tests
10+
else
11+
echo "Target $target not found."
12+
fi
13+
}
14+
15+
run_tests py2
16+
run_tests py3
17+
run_tests pypy3

setup.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@ def read_file(name):
1515
'CHANGES.rst',
1616
'LICENSE.rst'
1717
]])
18-
tests_require = ['yafowil[test]']
1918

2019

2120
setup(
@@ -48,10 +47,14 @@ def read_file(name):
4847
'setuptools',
4948
'yafowil>2.2',
5049
],
51-
tests_require=tests_require,
52-
extras_require=dict(
53-
test=tests_require,
54-
),
50+
tests_require=[
51+
'lxml',
52+
'zope.testrunner'
53+
],
54+
extras_require=dict(test=[
55+
'lxml',
56+
'zope.testrunner'
57+
]),
5558
test_suite="yafowil.widget.tiptap.tests",
5659
entry_points="""
5760
[yafowil.plugin]

src/yafowil/widget/tiptap/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
# webresource ################################################################
1515

1616
resources = wr.ResourceGroup(
17-
name='yafowil-tiptap-resources',
17+
name='yafowil.widget.tiptap',
1818
directory=resources_dir,
1919
path='yafowil-tiptap'
2020
)

src/yafowil/widget/tiptap/tests.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ def test_resources(self):
143143
factory.theme = 'default'
144144
resources = factory.get_resources('yafowil.widget.tiptap')
145145
self.assertTrue(resources.directory.endswith(np('/tiptap/resources')))
146+
self.assertEqual(resources.name, 'yafowil.widget.tiptap')
146147
self.assertEqual(resources.path, 'yafowil-tiptap')
147148

148149
scripts = resources.scripts

0 commit comments

Comments
 (0)