From 93a5e3ce096c0de0345ab2dcf16e3034d916e9b7 Mon Sep 17 00:00:00 2001 From: florimondmanca Date: Sun, 6 Oct 2019 13:10:57 +0200 Subject: [PATCH 1/3] Always reuse venvs by default --- noxfile.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/noxfile.py b/noxfile.py index 747e30ef6b..ca0840dd5f 100644 --- a/noxfile.py +++ b/noxfile.py @@ -1,11 +1,12 @@ import nox nox.options.stop_on_first_error = True +nox.options.reuse_existing_virtualenvs = True source_files = ("httpx", "tools", "tests", "setup.py", "noxfile.py") -@nox.session(reuse_venv=True) +@nox.session def lint(session): session.install("autoflake", "black", "flake8", "isort", "seed-isort-config") @@ -17,7 +18,7 @@ def lint(session): check(session) -@nox.session(reuse_venv=True) +@nox.session def check(session): session.install( "black", @@ -37,9 +38,9 @@ def check(session): ) -@nox.session(reuse_venv=True) +@nox.session def docs(session): - session.install("mkdocs", "mkdocs-material") + session.install("mkdocs", "mkdocs-material", "pymdown-extensions") session.run("mkdocs", "build") From ddf8d03db686253bb6cbc059d6c33b4aaacc5ab2 Mon Sep 17 00:00:00 2001 From: florimondmanca Date: Sun, 6 Oct 2019 13:11:05 +0200 Subject: [PATCH 2/3] Update contributing guide --- docs/contributing.md | 7 +++++++ mkdocs.yml | 1 + 2 files changed, 8 insertions(+) diff --git a/docs/contributing.md b/docs/contributing.md index fb52785ffa..9d08775869 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -100,6 +100,13 @@ You can also run a single test script like this: $ nox -s test -- tests/test_multipart.py ``` +!!! tip + `nox` is configured to [reuse existing virtual environments](https://nox.thea.codes/en/stable/usage.html#re-using-virtualenvs). To force tests to run in a clean virtual environment (e.g. because dependencies have changed), use: + + ```shell + $ nox -s test --no-reuse-existing-virtualenvs + ``` + ## Documenting To work with the documentation, make sure you have `mkdocs` and diff --git a/mkdocs.yml b/mkdocs.yml index b62bc50b36..f7773d3a4d 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -22,3 +22,4 @@ nav: markdown_extensions: - admonition - codehilite + - pymdownx.superfences From dfcace8ab34ede50ac110a20b360a3fe7d8a23b0 Mon Sep 17 00:00:00 2001 From: florimondmanca Date: Wed, 9 Oct 2019 20:10:06 +0200 Subject: [PATCH 3/3] Install with --upgrade --- docs/contributing.md | 7 ------- noxfile.py | 9 ++++++--- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/docs/contributing.md b/docs/contributing.md index 9d08775869..fb52785ffa 100644 --- a/docs/contributing.md +++ b/docs/contributing.md @@ -100,13 +100,6 @@ You can also run a single test script like this: $ nox -s test -- tests/test_multipart.py ``` -!!! tip - `nox` is configured to [reuse existing virtual environments](https://nox.thea.codes/en/stable/usage.html#re-using-virtualenvs). To force tests to run in a clean virtual environment (e.g. because dependencies have changed), use: - - ```shell - $ nox -s test --no-reuse-existing-virtualenvs - ``` - ## Documenting To work with the documentation, make sure you have `mkdocs` and diff --git a/noxfile.py b/noxfile.py index ca0840dd5f..341fa7de4c 100644 --- a/noxfile.py +++ b/noxfile.py @@ -8,7 +8,9 @@ @nox.session def lint(session): - session.install("autoflake", "black", "flake8", "isort", "seed-isort-config") + session.install( + "--upgrade", "autoflake", "black", "flake8", "isort", "seed-isort-config" + ) session.run("autoflake", "--in-place", "--recursive", *source_files) session.run("seed-isort-config", "--application-directories=httpx") @@ -21,6 +23,7 @@ def lint(session): @nox.session def check(session): session.install( + "--upgrade", "black", "flake8", "flake8-bugbear", @@ -40,12 +43,12 @@ def check(session): @nox.session def docs(session): - session.install("mkdocs", "mkdocs-material", "pymdown-extensions") + session.install("--upgrade", "mkdocs", "mkdocs-material", "pymdown-extensions") session.run("mkdocs", "build") @nox.session(python=["3.6", "3.7", "3.8"]) def test(session): - session.install("-r", "test-requirements.txt") + session.install("--upgrade", "-r", "test-requirements.txt") session.run("python", "-m", "pytest", *session.posargs)