提交 282335d5 编写于 作者: A Alessio Sergi

Bump minimum required psutil version to 0.5.1

上级 6f01ea62
......@@ -96,9 +96,10 @@ except ImportError:
sys.exit(1)
psutil_version = tuple([int(num) for num in psutil.__version__.split('.')])
if psutil_version < (0, 4, 1):
# this is not a mistake: psutil 0.5.1 is detected as 0.5.0
if psutil_version < (0, 5, 0):
print(_('PsUtil version %s detected.') % psutil.__version__)
print(_('PsUtil 0.4.1 or higher is needed. Glances cannot start.'))
print(_('PsUtil 0.5.1 or higher is needed. Glances cannot start.'))
sys.exit(1)
try:
......@@ -995,12 +996,7 @@ class GlancesGrabProcesses:
procstat['status'] = str(proc.status)[:1].upper()
procstat['cpu_times'] = proc.get_cpu_times()
procstat['cpu_percent'] = proc.get_cpu_percent(interval=0)
if hasattr(proc, 'get_nice'):
# deprecated in psutil 0.5.0+
procstat['nice'] = proc.get_nice()
elif hasattr(proc, 'nice'):
procstat['nice'] = proc.nice
procstat['nice'] = proc.get_nice()
# procstat['io_counters'] is a list:
# [read_bytes, write_bytes, read_bytes_old, write_bytes_old, io_tag]
......
......@@ -39,11 +39,11 @@ setup(
# download_url='https://s3.amazonaws.com/glances/glances-1.7.1.tar.gz',
license="LGPL",
keywords="cli curses monitoring system",
install_requires=['psutil>=0.4.1'],
install_requires=['psutil>=0.5.1'],
extras_require={
'HTML': ['jinja2>=2.0'],
'SENSORS': ['pysensors>=0.0.2'],
'BATINFO': ['batinfo>=0.1.3']
'HTML': ['jinja2'],
'SENSORS': ['pysensors'],
'BATINFO': ['batinfo']
},
packages=['glances'],
include_package_data=True,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册