diff options
-rw-r--r-- | DEVGUIDE.rst | 11 | ||||
-rw-r--r-- | INSTALL.rst | 3 | ||||
-rw-r--r-- | Makefile | 6 |
3 files changed, 14 insertions, 6 deletions
diff --git a/DEVGUIDE.rst b/DEVGUIDE.rst index 5e374837..ebd919ab 100644 --- a/DEVGUIDE.rst +++ b/DEVGUIDE.rst @@ -16,9 +16,13 @@ If you plan on hacking on psutil this is what you're supposed to do first: $ make setup-dev-env - bear in mind that ``make`` (see `Makefile <https://github.com/giampaolo/psutil/blob/master/Makefile>`_) - is the designated tool to run tests, build etc. and that it is also available - on Windows (see `make.bat <https://github.com/giampaolo/psutil/blob/master/make.bat>`_). -- (UNIX only) run ``make install-git-hooks``: this will reject your commit + is the designated tool to run tests, build, install etc. and that it is also + available on Windows + (see `make.bat <https://github.com/giampaolo/psutil/blob/master/make.bat>`_). +- bear in mind that both psutil (``make install``) and any other lib + (``make setup-dev-env``) is installed as a limited user + (``pip install --user ...``), so develop as such (don't use root). +- (UNIX only) run ``make install-git-hooks``: this will reject your commits if python code is not PEP8 compliant. - run ``make test`` to run tests. @@ -38,6 +42,7 @@ Makefile Some useful make commands:: $ make install # install + $ make setup-dev-env # install useful dev libs (pyflakes, unittest2, etc.) $ make test # run all tests $ make test-memleaks # run memory leak tests $ make coverage # run test coverage diff --git a/INSTALL.rst b/INSTALL.rst index b696ffa3..05bbc9c3 100644 --- a/INSTALL.rst +++ b/INSTALL.rst @@ -1,7 +1,8 @@ *Note: pip is the easiest way to install psutil. It is shipped by default with Python 2.7.9+ and 3.4+. If you're using an older Python version* `install pip <https://pip.pypa.io/en/latest/installing/>`__ -*first.* +*first.* If you cloned psutil source code you can also install it with +``make install-pip``. Permission issues ================= @@ -59,8 +59,7 @@ install: build uninstall: cd ..; $(PYTHON) -m pip uninstall -y -v psutil -# Install useful deps which are nice to have while developing / testing. -setup-dev-env: install-git-hooks +install-pip: # Install PIP (only if necessary). $(PYTHON) -c "import sys, ssl, os, pkgutil, tempfile, atexit; \ sys.exit(0) if pkgutil.find_loader('pip') else None; \ @@ -77,6 +76,9 @@ setup-dev-env: install-git-hooks print('downloaded %s' % f.name); \ code = os.system('%s %s --user' % (sys.executable, f.name)); \ sys.exit(code);" + +# Install useful deps which are nice to have while developing / testing. +setup-dev-env: install-git-hooks install-pip $(PYTHON) -m pip install --user --upgrade pip $(PYTHON) -m pip install --user --upgrade $(DEPS) |