diff --git a/README.rst b/README.rst index 2e991cb35..fb668b237 100644 --- a/README.rst +++ b/README.rst @@ -98,7 +98,7 @@ psutil currently supports the following platforms: - **Sun Solaris** - **AIX** -Supported Python versions are **2.7**, **3.4+** and +Supported Python versions are **2.7**, **3.5+** and `PyPy `__. Funding diff --git a/docs/index.rst b/docs/index.rst index 2bf050a11..8250cbcb3 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -38,7 +38,7 @@ psutil currently supports the following platforms: - **Sun Solaris** - **AIX** -Supported Python versions are **2.7** and **3.4+**. +Supported Python versions are **2.7** and **3.5+**. `PyPy `__ is also known to work. The psutil documentation you're reading is distributed as a single HTML page. @@ -2632,7 +2632,7 @@ Platforms support history * psutil 0.1.1 (2009-03): **FreeBSD** * psutil 0.1.0 (2009-01): **Linux, Windows, macOS** -Supported Python versions are 2.7, 3.4+ and PyPy3. +Supported Python versions are 2.7, 3.5+ and PyPy3. Timeline ======== diff --git a/psutil/__init__.py b/psutil/__init__.py index 2b0b3c6b0..d506244cc 100644 --- a/psutil/__init__.py +++ b/psutil/__init__.py @@ -17,7 +17,7 @@ - Sun Solaris - AIX -Works with Python versions 2.7 and 3.4+. +Works with Python versions 2.7 and 3.5+. """ from __future__ import division @@ -2181,7 +2181,7 @@ def net_if_addrs(): Note: you can have more than one address of the same family associated with each interface. """ - has_enums = sys.version_info >= (3, 4) + has_enums = sys.version_info[0] >= 3 if has_enums: import socket rawlist = _psplatform.net_if_addrs() diff --git a/psutil/_common.py b/psutil/_common.py index 922867464..85973dae0 100644 --- a/psutil/_common.py +++ b/psutil/_common.py @@ -35,7 +35,7 @@ except ImportError: AF_UNIX = None -if sys.version_info >= (3, 4): +if sys.version_info[0] >= 3: import enum else: enum = None diff --git a/psutil/_pslinux.py b/psutil/_pslinux.py index d178fe163..aaee9df86 100644 --- a/psutil/_pslinux.py +++ b/psutil/_pslinux.py @@ -53,7 +53,7 @@ from ._compat import basestring -if sys.version_info >= (3, 4): +if sys.version_info[0] >= 3: import enum else: enum = None diff --git a/psutil/_psposix.py b/psutil/_psposix.py index 1d250bf75..4cc63439c 100644 --- a/psutil/_psposix.py +++ b/psutil/_psposix.py @@ -28,7 +28,7 @@ from . import _psutil_osx -if sys.version_info >= (3, 4): +if sys.version_info[0] >= 3: import enum else: enum = None diff --git a/psutil/_pswindows.py b/psutil/_pswindows.py index 4081aa17f..2c8e41487 100644 --- a/psutil/_pswindows.py +++ b/psutil/_pswindows.py @@ -56,7 +56,7 @@ else: raise -if sys.version_info >= (3, 4): +if sys.version_info[0] >= 3: import enum else: enum = None diff --git a/psutil/tests/__init__.py b/psutil/tests/__init__.py index e6f0abc35..13395dd7d 100644 --- a/psutil/tests/__init__.py +++ b/psutil/tests/__init__.py @@ -67,7 +67,7 @@ warnings.simplefilter("ignore") import mock # NOQA - requires "pip install mock" -if sys.version_info >= (3, 4): +if sys.version_info[0] >= 3: import enum else: enum = None @@ -1714,9 +1714,6 @@ def import_module_by_path(path): if sys.version_info[0] == 2: import imp return imp.load_source(name, path) - elif sys.version_info[:2] <= (3, 4): - from importlib.machinery import SourceFileLoader - return SourceFileLoader(name, path).load_module() else: import importlib.util spec = importlib.util.spec_from_file_location(name, path) diff --git a/psutil/tests/test_contracts.py b/psutil/tests/test_contracts.py index 7f299a624..b1a5af566 100755 --- a/psutil/tests/test_contracts.py +++ b/psutil/tests/test_contracts.py @@ -723,7 +723,7 @@ def nice(self, ret, info): priorities = [getattr(psutil, x) for x in dir(psutil) if x.endswith('_PRIORITY_CLASS')] self.assertIn(ret, priorities) - if sys.version_info > (3, 4): + if sys.version_info[0] >= 3: self.assertIsInstance(ret, enum.IntEnum) else: self.assertIsInstance(ret, int) diff --git a/psutil/tests/test_system.py b/psutil/tests/test_system.py index 414c86e99..4d9dcd848 100755 --- a/psutil/tests/test_system.py +++ b/psutil/tests/test_system.py @@ -751,7 +751,7 @@ def test_net_if_addrs(self): self.assertIsInstance(addr.netmask, (str, type(None))) self.assertIsInstance(addr.broadcast, (str, type(None))) self.assertIn(addr.family, families) - if sys.version_info >= (3, 4) and not PYPY: + if sys.version_info[0] >= 3 and not PYPY: self.assertIsInstance(addr.family, enum.IntEnum) if nic_stats[nic].isup: # Do not test binding to addresses of interfaces diff --git a/scripts/internal/print_announce.py b/scripts/internal/print_announce.py index 510dc15f6..f33150f6d 100755 --- a/scripts/internal/print_announce.py +++ b/scripts/internal/print_announce.py @@ -47,7 +47,7 @@ nice, ionice, iostat, iotop, uptime, pidof, tty, taskset, pmap. It \ currently supports Linux, Windows, macOS, Sun Solaris, FreeBSD, OpenBSD, \ NetBSD and AIX, both 32-bit and 64-bit architectures. Supported Python \ -versions are 2.7 and 3.4+. PyPy is also known to work. +versions are 2.7 and 3.5+. PyPy is also known to work. What's new ========== diff --git a/scripts/internal/winmake.py b/scripts/internal/winmake.py index f92b2a896..5ec2ecbfd 100755 --- a/scripts/internal/winmake.py +++ b/scripts/internal/winmake.py @@ -54,14 +54,13 @@ "wheel", ] -if sys.version_info[:2] >= (3, 5): - DEPS.append('flake8-bugbear') -if sys.version_info[:2] <= (2, 7): +if sys.version_info[0] == 2: DEPS.append('mock') -if sys.version_info[:2] <= (3, 2): DEPS.append('ipaddress') -if sys.version_info[:2] <= (3, 4): DEPS.append('enum34') +else: + DEPS.append('flake8-bugbear') + if not PYPY: DEPS.append("pywin32") DEPS.append("wmi") diff --git a/setup.py b/setup.py index 2b8b2abb2..ce9afc734 100755 --- a/setup.py +++ b/setup.py @@ -444,7 +444,8 @@ def main(): ) if setuptools is not None: kwargs.update( - python_requires=">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*", + python_requires=( + ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*"), extras_require=extras_require, zip_safe=False, )