代码拉取完成,页面将自动刷新
import nox
import nox_poetry
LINT_PATHS = ["genai", "noxfile.py"]
nox.options.reuse_existing_virtualenv = True
nox.options.sessions = ["lint", "test"]
@nox_poetry.session(python=["3.8", "3.9", "3.10"])
def test(session: nox_poetry.Session):
session.run_always("poetry", "install", external=True)
session.run("pytest", "-v", "--cov=genai")
@nox_poetry.session(python="3.9")
def generate_coverage_xml(session: nox_poetry.Session):
session.install("coverage[toml]")
session.run("coverage", "xml")
@nox_poetry.session(python="3.9")
def lint(session: nox_poetry.Session):
session.notify("black_check")
session.notify("flake8")
session.notify("isort_check")
@nox_poetry.session(python="3.9")
def flake8(session: nox_poetry.Session):
session.install("flake8")
session.run("flake8", *LINT_PATHS, "--count", "--show-source", "--statistics", "--benchmark")
@nox_poetry.session(python="3.9")
def black_check(session: nox_poetry.Session):
session.install("black")
session.run("black", "--check", *LINT_PATHS)
@nox_poetry.session(python="3.9")
def isort_check(session: nox_poetry.Session):
session.install("isort")
session.run("isort", "--diff", "--profile", "black", "--check", *LINT_PATHS)
@nox_poetry.session(python="3.9")
def blacken(session: nox_poetry.Session):
session.install("black")
session.run("black", *LINT_PATHS)
@nox_poetry.session(python="3.9")
def isort_apply(session: nox_poetry.Session):
session.install("isort")
session.run("isort", *LINT_PATHS, "--profile", "black")
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。