← Back to team overview

launchpad-reviewers team mailing list archive

[Merge] ~lgp171188/lpcraft:update-contributing-docs into lpcraft:main

 

Guruprasad has proposed merging ~lgp171188/lpcraft:update-contributing-docs into lpcraft:main.

Commit message:
Add the tox usage details to CONTRIBUTING.rst

Requested reviews:
  Launchpad code reviewers (launchpad-reviewers)

For more details, see:
https://code.launchpad.net/~lgp171188/lpcraft/+git/lpcraft/+merge/416722
-- 
Your team Launchpad code reviewers is requested to review the proposed merge of ~lgp171188/lpcraft:update-contributing-docs into lpcraft:main.
diff --git a/CONTRIBUTING.rst b/CONTRIBUTING.rst
index ead4dcd..451cea0 100644
--- a/CONTRIBUTING.rst
+++ b/CONTRIBUTING.rst
@@ -1,15 +1,74 @@
 Developing
 ==========
 
-To run this project's tests, use `tox <https://tox.readthedocs.io/en/latest/>`_.
+Prerequisites
+-------------
 
-To update the `project's documentation
-<https://lpcraft.readthedocs.io/en/latest/>`_ you need to trigger a manual
-build on the project's dashboard on https://readthedocs.org.
+* Python 3.8+
+* `tox <https://tox.readthedocs.io/en/latest/>`_.
+
+Usage
+-----
+
+Install the ``lpcraft`` project in editable mode inside a virtualenv environment named ``venv``.
+
+  .. code:: bash
+
+    $ tox --devenv venv
+    $ venv/bin/lpcraft --help  # Alternatively, you can activate the virtualenv environment.
+
+List the ``tox`` environments available for this project.
+
+  .. code:: bash
+
+    $ tox -l
+    lint
+    mypy
+    py38
+    py39
+    py310
+
+Run the project's tests.
+
+  .. code:: bash
+
+    $ tox -e py38  #  Replace with the installed python version, if 3.8 is unavailable.
+
+Run the tests with coverage.
+
+  .. code:: bash
 
-If you need to modify ``requirements.in``, run ``tox -e pip-compile``
-afterwards to regenerate ``requirements.txt``.
+    $ tox -e coverage
 
+Run the linter.
+
+  .. code:: bash
+
+    $ tox -e lint
+
+Alternatively, you can run ``pre-commit install`` to install the git pre-commit hooks,
+which run the linter.
+
+Run the ``mypy`` static type checker.
+
+  .. code:: bash
+
+    $ tox -e mypy
+
+Update the requirements and regenerate ``requirements.txt``.
+
+  .. code:: bash
+
+    $ <modify requirements.in>
+    $ tox -e pip-compile
+
+If any of the ``tox`` environments use a version of Python that is not installed, edit
+``tox.ini`` and replace it with the installed version in the ``basepython`` key
+under the environment.
+
+To update the `project's documentation
+<https://lpcraft.readthedocs.io/en/latest/>`_, you need to trigger a manual
+build on the project's dashboard on https://readthedocs.org.
 
 Getting help
 ------------