]> git.ipfire.org Git - thirdparty/httpx.git/commitdiff
Allow serving docs via nox (#450)
authorFlorimond Manca <florimond.manca@gmail.com>
Thu, 10 Oct 2019 12:02:17 +0000 (14:02 +0200)
committerSeth Michael Larson <sethmichaellarson@gmail.com>
Thu, 10 Oct 2019 12:02:17 +0000 (07:02 -0500)
docs/contributing.md
noxfile.py

index fb52785ffaed99cf100ca3bd1b036fd2aa86a9c0..ca569e817bbde30e8f164e82ac796be1e123239a 100644 (file)
@@ -102,17 +102,12 @@ $ nox -s test -- tests/test_multipart.py
 
 ## Documenting
 
-To work with the documentation, make sure you have `mkdocs` and
-`mkdocs-material` installed on your environment:
+Documentation pages are located under the `docs/` folder.
 
-```shell
-$ pip install mkdocs mkdocs-material
-```
-
-To spawn the docs server run:
+To run the documentation site locally (useful for previewing changes), use:
 
 ```shell
-$ mkdocs serve
+$ nox -s serve
 ```
 
 ## Releasing
index 341fa7de4cf4925a2b1060cc871689d0120c8e92..acd8fce58cc7703205c07fcf78d49b610932cc06 100644 (file)
@@ -2,6 +2,7 @@ import nox
 
 nox.options.stop_on_first_error = True
 nox.options.reuse_existing_virtualenvs = True
+nox.options.keywords = "not serve"
 
 source_files = ("httpx", "tools", "tests", "setup.py", "noxfile.py")
 
@@ -48,6 +49,13 @@ def docs(session):
     session.run("mkdocs", "build")
 
 
+@nox.session(reuse_venv=True)
+def serve(session):
+    session.install("--upgrade", "mkdocs", "mkdocs-material")
+
+    session.run("mkdocs", "serve")
+
+
 @nox.session(python=["3.6", "3.7", "3.8"])
 def test(session):
     session.install("--upgrade", "-r", "test-requirements.txt")