Skip to content
Myr

noxfile.py

This file

Path

noxfile.py

62 lines · 1.6 KiB · Python

Last changed by

First pass at autodoc support (#464)Tom Christiebefore adoption1ce3cc3

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

Allow serving docs via nox (#450)Florimond Mancabefore adoption65b8593

line 5why, one step back
5nox.options.keywords = "not serve"

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

line 6why, one step back
6

Add tool for profiling (#364)Florimond Mancabefore adoptione1da6b9

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

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

lines 8–9why, one step back
8
9

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

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

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

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

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

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

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

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

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

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

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

lines 19–23why, one step back
19 session.run("black", "--target-version=py36", *source_files)
2021 check(session)2223

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

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

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

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

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

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

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

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

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

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

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

line 35why, one step back
35 )

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

line 36why, one step back
36

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

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

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

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

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

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

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

lines 43–44why, one step back
43
44

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

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

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

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

First pass at autodoc support (#464)Tom Christiebefore adoption1ce3cc3

lines 47–48why, one step back
47 session.install("--upgrade", "mkdocs", "mkdocs-material", "mkautodoc>=0.1.0")
48 session.install("-e", ".")

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

line 49why, one step back
49 session.run("mkdocs", "build")

Allow serving docs via nox (#450)Florimond Mancabefore adoption65b8593

lines 50–56why, one step back
50
5152@nox.session(reuse_venv=True)53def serve(session):54 session.install("--upgrade", "mkdocs", "mkdocs-material")5556 session.run("mkdocs", "serve")

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

lines 57–60why, one step back
57
5859@nox.session(python=["3.6", "3.7", "3.8"])60def test(session):

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

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

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

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