Skip to content
Myr

noxfile.py

This file

Path

noxfile.py

55 lines · 1.6 KiB · Python

Last changed by

Fix redirect cookie behavior (#529)Tom Christiebefore adoption5aca0c0

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(

Fix redirect cookie behavior (#529)Tom Christiebefore adoption5aca0c0

line 27why, one step back
27 "--upgrade", "black", "flake8", "flake8-bugbear", "flake8-pie", "isort", "mypy"

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

line 28why, one step back
28 )

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

line 29why, one step back
29

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

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

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

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

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

lines 33–35why, one step back
33 session.run(
34 "isort", "--check", "--diff", "--project=httpx", "--recursive", *source_files35 )

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

lines 36–37why, one step back
36
37

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

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

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

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

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

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

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

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

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

lines 43–49why, one step back
43
4445@nox.session(reuse_venv=True)46def serve(session):47 session.install("--upgrade", "mkdocs", "mkdocs-material")4849 session.run("mkdocs", "serve")

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

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

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

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

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

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