[Python-modules-commits] [python-psutil] 01/10: Import python-psutil_3.4.1.orig.tar.gz

Sandro Tosi morph at moszumanska.debian.org
Sun Jan 17 21:10:28 UTC 2016


This is an automated email from the git hooks/post-receive script.

morph pushed a commit to branch master
in repository python-psutil.

commit ec23e9849bfff47c4e3c0be5bca05aba3c8bdb65
Author: Sandro Tosi <morph at debian.org>
Date:   Sun Jan 17 14:08:28 2016 +0000

    Import python-psutil_3.4.1.orig.tar.gz
---
 .coveragerc                           |   21 +
 .git-pre-commit                       |   47 +
 .gitignore                            |   18 +
 .travis.yml                           |   41 +-
 CREDITS                               |   80 +-
 DEVNOTES.rst                          |   10 +
 HISTORY.rst                           |  197 ++++
 INSTALL.rst                           |   70 +-
 MANIFEST.in                           |   10 +-
 Makefile                              |   70 +-
 PKG-INFO                              |   86 +-
 README.rst                            |   83 +-
 TODO                                  |   74 +-
 appveyor.yml                          |   77 ++
 docs/index.rst                        |  363 ++++--
 examples/ifconfig.py                  |   80 ++
 examples/iotop.py                     |   15 +-
 examples/nettop.py                    |   10 +-
 examples/process_detail.py            |   21 +-
 examples/ps.py                        |    0
 examples/pstree.py                    |    2 +-
 examples/top.py                       |   12 +-
 make.bat                              |  163 ++-
 psutil.egg-info/PKG-INFO              |   86 +-
 psutil.egg-info/SOURCES.txt           |   25 +-
 psutil.egg-info/top_level.txt         |    2 -
 psutil/__init__.py                    |  846 +++++++-------
 psutil/_common.py                     |  161 +--
 psutil/_compat.py                     |   87 +-
 psutil/_psbsd.py                      |  420 +++++--
 psutil/_pslinux.py                    |  570 ++++++----
 psutil/_psosx.py                      |   48 +-
 psutil/_psposix.py                    |   15 +-
 psutil/_pssunos.py                    |   76 +-
 psutil/_psutil_bsd.c                  | 1988 +++++++--------------------------
 psutil/_psutil_bsd.h                  |   17 -
 psutil/_psutil_linux.c                |  277 +++--
 psutil/_psutil_linux.h                |    1 +
 psutil/_psutil_osx.c                  |  592 +++++-----
 psutil/_psutil_posix.c                |  454 +++++++-
 psutil/_psutil_posix.h                |    5 +
 psutil/_psutil_sunos.c                |  402 ++++---
 psutil/_psutil_sunos.h                |    1 +
 psutil/_psutil_windows.c              | 1699 +++++++++++++++-------------
 psutil/_psutil_windows.h              |   10 +-
 psutil/_pswindows.py                  |  168 ++-
 psutil/arch/bsd/freebsd.c             |  976 ++++++++++++++++
 psutil/arch/bsd/freebsd.h             |   30 +
 psutil/arch/bsd/freebsd_socks.c       |  631 +++++++++++
 psutil/arch/bsd/freebsd_socks.h       |   11 +
 psutil/arch/bsd/netbsd.c              |  668 +++++++++++
 psutil/arch/bsd/netbsd.h              |   29 +
 psutil/arch/bsd/netbsd_socks.c        |  542 +++++++++
 psutil/arch/bsd/netbsd_socks.h        |   10 +
 psutil/arch/bsd/openbsd.c             |  793 +++++++++++++
 psutil/arch/bsd/openbsd.h             |   28 +
 psutil/arch/bsd/process_info.c        |  272 -----
 psutil/arch/bsd/process_info.h        |   15 -
 psutil/arch/osx/process_info.c        |  109 +-
 psutil/arch/osx/process_info.h        |    2 +-
 psutil/arch/solaris/v10/ifaddrs.c     |  124 ++
 psutil/arch/solaris/v10/ifaddrs.h     |   26 +
 psutil/arch/windows/inet_ntop.c       |   38 +
 psutil/arch/windows/inet_ntop.h       |   10 +
 psutil/arch/windows/ntextapi.h        |  106 +-
 psutil/arch/windows/process_handles.c |  771 ++++++++-----
 psutil/arch/windows/process_handles.h |  101 ++
 psutil/arch/windows/process_info.c    |  112 +-
 psutil/arch/windows/process_info.h    |   11 +-
 psutil/arch/windows/security.c        |   33 +-
 setup.py                              |  142 ++-
 test/README                           |   15 -
 test/README.rst                       |   21 +
 test/__init__.py                      |    0
 test/_bsd.py                          |  165 ++-
 test/_linux.py                        |  455 +++++++-
 test/_osx.py                          |   80 +-
 test/_posix.py                        |   68 +-
 test/_sunos.py                        |   18 +-
 test/_windows.py                      |  212 +++-
 test/test_memory_leaks.py             |   90 +-
 test/test_psutil.py                   | 1489 ++++++++++++++++--------
 tox.ini                               |   22 +-
 83 files changed, 11890 insertions(+), 5835 deletions(-)

diff --git a/.coveragerc b/.coveragerc
new file mode 100644
index 0000000..f023909
--- /dev/null
+++ b/.coveragerc
@@ -0,0 +1,21 @@
+[report]
+
+include =
+    *psutil*
+
+omit =
+    test/*
+    *setup*
+    *_compat.py*
+
+exclude_lines =
+    pragma: no cover
+    if __name__ == .__main__.:
+    if sys.platform.startswith
+    if _WINDOWS:
+    import enum
+    if enum is not None:
+    if enum is None:
+    if has_enums:
+    enum.IntEnum
+    except ImportError:
diff --git a/.git-pre-commit b/.git-pre-commit
new file mode 100755
index 0000000..0b838d4
--- /dev/null
+++ b/.git-pre-commit
@@ -0,0 +1,47 @@
+#!/usr/bin/env python
+
+# This gets executed on 'git commit' and rejects the commit in case the
+# submitted code does not pass validation.
+# Install it with "make install-git-hooks"
+
+import os
+import subprocess
+import sys
+
+
+def main():
+    out = subprocess.check_output("git diff --cached --name-only", shell=True)
+    files = [x for x in out.split('\n') if x.endswith('.py') and
+             os.path.exists(x)]
+
+    for path in files:
+        with open(path) as f:
+            data = f.read()
+
+        # pdb
+        if "pdb.set_trace" in data:
+            for lineno, line in enumerate(data.split('\n'), 1):
+                line = line.rstrip()
+                if "pdb.set_trace" in line:
+                    print("%s: %s" % (lineno, line))
+                    sys.exit(
+                        "commit aborted: you forgot a pdb in your python code")
+
+        # bare except clause
+        if "except:" in data:
+            for lineno, line in enumerate(data.split('\n'), 1):
+                line = line.rstrip()
+                if "except:" in line and not line.endswith("# NOQA"):
+                    print("%s: %s" % (lineno, line))
+                    sys.exit("commit aborted: bare except clause")
+
+    # flake8
+    failed = False
+    for path in files:
+        ret = subprocess.call("python -m flake8 %s" % path, shell=True)
+        if ret != 0:
+            failed = True
+    if failed:
+        sys.exit("commit aborted: python code is not flake8-compliant")
+
+main()
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..99d0d54
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,18 @@
+syntax: glob
+*.al
+*.bak
+*.egg-info
+*.la
+*.lo
+*.o
+*.orig
+*.pyc
+*.pyd
+*.rej
+*.so
+*.swp
+.cache/
+.idea/
+.tox/
+build/
+dist/
diff --git a/.travis.yml b/.travis.yml
index 2534164..6ec09d3 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,21 +1,26 @@
+sudo: false
 language: python
-python:
-    - 2.6
-    - 2.7
-    - 3.2
-    - 3.3
-    - 3.4
-    # - pypy
+matrix:
+    include:
+        - python: 2.6
+        - python: 2.7
+        - python: 3.3
+        - python: 3.4
+        - language: generic
+          os: osx
+          env: PYVER=py26
+        - language: generic
+          os: osx
+          env: PYVER=py27
+        - language: generic
+          os: osx
+          env: PYVER=py33
+        - language: generic
+          os: osx
+          env: PYVER=py34
 install:
-    - if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then pip install unittest2; fi
+    - ./.ci/travis/install.sh
 script:
-    - pip install flake8
-    - python setup.py build
-    - python setup.py install
-    - python test/test_psutil.py
-    - python test/test_memory_leaks.py
-    - make flake8
-os:
-    - linux
-    - osx
-
+    - ./.ci/travis/run.sh
+after_success:
+  - coveralls  # upload reports to coveralls.io
diff --git a/CREDITS b/CREDITS
index c3f630f..ceb74d5 100644
--- a/CREDITS
+++ b/CREDITS
@@ -29,11 +29,20 @@ E: jloden at gmail.com
 D: original co-author, initial design/bootstrap and occasional bug fixes
 W: http://www.jayloden.com
 
+N: Jeff Tang
+W: https://github.com/mrjefftang
+I: 340, 529, 616, 653, 654, 648, 641
+
 N: Jeremy Whitlock
 E: jcscoobyrs at gmail.com
 D: great help with OSX C development.
 I: 125, 150, 174, 206
 
+N: Landry Breuil
+W: https://github.com/landryb
+D: OpenBSD implementation.
+I: 615
+
 N: wj32
 E: wj32.64 at gmail.com
 D: process username() and get_connections() on Windows
@@ -56,6 +65,14 @@ W: http://daviddaeschler.com
 D: some contributions to initial design/bootstrap plus occasional bug fixing
 I: 522, 536
 
+N: Thomas Klausner
+W: https://github.com/0-wiz-0
+I: #557
+
+N: Ryo Onodera
+W: https://github.com/ryoon
+I: #557
+
 N: cjgohlke
 E: cjgohlke at gmail.com
 D: Windows 64 bit support
@@ -253,10 +270,6 @@ N: msabramo
 E: msabramo at gmail.com
 I: 492
 
-N: Jeff Tang
-W: https://github.com/mrjefftang
-I: 340, 529
-
 N: Yaolong Huang
 E: airekans at gmail.com
 W: http://airekans.github.io/
@@ -267,8 +280,9 @@ W: https://github.com/anders-chrigstrom
 I: 496
 
 N: spacewander
+W: https://github.com/spacewander
 E: spacewanderlzx at gmail.com
-I: 561
+I: 561, 603
 
 N: Sylvain Mouquet
 E: sylvain.mouquet at gmail.com
@@ -280,3 +294,59 @@ I: 568
 N: Bruno Binet
 E: bruno.binet at gmail.com
 I: 572
+
+N: Gabi Davar
+C: Israel
+W: https://github.com/mindw
+I: 578, 581, 587
+
+N: spacewanderlzx
+C: Guangzhou,China
+E: spacewanderlzx at gmail.com
+I: 555
+
+N: Fabian Groffen
+I: 611, 618
+
+N: desbma
+W: https://github.com/desbma
+C: France
+I: 628
+
+N: John Burnett
+W: http://www.johnburnett.com/
+C: Irvine, CA, US
+I: 614
+
+N: Árni Már Jónsson
+E: Reykjavik, Iceland
+E: https://github.com/arnimarj
+I: 634
+
+N: Bart van Kleef
+W: https://github.com/bkleef
+I: 664
+
+N: Steven Winfield
+W: https://github.com/stevenwinfield
+I: 672
+
+N: sk6249
+W: https://github.com/sk6249
+I: 670
+
+N: maozguttman
+W: https://github.com/maozguttman
+I: 659
+
+N: wiggin15
+W: https://github.com/wiggin15
+I: 517, 607, 610
+
+N: dasumin
+W: https://github.com/dasumin
+I: 541
+
+N: Mike Sarahan
+W: https://github.com/msarahan
+I: 688
diff --git a/DEVNOTES.rst b/DEVNOTES.rst
new file mode 100644
index 0000000..2dbdd92
--- /dev/null
+++ b/DEVNOTES.rst
@@ -0,0 +1,10 @@
+NetBSD
+======
+
+Setup
+-----
+
+- $ PKG_PATH="http://ftp.netbsd.org/pub/pkgsrc/packages/NetBSD/i386/7.0/All"
+  $ export PKG_PATH
+  $ pkg_add -v pkgin
+  $ pkgin install git python27 screen wget gcc
diff --git a/HISTORY.rst b/HISTORY.rst
index b205c66..108d413 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -1,5 +1,202 @@
 Bug tracker at https://github.com/giampaolo/psutil/issues
 
+3.4.1 - 2016-01-15
+==================
+
+**Enhancements**
+
+- #557: [NetBSD] added NetBSD support.  (contributed by Ryo Onodera and
+  Thomas Klausner)
+- #708: [Linux] psutil.net_connections() and Process.connections() on Python 2
+  can be up to 3x faster in case of many connections.
+  Also psutil.Process.memory_maps() is slightly faster.
+- #718: process_iter() is now thread safe.
+
+**Bug fixes**
+
+- #714: [OpenBSD] virtual_memory().cached value was always set to 0.
+- #715: don't crash at import time if cpu_times() fail for some reason.
+- #717: [Linux] Process.open_files fails if deleted files still visible.
+- #722: [Linux] swap_memory() no longer crashes if sin/sout can't be determined
+  due to missing /proc/vmstat.
+- #724: [FreeBSD] virtual_memory().total is slightly incorrect.
+
+
+3.3.0 - 2015-11-25
+==================
+
+**Enhancements**
+
+- #558: [Linux] exposed psutil.PROCFS_PATH constant to change the default
+  location of /proc filesystem.
+- #615: [OpenBSD] added OpenBSD support.  (contributed by Landry Breuil)
+
+**Bug fixes**
+
+- #692: [UNIX] Process.name() is no longer cached as it may change.
+
+
+3.2.2 - 2015-10-04
+==================
+
+**Bug fixes**
+
+- #517: [SunOS] net_io_counters failed to detect network interfaces
+  correctly on Solaris 10
+- #541: [FreeBSD] disk_io_counters r/w times were expressed in seconds instead
+  of milliseconds.  (patch by dasumin)
+- #610: [SunOS] fix build and tests on Solaris 10
+- #623: [Linux] process or system connections raises ValueError if IPv6 is not
+  supported by the system.
+- #678: [Linux] can't install psutil due to bug in setup.py.
+- #688: [Windows] compilation fails with MSVC 2015, Python 3.5. (patch by
+  Mike Sarahan)
+
+
+3.2.1 - 2015-09-03
+==================
+
+**Bug fixes**
+
+- #677: [Linux] can't install psutil due to bug in setup.py.
+
+
+3.2.0 - 2015-09-02
+==================
+
+**Enhancements**
+
+- #644: [Windows] added support for CTRL_C_EVENT and CTRL_BREAK_EVENT signals
+  to use with Process.send_signal().
+- #648: CI test integration for OSX. (patch by Jeff Tang)
+- #663: [UNIX] net_if_addrs() now returns point-to-point (VPNs) addresses.
+- #655: [Windows] different issues regarding unicode handling were fixed. On
+  Python 2 all APIs returning a string will now return an encoded version of it
+  by using sys.getfilesystemencoding() codec. The APIs involved are:
+  - psutil.net_if_addrs()
+  - psutil.net_if_stats()
+  - psutil.net_io_counters()
+  - psutil.Process.cmdline()
+  - psutil.Process.name()
+  - psutil.Process.username()
+  - psutil.users()
+
+**Bug fixes**
+
+- #513: [Linux] fixed integer overflow for RLIM_INFINITY.
+- #641: [Windows] fixed many compilation warnings.  (patch by Jeff Tang)
+- #652: [Windows] net_if_addrs() UnicodeDecodeError in case of non-ASCII NIC
+  names.
+- #655: [Windows] net_if_stats() UnicodeDecodeError in case of non-ASCII NIC
+  names.
+- #659: [Linux] compilation error on Suse 10. (patch by maozguttman)
+- #664: [Linux] compilation error on Alpine Linux. (patch by Bart van Kleef)
+- #670: [Windows] segfgault of net_if_addrs() in case of non-ASCII NIC names.
+  (patch by sk6249)
+- #672: [Windows] compilation fails if using Windows SDK v8.0. (patch by
+  Steven Winfield)
+- #675: [Linux] net_connections(); UnicodeDecodeError may occur when listing
+  UNIX sockets.
+
+
+3.1.1 - 2015-07-15
+==================
+
+**Bug fixes**
+
+- #603: [Linux] ionice_set value range is incorrect.  (patch by spacewander)
+- #645: [Linux] psutil.cpu_times_percent() may produce negative results.
+- #656: 'from psutil import *' does not work.
+
+
+3.1.0 - 2015-07-15
+==================
+
+**Enhancements**
+
+- #534: [Linux] disk_partitions() added support for ZFS filesystems.
+- #646: continuous tests integration for Windows with
+  https://ci.appveyor.com/project/giampaolo/psutil.
+- #647: new dev guide:
+  https://github.com/giampaolo/psutil/blob/master/DEVGUIDE.rst
+- #651: continuous code quality test integration with
+  https://scrutinizer-ci.com/g/giampaolo/psutil/
+
+**Bug fixes**
+
+- #340: [Windows] Process.open_files() no longer hangs. Instead it uses a
+  thred which times out and skips the file handle in case it's taking too long
+  to be retrieved.  (patch by Jeff Tang, PR #597)
+- #627: [Windows] Process.name() no longer raises AccessDenied for pids owned
+  by another user.
+- #636: [Windows] Process.memory_info() raise AccessDenied.
+- #637: [UNIX] raise exception if trying to send signal to Process PID 0 as it
+  will affect os.getpid()'s process group instead of PID 0.
+- #639: [Linux] Process.cmdline() can be truncated.
+- #640: [Linux] *connections functions may swallow errors and return an
+  incomplete list of connnections.
+- #642: repr() of exceptions is incorrect.
+- #653: [Windows] Add inet_ntop function for Windows XP to support IPv6.
+- #641: [Windows] Replace deprecated string functions with safe equivalents.
+
+
+3.0.1 - 2015-06-18
+==================
+
+**Bug fixes**
+
+- #632: [Linux] better error message if cannot parse process UNIX connections.
+- #634: [Linux] Proces.cmdline() does not include empty string arguments.
+- #635: [UNIX] crash on module import if 'enum' package is installed on python
+  < 3.4.
+
+
+3.0.0 - 2015-06-13
+==================
+
+**Enhancements**
+
+- #250: new psutil.net_if_stats() returning NIC statistics (isup, duplex,
+  speed, MTU).
+- #376: new psutil.net_if_addrs() returning all NIC addresses a-la ifconfig.
+- #469: on Python >= 3.4 ``IOPRIO_CLASS_*`` and ``*_PRIORITY_CLASS`` constants
+  returned by psutil.Process' ionice() and nice() methods are enums instead of
+  plain integers.
+- #581: add .gitignore. (patch by Gabi Davar)
+- #582: connection constants returned by psutil.net_connections() and
+  psutil.Process.connections() were turned from int to enums on Python > 3.4.
+- #587: Move native extension into the package.
+- #589: Process.cpu_affinity() accepts any kind of iterable (set, tuple, ...),
+  not only lists.
+- #594: all deprecated APIs were removed.
+- #599: [Windows] process name() can now be determined for all processes even
+  when running as a limited user.
+- #602: pre-commit GIT hook.
+- #629: enhanced support for py.test and nose test discovery and tests run.
+- #616: [Windows] Add inet_ntop function for Windows XP.
+
+**Bug fixes**
+
+- #428: [all UNIXes except Linux] correct handling of zombie processes;
+  introduced new ZombieProcess exception class.
+- #512: [BSD] fix segfault in net_connections().
+- #555: [Linux] psutil.users() correctly handles ":0" as an alias for
+  "localhost"
+- #579: [Windows] Fixed open_files() for PID>64K.
+- #579: [Windows] fixed many compiler warnings.
+- #585: [FreeBSD] net_connections() may raise KeyError.
+- #586: [FreeBSD] cpu_affinity() segfaults on set in case an invalid CPU
+  number is provided.
+- #593: [FreeBSD] Process().memory_maps() segfaults.
+- #606: Process.parent() may swallow NoSuchProcess exceptions.
+- #611: [SunOS] net_io_counters has send and received swapped
+- #614: [Linux]: cpu_count(logical=False) return the number of physical CPUs
+  instead of physical cores.
+- #618: [SunOS] swap tests fail on Solaris when run as normal user
+- #628: [Linux] Process.name() truncates process name in case it contains
+  spaces or parentheses.
+
+
 2.2.1 - 2015-02-02
 ==================
 
diff --git a/INSTALL.rst b/INSTALL.rst
index bb30a06..fdbc4d6 100644
--- a/INSTALL.rst
+++ b/INSTALL.rst
@@ -4,12 +4,12 @@ Installing using pip on UNIX
 
 The easiest way to install psutil on UNIX is by using pip (but first you might
 need to install python header files; see later).
-First install pip:
+First install pip::
 
-    $ wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py
-    python ez_setup.py
+    $ wget https://bootstrap.pypa.io/get-pip.py
+    $ python get-pip.py
 
-...then run:
+...then run::
 
     $ pip install psutil
 
@@ -22,49 +22,27 @@ Installing on Windows
 
 Just get the right installer for your Python version and architecture from:
 https://pypi.python.org/pypi/psutil/#downloads
-
-
-==================================
-Compiling on Windows using mingw32
-==================================
-
-First install mingw (http://www.mingw.org/) then add mingw "bin" folder to
-environment PATH (NOTE: this assumes MinGW is installed in C:\MinGW):
-
-    SET PATH=C:\MinGW\bin;%PATH%
-
-You can then compile psutil by running:
-
-    setup.py build -c mingw32
-
-To compile and install:
-
-    setup.py build -c mingw32 install
-
-You can also use make.bat which automatically sets the env variable for you:
-
-    make.bat build
-
-FWIW I managed to compile psutil against all 32-bit Python versions but not
-64 bit.
+Since wheels installers are also available you may also use pip.
 
 
 ========================================
 Compiling on Windows using Visual Studio
 ========================================
 
-To use Visual Studio to compile psutil you must have the same version of
-Visual Studio used to compile your installation of Python which is::
+In order to compile psutil on Windows you'll need Visual Studio (Mingw32 is
+no longer supported). You must have the same version of Visual Studio used to
+compile your installation of Python, that is::
 
-    Python 2.6:  VS 2008
-    Python 2.7:  VS 2008
-    Python 3.3+: VS 2010
+* Python 2.6:  VS 2008 (download it from `here <http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_)
+* Python 2.7:  VS 2008 (download it from `here <http://www.microsoft.com/en-us/download/details.aspx?id=44266>`_)
+* Python 3.3, 3.4: VS 2010 (you can download it from `MS website <http://www.visualstudio.com/downloads/download-visual-studio-vs#d-2010-express>`_)
+* Python 3.5: `VS 2015 UP <http://www.visualstudio.com/en-au/news/vs2015-preview-vs>`_
 
-...then run:
+...then run::
 
     setup.py build
 
-...or:
+...or::
 
     make.bat build
 
@@ -73,24 +51,20 @@ Windows SDK and .NET Framework 3.5 SP1 to be installed first.
 Once you have those run vcvars64.bat, then compile:
 http://stackoverflow.com/questions/11072521/
 
-If you do not have the right version of Visual Studio available then try using
-MinGW instead.
-
-
 ===================
 Installing on Linux
 ===================
 
 gcc is required and so the python headers. They can easily be installed by
-using the distro package manager. For example, on Debian amd Ubuntu:
+using the distro package manager. For example, on Debian and Ubuntu::
 
     $ sudo apt-get install gcc python-dev
 
-...on Redhat and CentOS:
+...on Redhat and CentOS::
 
     $ sudo yum install gcc python-devel
 
-Once done, you can build/install psutil with:
+Once done, you can build/install psutil with::
 
     $ python setup.py install
 
@@ -102,11 +76,11 @@ Installing on OS X
 OS X installation from source will require gcc which you can obtain as part of
 the 'XcodeTools' installer from Apple. Then you can run the standard distutils
 commands.
-To build only:
+To build only::
 
     $ python setup.py build
 
-To install and build:
+To install and build::
 
     $ python setup.py install
 
@@ -119,11 +93,11 @@ The same compiler used to install Python must be present on the system in order
 to build modules using distutils. Assuming it is installed, you can build using
 the standard distutils commands.
 
-Build only:
+Build only::
 
     $ python setup.py build
 
-Install and build:
+Install and build::
 
     $ python setup.py install
 
@@ -136,7 +110,7 @@ A makefile is available for both UNIX and Windows (make.bat).  It provides
 some automations for the tasks described above and might be preferred over
 using setup.py. With it you can::
 
-    $ make install    # just install
+    $ make install    # just install (in --user mode)
     $ make uninstall  # uninstall (needs pip)
     $ make test       # run tests
     $ make clean      # remove installation files
diff --git a/MANIFEST.in b/MANIFEST.in
index b275f61..3e1db32 100644
--- a/MANIFEST.in
+++ b/MANIFEST.in
@@ -1,5 +1,10 @@
+include .coveragerc
+include .git-pre-commit
+include .gitignore
 include .travis.yml
+include appveyor.yml
 include CREDITS
+include DEVNOTES.rst
 include HISTORY.rst
 include INSTALL.rst
 include LICENSE
@@ -10,8 +15,9 @@ include README.rst
 include setup.py
 include TODO
 include tox.ini
-recursive-include docs *
 recursive-exclude docs/_build *
+recursive-include .ci/ *
+recursive-include docs *
 recursive-include examples *.py
 recursive-include psutil *.py *.c *.h
-recursive-include test *.py README
\ No newline at end of file
+recursive-include test *.py README*
diff --git a/Makefile b/Makefile
index 542cc25..153a077 100644
--- a/Makefile
+++ b/Makefile
@@ -16,21 +16,51 @@ clean:
 	rm -f `find . -type f -name \*.bak`
 	rm -f `find . -type f -name \*.rej`
 	rm -rf `find . -type d -name __pycache__`
+	rm -rf *.core
 	rm -rf *.egg-info
 	rm -rf *\$testfile*
+	rm -rf .coverage
 	rm -rf .tox
 	rm -rf build
 	rm -rf dist
 	rm -rf docs/_build
+	rm -rf htmlcov
 
 build: clean
 	$(PYTHON) setup.py build
+	@# copies *.so files in ./psutil directory in order to allow
+	@# "import psutil" when using the interactive interpreter from within
+	@# this directory.
+	$(PYTHON) setup.py build_ext -i
+
+# useful deps which are nice to have while developing / testing
+setup-dev-env: install-git-hooks
+	python -c  "import urllib2, ssl; \
+				context = ssl._create_unverified_context() if hasattr(ssl, '_create_unverified_context') else None; \
+				kw = dict(context=context) if context else {}; \
+				r = urllib2.urlopen('https://bootstrap.pypa.io/get-pip.py', **kw); \
+				open('/tmp/get-pip.py', 'w').write(r.read());"
+	$(PYTHON) /tmp/get-pip.py --user
+	rm /tmp/get-pip.py
+	$(PYTHON) -m pip install --user --upgrade pip
+	$(PYTHON) -m pip install --user --upgrade \
+		coverage  \
+		flake8 \
+		ipaddress \
+		ipdb \
+		mock==1.0.1 \
+		nose \
+		pep8 \
+		pyflakes \
+		sphinx \
+		sphinx-pypi-upload \
+		unittest2 \
 
 install: build
-	$(PYTHON) setup.py install --user; \
+	$(PYTHON) setup.py install --user
 
 uninstall:
-	cd ..; $(PYTHON) -m pip uninstall -y -v psutil; \
+	cd ..; $(PYTHON) -m pip uninstall -y -v psutil
 
 test: install
 	$(PYTHON) $(TSCRIPT)
@@ -42,27 +72,36 @@ test-system: install
 	$(PYTHON) -m unittest -v test.test_psutil.TestSystemAPIs
 
 test-memleaks: install
-	$(PYTHON) -m unittest -v test.test_memory_leaks
+	$(PYTHON) test/test_memory_leaks.py
 
 # Run a specific test by name; e.g. "make test-by-name disk_" will run
 # all test methods containing "disk_" in their name.
 # Requires "pip install nose".
-test-by-name:
-	@$(PYTHON) -m nose test/test_psutil.py --nocapture -v -m $(filter-out $@,$(MAKECMDGOALS))
+test-by-name: install
+	@$(PYTHON) -m nose test/test_psutil.py test/_* --nocapture -v -m $(filter-out $@,$(MAKECMDGOALS))
+
+# Same as above but for test_memory_leaks.py script.
+test-memleaks-by-name: install
+	@$(PYTHON) -m nose test/test_memory_leaks.py --nocapture -v -m $(filter-out $@,$(MAKECMDGOALS))
+
+coverage: install
+	# Note: coverage options are controlled by .coveragerc file
+	rm -rf .coverage htmlcov
+	$(PYTHON) -m coverage run $(TSCRIPT)
+	$(PYTHON) -m coverage report
+	@echo "writing results to htmlcov/index.html"
+	$(PYTHON) -m coverage html
+	$(PYTHON) -m webbrowser -t htmlcov/index.html
 
-# requires "pip install pep8"
 pep8:
-	@git ls-files | grep \\.py$ | xargs pep8
+	@git ls-files | grep \\.py$ | xargs $(PYTHON) -m pep8
 
-# requires "pip install pyflakes"
 pyflakes:
 	@export PYFLAKES_NODOCTEST=1 && \
-		git ls-files | grep \\.py$ | xargs pyflakes
+		git ls-files | grep \\.py$ | xargs $(PYTHON) -m pyflakes
 
-# requires "pip install flake8"
 flake8:
-	@git ls-files | grep \\.py$ | xargs flake8
-
+	@git ls-files | grep \\.py$ | xargs $(PYTHON) -m flake8
 
 # Upload source tarball on https://pypi.python.org/pypi/psutil.
 upload-src: clean
@@ -77,4 +116,9 @@ upload-doc:
 # git-tag a new release
 git-tag-release:
 	git tag -a release-`python -c "import setup; print(setup.get_version())"` -m `git rev-list HEAD --count`:`git rev-parse --short HEAD`
-	echo "done; now run 'git push --follow-tags' to push the new tag on the remote repo"
+	git push --follow-tags
+
+# install GIT pre-commit hook
+install-git-hooks:
+	ln -sf ../../.git-pre-commit .git/hooks/pre-commit
+	chmod +x .git/hooks/pre-commit
diff --git a/PKG-INFO b/PKG-INFO
index 62c9470..e86021f 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,36 +1,50 @@
 Metadata-Version: 1.1
 Name: psutil
-Version: 2.2.1
+Version: 3.4.1
 Summary: psutil is a cross-platform library for retrieving information onrunning processes and system utilization (CPU, memory, disks, network)in Python.
 Home-page: https://github.com/giampaolo/psutil
 Author: Giampaolo Rodola
 Author-email: g.rodola <at> gmail <dot> com
 License: BSD
-Description: .. image:: https://pypip.in/d/psutil/badge.png
-            :target: https://crate.io/packages/psutil/
-            :alt: Download this month
+Description: .. image:: https://img.shields.io/pypi/dm/psutil.svg
+            :target: https://pypi.python.org/pypi/psutil#downloads
+            :alt: Downloads this month
         
-        .. image:: https://pypip.in/v/psutil/badge.png
+        .. image:: https://api.travis-ci.org/giampaolo/psutil.png?branch=master
+            :target: https://travis-ci.org/giampaolo/psutil
+            :alt: Linux tests (Travis)
+        
+        .. image:: https://ci.appveyor.com/api/projects/status/qdwvw7v1t915ywr5/branch/master?svg=true
+            :target: https://ci.appveyor.com/project/giampaolo/psutil
+            :alt: Windows tests (Appveyor)
+        
+        .. image:: https://coveralls.io/repos/giampaolo/psutil/badge.svg?branch=master&service=github
+            :target: https://coveralls.io/github/giampaolo/psutil?branch=master
+            :alt: Test coverage (coverall.io)
+        
+        .. image:: https://img.shields.io/pypi/v/psutil.svg
             :target: https://pypi.python.org/pypi/psutil/
             :alt: Latest version
         
-        .. image:: https://pypip.in/license/psutil/badge.png
+        .. image:: https://img.shields.io/github/stars/giampaolo/psutil.svg
+            :target: https://github.com/giampaolo/psutil/
+            :alt: Github stars
+        
+        .. image:: https://img.shields.io/pypi/l/psutil.svg
             :target: https://pypi.python.org/pypi/psutil/
             :alt: License
         
-        .. image:: https://api.travis-ci.org/giampaolo/psutil.png?branch=master
-            :target: https://travis-ci.org/giampaolo/psutil
-            :alt: Travis
-        
         ===========
         Quick links
         ===========
         
         - `Home page <https://github.com/giampaolo/psutil>`_
         - `Documentation <http://pythonhosted.org/psutil/>`_
+        - `Installation <https://github.com/giampaolo/psutil/blob/master/INSTALL.rst>`_
         - `Download <https://pypi.python.org/pypi?:action=display&name=psutil#downloads>`_
         - `Forum <http://groups.google.com/group/psutil/topics>`_
         - `Blog <http://grodola.blogspot.com/search/label/psutil>`_
+        - `Development guide <https://github.com/giampaolo/psutil/blob/master/DEVGUIDE.rst>`_
         - `What's new <https://github.com/giampaolo/psutil/blob/master/HISTORY.rst>`_
         
         =======
@@ -44,9 +58,10 @@ Description: .. image:: https://pypip.in/d/psutil/badge.png
         running processes**. It implements many functionalities offered by command line
         tools such as: ps, top, lsof, netstat, ifconfig, who, df, kill, free, nice,
         ionice, iostat, iotop, uptime, pidof, tty, taskset, pmap. It currently supports
-        **Linux, Windows, OSX, FreeBSD** and **Sun Solaris**, both **32-bit** and
-        **64-bit** architectures, with Python versions from **2.6 to 3.4** (users of
-        Python 2.4 and 2.5 may use `2.1.3 <https://pypi.python.org/pypi?name=psutil&version=2.1.3&:action=files>`__ version).
+        **Linux, Windows, OSX, Sun Solaris, FreeBSD, OpenBSD** and **NetBSD**,
+        both **32-bit** and **64-bit** architectures, with Python versions from **2.6
+        to 3.5** (users of Python 2.4 and 2.5 may use
+        `2.1.3 <https://pypi.python.org/pypi?name=psutil&version=2.1.3&:action=files>`__ version).
         `PyPy <http://pypy.org/>`__ is also known to work.
         
         ====================
@@ -118,9 +133,9 @@ Description: .. image:: https://pypip.in/d/psutil/badge.png
         .. code-block:: python
         
             >>> psutil.virtual_memory()
-            svmem(total=8374149120L, available=2081050624L, percent=75.1, used=8074080256L, free=300068864L, active=3294920704, inactive=1361616896, buffers=529895424L, cached=1251086336)
+            svmem(total=8374149120, available=2081050624, percent=75.1, used=8074080256, free=300068864, active=3294920704, inactive=1361616896, buffers=529895424, cached=1251086336)
             >>> psutil.swap_memory()
-            sswap(total=2097147904L, used=296128512L, free=1801019392L, percent=14.1, sin=304193536, sout=677842944)
+            sswap(total=2097147904, used=296128512, free=1801019392, percent=14.1, sin=304193536, sout=677842944)
             >>>
         
         Disks
@@ -149,11 +164,23 @@ Description: .. image:: https://pypip.in/d/psutil/badge.png
              'lo': netio(bytes_sent=2838627, bytes_recv=2838627, packets_sent=30567, packets_recv=30567, errin=0, errout=0, dropin=0, dropout=0)}
             >>>
             >>> psutil.net_connections()
-            [pconn(fd=115, family=2, type=1, laddr=('10.0.0.1', 48776), raddr=('93.186.135.91', 80), status='ESTABLISHED', pid=1254),
-             pconn(fd=117, family=2, type=1, laddr=('10.0.0.1', 43761), raddr=('72.14.234.100', 80), status='CLOSING', pid=2987),
-             pconn(fd=-1, family=2, type=1, laddr=('10.0.0.1', 60759), raddr=('72.14.234.104', 80), status='ESTABLISHED', pid=None),
-             pconn(fd=-1, family=2, type=1, laddr=('10.0.0.1', 51314), raddr=('72.14.234.83', 443), status='SYN_SENT', pid=None)
+            [pconn(fd=115, family=<AddressFamily.AF_INET: 2>, type=<SocketType.SOCK_STREAM: 1>, laddr=('10.0.0.1', 48776), raddr=('93.186.135.91', 80), status='ESTABLISHED', pid=1254),
+             pconn(fd=117, family=<AddressFamily.AF_INET: 2>, type=<SocketType.SOCK_STREAM: 1>, laddr=('10.0.0.1', 43761), raddr=('72.14.234.100', 80), status='CLOSING', pid=2987),
+             pconn(fd=-1, family=<AddressFamily.AF_INET: 2>, type=<SocketType.SOCK_STREAM: 1>, laddr=('10.0.0.1', 60759), raddr=('72.14.234.104', 80), status='ESTABLISHED', pid=None),
+             pconn(fd=-1, family=<AddressFamily.AF_INET: 2>, type=<SocketType.SOCK_STREAM: 1>, laddr=('10.0.0.1', 51314), raddr=('72.14.234.83', 443), status='SYN_SENT', pid=None)
              ...]
+            >>>
+            >>> psutil.net_if_addrs()
+            {'lo': [snic(family=<AddressFamily.AF_INET: 2>, address='127.0.0.1', netmask='255.0.0.0', broadcast='127.0.0.1', ptp=None),
+                    snic(family=<AddressFamily.AF_INET6: 10>, address='::1', netmask='ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff', broadcast=None, ptp=None),
+                    snic(family=<AddressFamily.AF_LINK: 17>, address='00:00:00:00:00:00', netmask=None, broadcast='00:00:00:00:00:00', ptp=None)],
+             'wlan0': [snic(family=<AddressFamily.AF_INET: 2>, address='192.168.1.3', netmask='255.255.255.0', broadcast='192.168.1.255', ptp=None),
+                       snic(family=<AddressFamily.AF_INET6: 10>, address='fe80::c685:8ff:fe45:641%wlan0', netmask='ffff:ffff:ffff:ffff::', broadcast=None, ptp=None),
+                       snic(family=<AddressFamily.AF_LINK: 17>, address='c4:85:08:45:06:41', netmask=None, broadcast='ff:ff:ff:ff:ff:ff', ptp=None)]}
+            >>>
+            >>> psutil.net_if_stats()
+            {'eth0': snicstats(isup=True, duplex=<NicDuplex.NIC_DUPLEX_FULL: 2>, speed=100, mtu=1500),
+             'lo': snicstats(isup=True, duplex=<NicDuplex.NIC_DUPLEX_UNKNOWN: 0>, speed=0, mtu=65536)}
         
         Other system info
         =================
@@ -236,10 +263,10 @@ Description: .. image:: https://pypip.in/d/psutil/badge.png
             [popenfile(path='/home/giampaolo/svn/psutil/somefile', fd=3)]
... 24844 lines suppressed ...

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-psutil.git



More information about the Python-modules-commits mailing list