3 Star 7 Fork 4

Gitee 极速下载/pywhat

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
此仓库是为了提升国内下载速度的镜像仓库,每日同步一次。 原始仓库: https://github.com/bee-san/pyWhat
克隆/下载
noxfile.py 1.91 KB
一键复制 编辑 原始数据 按行查看 历史
SkeletalDemise 提交于 2021-10-20 16:48 . Use the Flake8 Pytest plugin
"""Nox sessions."""
from os import environ
from typing import Any
import nox
from nox.sessions import Session
nox.options.sessions = ["tests"]
if environ.get("CI", None) == "true":
nox.options.sessions.append("coverage")
locations = "src", "tests", "noxfile.py", "docs/conf.py"
def install_with_constraints(session: Session, *args: str, **kwargs: Any) -> None:
"""Install packages constrained by Poetry's lock file.
This function is a wrapper for nox.sessions.Session.install. It
invokes pip to install packages inside of the session's virtualenv.
Additionally, pip is passed a constraints file generated from
Poetry's lock file, to ensure that the packages are pinned to the
versions specified in poetry.lock. This allows you to manage the
packages as Poetry development dependencies.
Arguments:
session: The Session object.
args: Command-line arguments for pip.
kwargs: Additional keyword arguments for Session.install.
"""
session.run(
"poetry",
"export",
"--without-hashes",
"--dev",
"--format=requirements.txt",
"--output=requirements.txt",
external=True,
)
session.install("--constraint=requirements.txt", *args, **kwargs)
@nox.session
def tests(session: Session) -> None:
"""Run the test suite."""
session.run("poetry", "install", "--no-dev", external=True)
install_with_constraints(
session,
"pytest",
"pytest-black",
"pytest-cov",
"pytest-isort",
"pytest-flake8",
"pytest-mypy",
"types-requests",
"types-orjson",
)
session.run("pytest", "--cov=./", "--cov-report=xml")
@nox.session
def coverage(session: Session) -> None:
"""Upload coverage data."""
install_with_constraints(session, "codecov")
session.run("codecov", "--env", "OS", "PYTHON")
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/mirrors/pywhat.git
git@gitee.com:mirrors/pywhat.git
mirrors
pywhat
pywhat
main

搜索帮助