Skip to content

Commit 6fc2881

Browse files
authoredMar 18, 2025
Merge pull request #5 from conestack/mxmake
Mxmake
2 parents 2a9072d + ceb5114 commit 6fc2881

File tree

11 files changed

+785
-43
lines changed

11 files changed

+785
-43
lines changed
 

‎.gitignore

+20-6
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,21 @@
1+
.python-version
12
*.egg-info
2-
.vscode
3-
/docs/html
4-
/node_modules
5-
/venv
6-
__pycache__
7-
package-lock.json
3+
*.pyc
4+
*.pyo
5+
/.mxmake/
6+
/.project
7+
/.venv/
8+
/.vscode/
9+
/constraints-mxdev.txt
10+
/coverage/
11+
.coverage
12+
/dist/
13+
/node_modules/
14+
/package-lock.json
15+
/pnpm-lock.yaml
16+
/requirements-mxdev.txt
17+
/sources/
18+
/src/cone.calendar.egg-info/
19+
/var/
20+
/venv/
21+

‎CHANGES.rst

+6
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,11 @@ Changes
44
0.1 (unreleased)
55
----------------
66

7+
- Setup Makefile.
8+
[lenadax]
9+
10+
- Run tests with pytest.
11+
[lenadax]
12+
713
- Initial work.
814
[rnix, toalba, lenadax]

‎Makefile

+639
Large diffs are not rendered by default.

‎js/rollup.conf.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import cleanup from 'rollup-plugin-cleanup';
2-
import {terser} from 'rollup-plugin-terser';
2+
import terser from '@rollup/plugin-terser';
33

44
const out_dir = 'src/cone/charts/browser/static/cone_charts';
55

‎mx.ini

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
[settings]
2+
threads = 5
3+
4+
version-overrides =
5+
pyramid==1.9.4
6+
repoze.zcml==1.1
7+
repoze.workflow==1.1
8+
9+
main-package = -e .[test]
10+
11+
mxmake-templates =
12+
run-tests
13+
run-coverage
14+
15+
mxmake-test-path = src
16+
mxmake-source-path = src/cone/charts
17+
18+
cs = https://github.com/conestack
19+
cs_push = git@github.com:conestack
20+
bda = https://github.com/bluedynamics
21+
bda_push = git@github.com:bluedynamics
22+
23+
[mxmake-env]
24+
TESTRUN_MARKER = 1
25+
26+
[mxmake-run-tests]
27+
environment = env
28+
29+
[mxmake-run-coverage]
30+
environment = env
31+
32+
[odict]
33+
url = ${settings:cs}/odict.git
34+
pushurl = ${settings:cs_push}/odict.git
35+
branch = master
36+
mxmake-test-path = src
37+
mxmake-source-path = src/odict
38+
39+
[plumber]
40+
url = ${settings:cs}/plumber.git
41+
pushurl = ${settings:cs_push}/plumber.git
42+
branch = master
43+
mxmake-test-path = src
44+
mxmake-source-path = src/plumber
45+
46+
[node]
47+
url = ${settings:cs}/node.git
48+
pushurl = ${settings:cs_push}/node.git
49+
branch = master
50+
mxmake-test-path = src
51+
mxmake-source-path = src/node
52+
53+
[node.ext.ugm]
54+
url = ${settings:cs}/node.ext.ugm.git
55+
pushurl = ${settings:cs_push}/node.ext.ugm.git
56+
branch = master
57+
mxmake-test-path = src
58+
mxmake-source-path = src/node/ext/ugm
59+
60+
[webresource]
61+
url = ${settings:cs}/webresource.git
62+
pushurl = ${settings:cs_push}/webresource.git
63+
branch = master
64+
mxmake-test-path = .
65+
mxmake-source-path = webresource
66+
67+
[treibstoff]
68+
url = ${settings:cs}/treibstoff.git
69+
pushurl = ${settings:cs_push}/treibstoff.git
70+
branch = master
71+
72+
[cone.tile]
73+
url = ${settings:cs}/cone.tile.git
74+
pushurl = ${settings:cs_push}/cone.tile.git
75+
branch = master
76+
mxmake-test-path = src
77+
mxmake-source-path = src/cone/tile
78+
79+
[cone.app]
80+
url = ${settings:cs}/cone.app.git
81+
pushurl = ${settings:cs_push}/cone.app.git
82+
branch = 2.0
83+
mxmake-test-path = src
84+
mxmake-source-path = src/cone/app
85+
86+
[yafowil]
87+
url = ${settings:cs}/yafowil.git
88+
pushurl = ${settings:cs_push}/yafowil.git
89+
branch = master
90+
mxmake-test-path = src
91+
mxmake-source-path = src/yafowil
92+
93+
[yafowil.bootstrap]
94+
url = ${settings:cs}/yafowil.bootstrap.git
95+
pushurl = ${settings:cs_push}/yafowil.bootstrap.git
96+
branch = bs5
97+
mxmake-test-path = src
98+
mxmake-source-path = src/yafowil/bootstrap

‎package.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "cone.charts",
33
"version": "0.1.0-dev",
44
"devDependencies": {
5+
"@rollup/plugin-terser": "^0.4.4",
56
"jquery": "github:jquery/jquery#main",
67
"jsdoc": "^4.0.0",
78
"karma": "^6.4.1",
@@ -10,8 +11,7 @@
1011
"karma-module-resolver-preprocessor": "^1.1.3",
1112
"karma-qunit": "^4.1.2",
1213
"qunit": "^2.19.3",
13-
"rollup": "^2.79.1",
14-
"rollup-plugin-cleanup": "^3.2.1",
15-
"rollup-plugin-terser": "^7.0.2"
14+
"rollup": "^2.79.2",
15+
"rollup-plugin-cleanup": "^3.2.1"
1616
}
1717
}

‎setup.py

+5-12
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
from setuptools import find_packages
22
from setuptools import setup
3-
from setuptools.command.test import test
43
import os
54

65

@@ -18,12 +17,6 @@ def read_file(name):
1817
]])
1918

2019

21-
class Test(test):
22-
23-
def run_tests(self):
24-
from cone.charts import tests
25-
tests.run_tests()
26-
2720

2821
setup(
2922
name='cone.charts',
@@ -47,11 +40,13 @@ def run_tests(self):
4740
zip_safe=False,
4841
install_requires=[
4942
'setuptools',
50-
'cone.app'
43+
'cone.app[lxml]>=1.0.3',
44+
'yafowil.yaml'
5145
],
5246
extras_require=dict(
5347
test=[
54-
'zope.testrunner'
48+
'zope.pytestlayer',
49+
'pytest',
5550
],
5651
docs=[
5752
'Jinja2<3.0',
@@ -60,7 +55,5 @@ def run_tests(self):
6055
'sphinx-conestack-theme',
6156
'sphinx-js'
6257
]
63-
),
64-
tests_require=['zope.testrunner'],
65-
cmdclass=dict(test=Test)
58+
)
6659
)

‎src/cone/charts/browser/static/cone_charts/cone.charts.js

+9-17
Original file line numberDiff line numberDiff line change
@@ -23,13 +23,13 @@ var cone_charts = (function (exports, $) {
2323
this.params = settings.params;
2424
this.data = null;
2525
this.chart = null;
26-
this.on_data_load = this.on_data_load.bind(this);
27-
this.prepare_options();
28-
this.prepare_params();
26+
this.on_before_load = this.on_before_load.bind(this);
27+
this.on_data_loaded = this.on_data_loaded.bind(this);
2928
this.load();
3029
}
3130
load() {
3231
this.unload();
32+
this.trigger('on_before_load');
3333
ts.ajax.request({
3434
url: this.data_source,
3535
type: 'json',
@@ -38,27 +38,23 @@ var cone_charts = (function (exports, $) {
3838
params: this.params,
3939
success: (data) => {
4040
this.data = data;
41-
this.prepare_data();
42-
this.trigger('on_data_load');
41+
this.trigger('on_data_loaded');
4342
}
4443
});
4544
}
4645
unload() {
4746
if (this.chart !== null) {
4847
this.chart.destroy();
48+
this.chart = null;
4949
}
5050
}
5151
destroy() {
5252
this.unload();
5353
}
54-
on_data_load() {
55-
this.create_chart();
56-
}
57-
prepare_options() {
58-
}
59-
prepare_params() {
54+
on_before_load() {
6055
}
61-
prepare_data() {
56+
on_data_loaded() {
57+
this.create_chart();
6258
}
6359
create_chart() {
6460
this.chart = new Chart(this.canvas, {
@@ -70,11 +66,7 @@ var cone_charts = (function (exports, $) {
7066
}
7167

7268
$(function () {
73-
if (window.ts !== undefined) {
74-
ts.ajax.register(ChartTile.initialize, true);
75-
} else {
76-
bdajax.register(ChartTile.initialize, true);
77-
}
69+
ts.ajax.register(ChartTile.initialize, true);
7870
});
7971

8072
exports.ChartTile = ChartTile;

‎src/cone/charts/browser/static/cone_charts/cone.charts.min.js

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎src/cone/charts/tests/__init__.py

Whitespace-only changes.

‎src/cone/charts/tests.py ‎src/cone/charts/tests/test_package.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -337,7 +337,7 @@ def chart_data(model, request):
337337
'</div>'
338338
))
339339

340-
from cone.charts.tests import chart_data_test_chart_model
340+
from cone.charts.tests.test_package import chart_data_test_chart_model
341341
self.assertEqual(chart_data_test_chart_model.__doc__,
342342
'Dynamically created by cone.chart.browser.chart.chart_tile'
343343
)
@@ -424,11 +424,11 @@ def test_cone_charts_resources(self):
424424

425425

426426
def run_tests():
427-
from cone.charts import tests
427+
from cone.charts.browser.tests import test_package
428428
from zope.testrunner.runner import Runner
429429

430430
suite = unittest.TestSuite()
431-
suite.addTest(unittest.findTestCases(tests))
431+
suite.addTest(unittest.findTestCases(test_package))
432432

433433
runner = Runner(found_suites=[suite])
434434
runner.run()

0 commit comments

Comments
 (0)
Please sign in to comment.