Skip to content

Commit

Permalink
[tools/mec] Introduce noxfile
Browse files Browse the repository at this point in the history
This will introduce initial noxfile script for package generation and unit testing with nox.

ONE-DCO-1.0-Signed-off-by: SaeHie Park <[email protected]>
  • Loading branch information
seanshpark committed Nov 22, 2024
1 parent c72c89a commit b15cde2
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions tools/model_explorer_circle/noxfile.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# Copyright (c) 2024 Samsung Electronics Co., Ltd. All Rights Reserved
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

import os
import nox

# Define the minimal nox version required to run
nox.options.needs_version = ">= 2024.3.2"


@nox.session
def build_and_check_dists(session):
session.install("build", "check-manifest >= 0.42", "twine", "ai-edge-model-explorer",
"flatbuffers")

session.run("check-manifest", "--ignore", "noxfile.py,tests/**")
session.run("python", "-m", "build")
session.run("python", "-m", "twine", "check", "dist/*")


@nox.session(python=["3.10"])
def tests(session):
session.install("pytest")

build_and_check_dists(session)

generated_files = os.listdir("dist/")
generated_sdist = os.path.join("dist/", generated_files[1])

session.install(generated_sdist)

session.run("py.test", "tests/", *session.posargs)

0 comments on commit b15cde2

Please sign in to comment.