File tree Expand file tree Collapse file tree 9 files changed +147
-3
lines changed
Expand file tree Collapse file tree 9 files changed +147
-3
lines changed Original file line number Diff line number Diff line change 1+ [codespell]
2+ skip = **/package-lock.json
Original file line number Diff line number Diff line change 1+ [flake8]
2+
3+ # Just assume black did a good job with the line lengths
4+ ignore =
5+ E501
6+
7+ per-file-ignores =
8+ # These directories will always contain "from ... import *"
9+ trame/*:F401,F403
Original file line number Diff line number Diff line change 1+ name : Test and Release
2+
3+ on :
4+ push :
5+ branches : [ master ]
6+ pull_request :
7+ branches : [ master ]
8+
9+ jobs :
10+ pre-commit :
11+ runs-on : ubuntu-latest
12+ steps :
13+ - uses : actions/checkout@v2
14+
15+ - uses : actions/setup-python@v2
16+ with :
17+ python-version : " 3.9"
18+
19+ # Install and run pre-commit
20+ - run : |
21+ pip install pre-commit
22+ pre-commit install
23+ pre-commit run --all-files
24+
25+ pytest :
26+ name : Pytest ${{ matrix.config.name }}
27+ runs-on : ${{ matrix.config.os }}
28+ strategy :
29+ fail-fast : false
30+ matrix :
31+ python-version : [3.9]
32+ config :
33+ - {
34+ name : " Linux" ,
35+ os : ubuntu-latest
36+ }
37+ - {
38+ name : " MacOSX" ,
39+ os : macos-latest
40+ }
41+ - {
42+ name : " Windows" ,
43+ os : windows-latest
44+ }
45+
46+ defaults :
47+ run :
48+ shell : bash
49+
50+ steps :
51+ - name : Checkout
52+ uses : actions/checkout@v2
53+
54+ - name : Set up Python ${{ matrix.python-version }}
55+ uses : actions/setup-python@v2
56+ with :
57+ python-version : ${{ matrix.python-version }}
58+
59+ - name : Install and Run Tests
60+ run : |
61+ pip install .
62+ pip install -r tests/requirements.txt
63+ pytest -s ./tests
64+
65+ test-npm-build :
66+ runs-on : ubuntu-latest
67+
68+ steps :
69+ - name : Checkout
70+ uses : actions/checkout@v2
71+
72+ - name : Set Up Node
73+ uses : actions/setup-node@v3
74+ with :
75+ node-version : 14
76+
77+ - name : Build Vue Components
78+ run : |
79+ cd vue-components
80+ npm ci
81+ npm run build
82+
83+ release :
84+ needs : [pre-commit, pytest, test-npm-build]
85+ runs-on : ubuntu-latest
86+ if : github.event_name == 'push'
87+
88+ steps :
89+ - name : Checkout
90+ uses : actions/checkout@v2
91+ with :
92+ fetch-depth : 0
93+
94+ - name : Set Up Node
95+ uses : actions/setup-node@v3
96+ with :
97+ node-version : 14
98+
99+ - name : Build Vue Components
100+ run : |
101+ cd vue-components
102+ npm ci
103+ npm run build
104+
105+ - name : Python Semantic Release
106+ 107+ with :
108+ github_token : ${{ secrets.GITHUB_TOKEN }}
109+ repository_username : __token__
110+ repository_password : ${{ secrets.PYPI_API_TOKEN }}
Original file line number Diff line number Diff line change 1+ repos :
2+ - repo : https://github.com/psf/black
3+ rev : 22.3.0
4+ hooks :
5+ - id : black
6+ entry : black --check
7+
8+ - repo : https://github.com/codespell-project/codespell
9+ rev : v2.1.0
10+ hooks :
11+ - id : codespell
12+
13+ - repo : https://github.com/PyCQA/flake8
14+ rev : 4.0.1
15+ hooks :
16+ - id : flake8
Original file line number Diff line number Diff line change @@ -57,5 +57,5 @@ Using the component method
5757
5858 fig, ax = plt.subplots(** figure_size)
5959
60- widget = matplotlib.Figure(figure = None ) # could pass fig at constrution
60+ widget = matplotlib.Figure(figure = None ) # could pass fig at construction
6161 widget.update(fig)
Original file line number Diff line number Diff line change 11[metadata]
22name = trame-matplotlib
3- version = 2.0.0rc6
3+ version = 2.0.0
44description = Markdown widget for trame
55long_description = file: README.rst
66long_description_content_type = text/x-rst
@@ -28,3 +28,6 @@ packages = find:
2828include_package_data = True
2929install_requires =
3030 trame-client
31+
32+ [semantic_release]
33+ version_pattern = setup.cfg:version = (\d+\.\d+\.\d+)
Original file line number Diff line number Diff line change 1+ pytest
Original file line number Diff line number Diff line change 1+ def test_import ():
2+ from trame .widgets .matplotlib import Figure # noqa: F401
Original file line number Diff line number Diff line change 44
55try :
66 import mpld3
7- except :
7+ except ImportError :
88 print (
99 "\n mpld3 is missing, if you want your matplotlib figure to work install it\n $ pip install mpld3\n "
1010 )
@@ -34,6 +34,7 @@ class Figure(AbstractElement):
3434 >>> component2 = Figure()
3535 >>> component2.update(fig1)
3636 """
37+
3738 _next_id = 0
3839
3940 def __init__ (self , figure = None , ** kwargs ):
You can’t perform that action at this time.
0 commit comments