summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiampaolo Rodola <g.rodola@gmail.com>2017-11-18 03:13:21 +0100
committerGiampaolo Rodola <g.rodola@gmail.com>2017-11-18 03:13:21 +0100
commitd56f2a9dcc8b532b0f0d4bda78aa2f227d38a2d1 (patch)
tree678b4f47e8c5af5a6ebc676bf6ced0e7ca65fef6
parenta7e7b4e83f66576f507ca5fa2759f092cffc18b7 (diff)
downloadpsutil-d56f2a9dcc8b532b0f0d4bda78aa2f227d38a2d1.tar.gz
syntax highlight in doc files
-rw-r--r--DEVGUIDE.rst56
1 files changed, 37 insertions, 19 deletions
diff --git a/DEVGUIDE.rst b/DEVGUIDE.rst
index 3892e75e..2d48ced2 100644
--- a/DEVGUIDE.rst
+++ b/DEVGUIDE.rst
@@ -6,15 +6,21 @@ If you plan on hacking on psutil this is what you're supposed to do first:
- clone the GIT repository:
+.. code-block:: bash
+
$ git clone git@github.com:giampaolo/psutil.git
-- install test deps and GIT hooks::
+- install test deps and GIT hooks:
+
+.. code-block:: bash
+
+ make setup-dev-env
- $ make setup-dev-env
+- run tests:
-- run tests::
+.. code-block:: bash
- $ make test
+ make test
- bear in mind that ``make``
(see `Makefile <https://github.com/giampaolo/psutil/blob/master/Makefile>`_)
@@ -38,34 +44,46 @@ Coding style
Makefile
========
-Some useful make commands::
+Some useful make commands:
+
+.. code-block:: bash
- $ make install # install
- $ make setup-dev-env # install useful dev libs (pyflakes, unittest2, etc.)
- $ make test # run unit tests
- $ make test-memleaks # run memory leak tests
- $ make test-coverage # run test coverage
- $ make flake8 # run PEP8 linter
+ make install # install
+ make setup-dev-env # install useful dev libs (pyflakes, unittest2, etc.)
+ make test # run unit tests
+ make test-memleaks # run memory leak tests
+ make test-coverage # run test coverage
+ make flake8 # run PEP8 linter
There are some differences between ``make`` on UNIX and Windows.
-For instance, to run a specific Python version. On UNIX::
+For instance, to run a specific Python version. On UNIX:
+
+.. code-block:: bash
make test PYTHON=python3.5
-On Windows::
+On Windows:
+
+.. code-block:: bat
set PYTHON=C:\python35\python.exe && make test
- # ...or:
+...or:
+
+.. code-block:: bat
make -p 35 test
If you want to modify psutil and run a script on the fly which uses it do
-(on UNIX)::
+(on UNIX):
+
+.. code-block:: bash
make test TSCRIPT=foo.py
-On Windows::
+On Windows:
+
+.. code-block:: bat
set TSCRIPT=foo.py && make test
@@ -75,7 +93,7 @@ Adding a new feature
Usually the files involved when adding a new functionality are:
-.. code-block:: plain
+.. code-block:: bash
psutil/__init__.py # main psutil namespace
psutil/_ps{platform}.py # python platform wrapper
@@ -185,7 +203,7 @@ FreeBSD notes
.. code-block:: bash
- $ pkg install python python3 gcc git vim screen bash
- $ chsh -s /usr/local/bin/bash user # set bash as default shell
+ pkg install python python3 gcc git vim screen bash
+ chsh -s /usr/local/bin/bash user # set bash as default shell
- ``/usr/src`` contains the source codes for all installed CLI tools (grep in it).