Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
giampaolo committed Feb 27, 2019
1 parent 84f0d95 commit e8bd07f
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 57 deletions.
21 changes: 0 additions & 21 deletions DEVGUIDE.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
=======================
Setup and running tests
=======================

Expand Down Expand Up @@ -31,7 +30,6 @@ If you plan on hacking on psutil this is what you're supposed to do first:
"edit" mode; also ``make setup-dev-env`` installs deps as a limited user.
- use `make help` to see the list of available commands.

============
Coding style
============

Expand All @@ -40,7 +38,6 @@ Coding style
- C code strictly follows `PEP 7 <https://www.python.org/dev/peps/pep-0007/>`_
styling guides.

========
Makefile
========

Expand Down Expand Up @@ -87,7 +84,6 @@ On Windows:
set TSCRIPT=foo.py && make test
====================
Adding a new feature
====================

Expand Down Expand Up @@ -120,7 +116,6 @@ Typical process occurring when adding a new functionality (API):
- update ``README.rst`` (if necessary).
- make a pull request.

===================
Make a pull request
===================

Expand All @@ -130,7 +125,6 @@ Make a pull request
- push to the branch (``git push origin my-new-feature``)
- create a new pull request

======================
Continuous integration
======================

Expand Down Expand Up @@ -175,7 +169,6 @@ An icon in the home page (README) always shows the last coverage percentage:
:target: https://coveralls.io/github/giampaolo/psutil?branch=master
:alt: Test coverage (coverall.io)

=============
Documentation
=============

Expand All @@ -185,7 +178,6 @@ Documentation
- doc can be built with ``make setup-dev-env; cd docs; make html``.
- public doc is hosted on http://psutil.readthedocs.io/

=======================
Releasing a new version
=======================

Expand All @@ -194,16 +186,3 @@ These are notes for myself (Giampaolo):
- ``make release``
- post announce (``make print-announce``) on psutil and python-announce mailing
lists, twitter, g+, blog.

=============
FreeBSD notes
=============

- setup:

.. code-block:: bash
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).
33 changes: 16 additions & 17 deletions INSTALL.rst
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
Install pip
===========

pip is the easiest way to install psutil.
It is shipped by default with Python 2.7.9+ and 3.4+. For other Python versions
you can install it manually.
pip is the easiest way to install psutil. It is shipped by default with Python
2.7.9+ and 3.4+. For other Python versions you can install it manually.
On Linux or via wget:

.. code-block:: bash
Expand Down Expand Up @@ -74,34 +73,34 @@ first, then:
Windows
=======

The easiest way to install psutil on Windows is to just use the pre-compiled
exe/wheel installers hosted on
`PyPI <https://pypi.org/project/psutil/#files>`__ via pip:
Open a cmd.exe shell and run:

.. code-block:: bat
.. code-block::
python -m pip install psutil
C:\Python27\python.exe -m pip install psutil
This assumes "python" is in your PATH. If not, specify the full python.exe
path.

If you want to compile psutil from sources you'll need **Visual Studio**
(Mingw32 is no longer supported), which really is a mess.
The VS versions are the onle listed below.
In order to compile psutil from sources you'll need **Visual Studio** (Mingw32
is not supported).
This `blog post <https://blog.ionelmc.ro/2014/12/21/compiling-python-extensions-on-windows/>`__
provides numerous info on how to properly set up VS (good luck with that).
provides numerous info on how to properly set up VS. The needed VS versions are:

* Python 2.6, 2.7: `VS-2008 <http://www.microsoft.com/en-us/download/details.aspx?id=44266>`__
* Python 3.4: `VS-2010 <http://www.visualstudio.com/downloads/download-visual-studio-vs#d-2010-express>`__
* Python 3.5+: `VS-2015 <http://www.visualstudio.com/en-au/news/vs2015-preview-vs>`__

Compiling 64 bit versions of Python 2.6 and 2.7 with VS 2008 requires
`Windows SDK and .NET Framework 3.5 SP1 <https://www.microsoft.com/en-us/download/details.aspx?id=3138>`__.
Once installed run vcvars64.bat, then you can finally compile (see
`here <http://stackoverflow.com/questions/11072521/>`__).
To compile / install psutil from sources on Windows run:
Once installed run `vcvars64.bat`
(see `here <http://stackoverflow.com/questions/11072521/>`__).
Once VS is setup open a cmd.exe shell, cd into psutil directory and run:

.. code-block:: bat
make.bat build
make.bat install
python setup.py build
python setup.py install
FreeBSD
=======
Expand Down
26 changes: 10 additions & 16 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ psutil currently supports the following platforms:

- **Linux**
- **Windows**
- **macOS**,
- **macOS**
- **FreeBSD, OpenBSD**, **NetBSD**
- **Sun Solaris**
- **AIX**
Expand Down Expand Up @@ -139,7 +139,7 @@ Example usages
This represents pretty much the whole psutil API.

CPU
===
---

.. code-block:: python
Expand Down Expand Up @@ -182,7 +182,7 @@ CPU
>>>
Memory
======
------

.. code-block:: python
Expand All @@ -193,7 +193,7 @@ Memory
>>>
Disks
=====
-----

.. code-block:: python
Expand All @@ -209,7 +209,7 @@ Disks
>>>
Network
=======
-------
.. code-block:: python
Expand All @@ -236,7 +236,7 @@ Network
>>>
Sensors
=======
-------
.. code-block:: python
Expand All @@ -255,7 +255,7 @@ Sensors
>>>
Other system info
=================
-----------------
.. code-block:: python
Expand All @@ -269,7 +269,7 @@ Other system info
>>>
Process management
==================
------------------
.. code-block:: python
Expand Down Expand Up @@ -405,7 +405,7 @@ Process management
>>>
Further process APIs
====================
--------------------
.. code-block:: python
Expand Down Expand Up @@ -446,7 +446,7 @@ Popen wrapper:
>>>
Windows services
================
----------------
.. code-block:: python
Expand All @@ -466,9 +466,3 @@ Windows services
'start_type': 'manual',
'status': 'stopped',
'username': 'NT AUTHORITY\\LocalService'}
Other samples
=============
See `doc recipes <http://psutil.readthedocs.io/#recipes>`__ and
`demo scritps <https://github.com/giampaolo/psutil/tree/master/scripts>`__.
2 changes: 0 additions & 2 deletions scripts/internal/print_access_denied.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ def main():
s = hilite(s, ok=not ads)
print(s)
print("-" * 50)
# print("total: %s AccessDenied errors (%s total processes)" % (
# tot_ads, tot_procs))
print("Totals: access-denied=%s, calls=%s, processes=%s" % (
tot_ads, tot_calls, tot_procs))

Expand Down
2 changes: 1 addition & 1 deletion scripts/internal/print_api_speed.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

"""Benchmark all API calls.
$ python scripts/internal/print_api_speed.py
$ make print_api_speed
SYSTEM APIS SECONDS
----------------------------------
boot_time 0.000140
Expand Down

0 comments on commit e8bd07f

Please sign in to comment.