noxfile.py
This file
Path
noxfile.py
60 lines · 1.5 KiB · Python
Last changed by
Use nox for automation and CI (#128)Seth Michael Larsonbefore adoption80dc3e2
History of this fileTake it
Use nox for automation and CI (#128)Seth Michael Larsonbefore adoption80dc3e2
lines 1–60why, one step back1import nox23source_files = ("httpx", "tests", "setup.py", "noxfile.py")456@nox.session(reuse_venv=True)7def lint(session):8 session.install("autoflake", "black", "flake8", "isort", "seed-isort-config")910 session.run("autoflake", "--in-place", "--recursive", *source_files)11 session.run("seed-isort-config", "--application-directories=httpx")12 session.run(13 "isort",14 "--project=httpx",15 "--multi-line=3",16 "--trailing-comma",17 "--force-grid-wrap=0",18 "--combine-as",19 "--line-width=88",20 "--recursive",21 "--apply",22 *source_files,23 )24 session.run("black", "--target-version=py36", *source_files)2526 check(session)272829@nox.session(reuse_venv=True)30def check(session):31 session.install("black", "flake8", "flake8-bugbear", "mypy")3233 session.run("black", "--check", "--target-version=py36", *source_files)34 session.run(35 "flake8", "--max-line-length=88", "--ignore=W503,E203,B305", *source_files36 )37 session.run("mypy", "httpx", "--ignore-missing-imports", "--disallow-untyped-defs")383940@nox.session(reuse_venv=True)41def docs(session):42 session.install("mkdocs", "mkdocs-material")4344 session.run("mkdocs", "build")454647@nox.session(python=["3.6", "3.7", "3.8"])48def test(session):49 session.install("-r", "test-requirements.txt")5051 session.run(52 "coverage",53 "run",54 "--omit='*'",55 "-m",56 "pytest",57 "--cov=httpx",58 "--cov=tests",59 "--cov-report=term-missing",60 )