-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
23 changed files
with
1,402 additions
and
866 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
Oops, something went wrong.