diff --git a/.github/workflows/pub-tools-mec-pypi.yml b/.github/workflows/pub-tools-mec-pypi.yml index 3a36d5208fd..42f96ebb352 100644 --- a/.github/workflows/pub-tools-mec-pypi.yml +++ b/.github/workflows/pub-tools-mec-pypi.yml @@ -29,4 +29,6 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: tools/model_explorer_circle/dist/ - skip-existing: true + skip-existing: false + user: __token__ + password: ${{ secrets.MEC_PYPI_API }} diff --git a/.github/workflows/run-tools-mec-build.yml b/.github/workflows/run-tools-mec-build.yml index 15c837b8e13..4c9f8eeaab3 100644 --- a/.github/workflows/run-tools-mec-build.yml +++ b/.github/workflows/run-tools-mec-build.yml @@ -26,10 +26,8 @@ jobs: test: strategy: matrix: - # TODO add more versions - python: ['3.10'] - # TODO add more platforms - platform: [ubuntu-latest] + python: ['3.10'] # ['3.10', '3.11', '3.12'] + platform: [ubuntu-latest] # [ubuntu-latest, macos-latest, windows-latest] runs-on: ${{ matrix.platform }} diff --git a/tools/model_explorer_circle/HOWTO.md b/tools/model_explorer_circle/HOWTO.md index a79c500cb39..b5154adc414 100644 --- a/tools/model_explorer_circle/HOWTO.md +++ b/tools/model_explorer_circle/HOWTO.md @@ -31,3 +31,27 @@ pytest flatc -p --gen-onefile --gen-object-api circle_schema.fbs ``` * Note: For `--gen-onefile` option, you need to use the latest version of `flatc`. (tested version = v24.3.25) + +## How to local build with nox + +Use separate virtual-env: +``` +python3 -m venv venv +source venv/bin/activate +``` + +Install tools: +``` +python3 -m pip install --upgrade nox build +``` + +To run unit tests: +``` +python3 -m nox -s tests-3.xx +``` +- where `xx` is your python version, for example `10` + +To build package: +``` +python3 -m build . +``` diff --git a/tools/model_explorer_circle/noxfile.py b/tools/model_explorer_circle/noxfile.py index 3738621d64b..9db6b7b1ecf 100644 --- a/tools/model_explorer_circle/noxfile.py +++ b/tools/model_explorer_circle/noxfile.py @@ -15,10 +15,21 @@ import os import nox +nox.options.sessions = ["lint"] + # Define the minimal nox version required to run nox.options.needs_version = ">= 2024.3.2" +@nox.session +def lint(session): + # NOTE no need to run lint, as format checker runs with yapf including this project + session.install("yapf==0.40.2") + session.run("yapf", "--verbose", "--in-place", "--recursive", "--exclude", + "src/circle_adapter/circle_schema_generated.py", "noxfile.py", "./src", + "./tests") + + @nox.session def build_and_check_dists(session): session.install("build", "check-manifest >= 0.42", "twine", "ai-edge-model-explorer",