Skip to content

Commit 04f5945

Browse files
authored
v0.3.1 (#117)
2 parents a8101fe + 71e0d85 commit 04f5945

23 files changed

+1402
-866
lines changed

.github/workflows/build-wheels.yml

Lines changed: 74 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,81 @@
1-
name: Build wheel
2-
1+
name: Build and Upload Python Wheel on Release
32
on:
4-
release:
5-
types: [ 'created', 'edited', 'unpublished' ]
3+
release:
4+
types: [released, prereleased ]
65

76
env:
87
CIBW_BUILD_VERBOSITY: 1
98
VITE_API_ROOT: api
9+
NPM_CONFIG_PRODUCTION: false
1010

1111
jobs:
12-
build_wheel:
13-
runs-on: ubuntu-20.04
14-
steps:
15-
- uses: actions/checkout@v2
16-
- name: Use Node.js
17-
uses: actions/setup-node@v3
18-
with:
19-
node-version: v22.1.0
20-
- run: npm install
21-
- run: npm run build
22-
23-
- name: Set up Python
24-
uses: actions/setup-python@v2
25-
with:
26-
python-version: 3.9
27-
28-
- name: Build wheel and install
29-
run: |
30-
python -m pip install --user --upgrade build
31-
python -m build --wheel
32-
33-
- uses: actions/upload-artifact@v4
34-
with:
35-
name: ttnn_visualizer_${{ github.sha }}
36-
path: ./dist/*.whl
37-
38-
upload-wheel-release:
39-
runs-on: ubuntu-20.04
40-
needs:
41-
build_wheel
42-
steps:
43-
- name: '📦 Upload Release'
44-
run: |
45-
cd ${{github.workspace}}
46-
gh release upload ${{github.event.release.tag_name}} ttnn_visualizer_${{github.sha}}
47-
env:
48-
GITHUB_TOKEN: ${{ github.TOKEN }}
49-
shell: bash
12+
build:
13+
name: Build Python Wheel
14+
runs-on: ubuntu-latest
15+
16+
steps:
17+
- name: Checkout code
18+
uses: actions/checkout@v3
19+
- name: Use Node.js
20+
uses: actions/setup-node@v3
21+
with:
22+
node-version: v22.1.0
23+
- run: npm install
24+
- run: npm run build
25+
26+
- name: Set up Python
27+
uses: actions/setup-python@v4
28+
with:
29+
python-version: '3.12.3'
30+
31+
- name: Install build dependencies
32+
run: |
33+
python -m pip install --upgrade pip
34+
pip install build
35+
36+
- name: Build wheel
37+
run: |
38+
python -m build --wheel
39+
40+
- name: Upload wheel as artifact
41+
uses: actions/upload-artifact@v3
42+
with:
43+
name: python-wheel
44+
path: dist/*.whl
45+
46+
release:
47+
name: Upload Wheel to GitHub Release
48+
runs-on: ubuntu-latest
49+
needs: build # Depends on the build job
50+
51+
steps:
52+
- name: Checkout code
53+
uses: actions/checkout@v3
54+
55+
- name: Download wheel artifact
56+
uses: actions/download-artifact@v3
57+
with:
58+
name: python-wheel
59+
path: /home/runner/work/ttnn-visualizer/
60+
- name: get-npm-version
61+
id: package-version
62+
uses: martinbeentjes/[email protected]
63+
64+
- name: Get wheel file name
65+
id: get_wheel
66+
run: |
67+
# Find the .whl file and store its name in a variable
68+
FILE=$(find /home/runner/work/ttnn-visualizer/ -name "*.whl" -type f)
69+
echo "Found wheel file: $FILE"
70+
# Set output to the found file name
71+
echo "wheel_name=$FILE" >> $GITHUB_ENV
72+
73+
- name: Upload Wheel to Release
74+
uses: actions/upload-release-asset@v1
75+
env:
76+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77+
with:
78+
upload_url: ${{ github.event.release.upload_url }}
79+
asset_path: ${{ env.wheel_name }}
80+
asset_name: ttnn-visualizer-${{ github.event.release.tag_name }}.whl
81+
asset_content_type: application/octet-stream

backend/ttnn_visualizer/app.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def catch_all(path):
7070

7171

7272
def extensions(app: flask.Flask):
73-
from ttnn_visualizer.extensions import flask_static_digest, db, ma
73+
from ttnn_visualizer.extensions import flask_static_digest
7474

7575
"""
7676
Register 0 or more extensions (mutates the app passed in).
@@ -79,8 +79,6 @@ def extensions(app: flask.Flask):
7979
:return: None
8080
"""
8181

82-
db.init_app(app)
83-
ma.init_app(app)
8482
flask_static_digest.init_app(app)
8583

8684
# For automatically reflecting table data

backend/ttnn_visualizer/extensions.py

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,4 @@
1-
from flask_marshmallow import Marshmallow
2-
from flask_sqlalchemy import SQLAlchemy
31
from flask_static_digest import FlaskStaticDigest
42

53

6-
class SQLiteAlchemy(SQLAlchemy):
7-
def apply_driver_hacks(self, app, info, options):
8-
options.update(
9-
{
10-
"isolation_level": "AUTOCOMMIT",
11-
}
12-
)
13-
super(SQLiteAlchemy, self).apply_driver_hacks(app, info, options)
14-
15-
16-
db = SQLiteAlchemy()
174
flask_static_digest = FlaskStaticDigest()
18-
ma = Marshmallow()

0 commit comments

Comments
 (0)