Skip to content
Myr

noxfile.py

This file

Path

noxfile.py

54 lines · 1.4 KiB · Python

Last changed by

Make nox always reuse virtualenvs by default (#460)Florimond Mancabefore adoption7361d60

History of this file

Take it

Use nox for automation and CI (#128)Seth Michael Larsonbefore adoption80dc3e2

lines 1–2why, one step back
1import nox
2

Stop running nox on first error (#286)Jt Miclatbefore adoption33032df

line 3why, one step back
3nox.options.stop_on_first_error = True

Make nox always reuse virtualenvs by default (#460)Florimond Mancabefore adoption7361d60

line 4why, one step back
4nox.options.reuse_existing_virtualenvs = True

Stop running nox on first error (#286)Jt Miclatbefore adoption33032df

line 5why, one step back
5

Add tool for profiling (#364)Florimond Mancabefore adoptione1da6b9

line 6why, one step back
6source_files = ("httpx", "tools", "tests", "setup.py", "noxfile.py")

Use nox for automation and CI (#128)Seth Michael Larsonbefore adoption80dc3e2

lines 7–8why, one step back
7
8

Make nox always reuse virtualenvs by default (#460)Florimond Mancabefore adoption7361d60

line 9why, one step back
9@nox.session

Use nox for automation and CI (#128)Seth Michael Larsonbefore adoption80dc3e2

line 10why, one step back
10def lint(session):

Make nox always reuse virtualenvs by default (#460)Florimond Mancabefore adoption7361d60

lines 11–13why, one step back
11 session.install(
12 "--upgrade", "autoflake", "black", "flake8", "isort", "seed-isort-config"13 )

Use nox for automation and CI (#128)Seth Michael Larsonbefore adoption80dc3e2

lines 14–16why, one step back
14
15 session.run("autoflake", "--in-place", "--recursive", *source_files)16 session.run("seed-isort-config", "--application-directories=httpx")

Move all tooling configuration to setup.cfg (#204)Humberto Rochabefore adoptione51b212

line 17why, one step back
17 session.run("isort", "--project=httpx", "--recursive", "--apply", *source_files)

Use nox for automation and CI (#128)Seth Michael Larsonbefore adoption80dc3e2

lines 18–22why, one step back
18 session.run("black", "--target-version=py36", *source_files)
1920 check(session)2122

Make nox always reuse virtualenvs by default (#460)Florimond Mancabefore adoption7361d60

line 23why, one step back
23@nox.session

Use nox for automation and CI (#128)Seth Michael Larsonbefore adoption80dc3e2

line 24why, one step back
24def check(session):

Add flake8-comprehensions to nox check task (#200)Can Sarıgölbefore adoption1b82d63

line 25why, one step back
25 session.install(

Make nox always reuse virtualenvs by default (#460)Florimond Mancabefore adoption7361d60

line 26why, one step back
26 "--upgrade",

Add flake8-pie plugin (#419)Stephen Brown IIbefore adoptiondb3e3a0

lines 27–33why, one step back
27 "black",
28 "flake8",29 "flake8-bugbear",30 "flake8-comprehensions",31 "flake8-pie",32 "isort",33 "mypy",

Add flake8-comprehensions to nox check task (#200)Can Sarıgölbefore adoption1b82d63

line 34why, one step back
34 )

Use nox for automation and CI (#128)Seth Michael Larsonbefore adoption80dc3e2

line 35why, one step back
35

Add --diff flag to Black for easier debugging (#219)euri10before adoptione64fcad

line 36why, one step back
36 session.run("black", "--check", "--diff", "--target-version=py36", *source_files)

Move all tooling configuration to setup.cfg (#204)Humberto Rochabefore adoptione51b212

lines 37–38why, one step back
37 session.run("flake8", *source_files)
38 session.run("mypy", "httpx")

Run isort in the nox check session (#379)Jamie Hewlandbefore adoption276ee73

lines 39–41why, one step back
39 session.run(
40 "isort", "--check", "--diff", "--project=httpx", "--recursive", *source_files41 )

Use nox for automation and CI (#128)Seth Michael Larsonbefore adoption80dc3e2

lines 42–43why, one step back
42
43

Make nox always reuse virtualenvs by default (#460)Florimond Mancabefore adoption7361d60

line 44why, one step back
44@nox.session

Use nox for automation and CI (#128)Seth Michael Larsonbefore adoption80dc3e2

line 45why, one step back
45def docs(session):

Make nox always reuse virtualenvs by default (#460)Florimond Mancabefore adoption7361d60

line 46why, one step back
46 session.install("--upgrade", "mkdocs", "mkdocs-material", "pymdown-extensions")

Use nox for automation and CI (#128)Seth Michael Larsonbefore adoption80dc3e2

lines 47–52why, one step back
47
48 session.run("mkdocs", "build")495051@nox.session(python=["3.6", "3.7", "3.8"])52def test(session):

Make nox always reuse virtualenvs by default (#460)Florimond Mancabefore adoption7361d60

line 53why, one step back
53 session.install("--upgrade", "-r", "test-requirements.txt")

Allow per file running of tests (#287)Jt Miclatbefore adoption1f4b8dd

line 54why, one step back
54 session.run("python", "-m", "pytest", *session.posargs)