Skip to content

Commit

Permalink
v0.3.1 (#117)
Browse files Browse the repository at this point in the history
  • Loading branch information
aidemsined authored Sep 30, 2024
2 parents a8101fe + 71e0d85 commit 04f5945
Show file tree
Hide file tree
Showing 23 changed files with 1,402 additions and 866 deletions.
116 changes: 74 additions & 42 deletions .github/workflows/build-wheels.yml
Original file line number Diff line number Diff line change
@@ -1,49 +1,81 @@
name: Build wheel

name: Build and Upload Python Wheel on Release
on:
release:
types: [ 'created', 'edited', 'unpublished' ]
release:
types: [released, prereleased ]

env:
CIBW_BUILD_VERBOSITY: 1
VITE_API_ROOT: api
NPM_CONFIG_PRODUCTION: false

jobs:
build_wheel:
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: v22.1.0
- run: npm install
- run: npm run build

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9

- name: Build wheel and install
run: |
python -m pip install --user --upgrade build
python -m build --wheel
- uses: actions/upload-artifact@v4
with:
name: ttnn_visualizer_${{ github.sha }}
path: ./dist/*.whl

upload-wheel-release:
runs-on: ubuntu-20.04
needs:
build_wheel
steps:
- name: '📦 Upload Release'
run: |
cd ${{github.workspace}}
gh release upload ${{github.event.release.tag_name}} ttnn_visualizer_${{github.sha}}
env:
GITHUB_TOKEN: ${{ github.TOKEN }}
shell: bash
build:
name: Build Python Wheel
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: v22.1.0
- run: npm install
- run: npm run build

- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.12.3'

- name: Install build dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build wheel
run: |
python -m build --wheel
- name: Upload wheel as artifact
uses: actions/upload-artifact@v3
with:
name: python-wheel
path: dist/*.whl

release:
name: Upload Wheel to GitHub Release
runs-on: ubuntu-latest
needs: build # Depends on the build job

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Download wheel artifact
uses: actions/download-artifact@v3
with:
name: python-wheel
path: /home/runner/work/ttnn-visualizer/
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]

- name: Get wheel file name
id: get_wheel
run: |
# Find the .whl file and store its name in a variable
FILE=$(find /home/runner/work/ttnn-visualizer/ -name "*.whl" -type f)
echo "Found wheel file: $FILE"
# Set output to the found file name
echo "wheel_name=$FILE" >> $GITHUB_ENV
- name: Upload Wheel to Release
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ github.event.release.upload_url }}
asset_path: ${{ env.wheel_name }}
asset_name: ttnn-visualizer-${{ github.event.release.tag_name }}.whl
asset_content_type: application/octet-stream
4 changes: 1 addition & 3 deletions backend/ttnn_visualizer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def catch_all(path):


def extensions(app: flask.Flask):
from ttnn_visualizer.extensions import flask_static_digest, db, ma
from ttnn_visualizer.extensions import flask_static_digest

"""
Register 0 or more extensions (mutates the app passed in).
Expand All @@ -79,8 +79,6 @@ def extensions(app: flask.Flask):
:return: None
"""

db.init_app(app)
ma.init_app(app)
flask_static_digest.init_app(app)

# For automatically reflecting table data
Expand Down
14 changes: 0 additions & 14 deletions backend/ttnn_visualizer/extensions.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,4 @@
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy
from flask_static_digest import FlaskStaticDigest


class SQLiteAlchemy(SQLAlchemy):
def apply_driver_hacks(self, app, info, options):
options.update(
{
"isolation_level": "AUTOCOMMIT",
}
)
super(SQLiteAlchemy, self).apply_driver_hacks(app, info, options)


db = SQLiteAlchemy()
flask_static_digest = FlaskStaticDigest()
ma = Marshmallow()
Loading

0 comments on commit 04f5945

Please sign in to comment.