Skip to content

Commit

Permalink
Drop Python 3.4 support
Browse files Browse the repository at this point in the history
Signed-off-by: mayeut <[email protected]>
  • Loading branch information
mayeut committed Jul 31, 2023
1 parent 1fe0497 commit 445387f
Show file tree
Hide file tree
Showing 13 changed files with 19 additions and 22 deletions.
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://pypy.org/>`__.

Funding
Expand Down
4 changes: 2 additions & 2 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <http://pypy.org/>`__ is also known to work.

The psutil documentation you're reading is distributed as a single HTML page.
Expand Down Expand Up @@ -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
========
Expand Down
4 changes: 2 additions & 2 deletions psutil/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -2189,7 +2189,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()
Expand Down
2 changes: 1 addition & 1 deletion psutil/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion psutil/_pslinux.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion psutil/_psposix.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion psutil/_pswindows.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
else:
raise

if sys.version_info >= (3, 4):
if sys.version_info[0] >= 3:
import enum
else:
enum = None
Expand Down
5 changes: 1 addition & 4 deletions psutil/tests/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion psutil/tests/test_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion scripts/internal/print_announce.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
==========
Expand Down
9 changes: 4 additions & 5 deletions scripts/internal/winmake.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand Down

0 comments on commit 445387f

Please sign in to comment.