Remove Python 2 in docs and README files

This commit is contained in:
nicolargo 2021-08-28 10:23:19 +02:00
parent 15173dd431
commit 76ea71f256
6 changed files with 20 additions and 54 deletions

View File

@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
strategy: strategy:
matrix: matrix:
python-version: [2.7, 3.5, 3.6, 3.7, 3.8, 3.9] python-version: [3.4, 3.5, 3.6, 3.7, 3.8, 3.9]
steps: steps:

View File

@ -57,20 +57,14 @@ add new plugins or exports modules.
Requirements Requirements
============ ============
- ``python>=2.7`` or ``python>=3.4`` - ``python>=3.4``
- ``psutil>=5.3.0`` (better with latest version) - ``psutil>=5.3.0`` (better with latest version)
- ``defusedxml`` (in order to monkey patch xmlrpc) - ``defusedxml`` (in order to monkey patch xmlrpc)
- ``future`` (for Python 2 support)
*Note for Python 2.6 users* *Note for Python 2 users*
Glances no longer supports Python 2.6. Please upgrade Glances version 4 or higher do not support Python 2.
to a minimum Python version of 2.7/3.4+ or downgrade to Glances 2.6.2 (last version Please uses Glances version 3 if you need Python 2 support.
with Python 2.6 support).
*Deprecation warning note for Python 2.x users*
Glances version 4.0 will no longer supports Python 2.x.
Optional dependencies: Optional dependencies:
@ -87,7 +81,7 @@ Optional dependencies:
- ``influxdb-client`` (for the InfluxDB version 2 export module) [Only for Python >= 3.6] - ``influxdb-client`` (for the InfluxDB version 2 export module) [Only for Python >= 3.6]
- ``kafka-python`` (for the Kafka export module) - ``kafka-python`` (for the Kafka export module)
- ``netifaces`` (for the IP plugin) - ``netifaces`` (for the IP plugin)
- ``py3nvml`` (for the GPU plugin) [Only for Python 3] - ``py3nvml`` (for the GPU plugin)
- ``pika`` (for the RabbitMQ/ActiveMQ export module) - ``pika`` (for the RabbitMQ/ActiveMQ export module)
- ``potsdb`` (for the OpenTSDB export module) - ``potsdb`` (for the OpenTSDB export module)
- ``prometheus_client`` (for the Prometheus export module) - ``prometheus_client`` (for the Prometheus export module)
@ -98,7 +92,7 @@ Optional dependencies:
- ``pySMART.smartx`` (for HDD Smart support) [Linux-only] - ``pySMART.smartx`` (for HDD Smart support) [Linux-only]
- ``pyzmq`` (for the ZeroMQ export module) - ``pyzmq`` (for the ZeroMQ export module)
- ``requests`` (for the Ports, Cloud plugins and RESTful export module) - ``requests`` (for the Ports, Cloud plugins and RESTful export module)
- ``scandir`` (for the Folders plugin) [Only for Python < 3.5] - ``scandir`` (for the Folders plugin) [Only for Python 3.4]
- ``sparklines`` (for the Quick Plugin sparklines option) - ``sparklines`` (for the Quick Plugin sparklines option)
- ``statsd`` (for the StatsD export module) - ``statsd`` (for the StatsD export module)
- ``wifi`` (for the wifi plugin) [Linux-only] - ``wifi`` (for the wifi plugin) [Linux-only]
@ -283,7 +277,7 @@ MacPorts
Windows Windows
------- -------
Install `Python`_ for Windows (Python 2.7.9+ and 3.4+ ship with pip) and Install `Python`_ for Windows (Python 3.4+ ship with pip) and
then run the following command: then run the following command:
.. code-block:: console .. code-block:: console

View File

@ -23,17 +23,7 @@ actions.py Manage trigger actions (via mustache)
snmp.py Glances SNMP client (via pysnmp) snmp.py Glances SNMP client (via pysnmp)
... ...
plugins plugins
=> Glances data providers => Glances plugins
glances_plugins.py "Father class" for others plugins
glances_cpu.py Manage CPU stats
glances_load.py Manage load stats
glances_mem.py Manage RAM stats
glances_memswap.py Manage swap stats
glances_network.py Manage network stats
glances_fs.py Manage file system stats
glances_diskio.py Manage disk I/O stats
glances_docker.py Glances Docker plugin (via docker-py)
glances_raid.py Glances RAID plugin (via pymdstat)
... ...
outputs outputs
=> Glances UI => Glances UI
@ -41,18 +31,8 @@ outputs
glances_bottle.py The web interface glances_bottle.py The web interface
... ...
exports exports
=> Glances export interfaces => Glances exports
glances_export.py "Father class" for exports
glances_csv.py The CSV export module
glances_influxdb.py The InfluxDB export module
glances_mqtt.py The MQTT export module
glances_opentsdb.py The OpenTSDB export module
glances_rabbitmq.py The RabbitMQ export module
glances_statsd.py The StatsD export module
... ...
amps amps
=> Glances Application Monitoring Processes (AMP) => Glances Application Monitoring Processes (AMP)
glances_amp.py "Father class" for AMPs
glances_default.py Default AMP
glances_nginx.py Nginx AMP
... ...

View File

@ -9,14 +9,10 @@ from io import open
from setuptools import setup, Command from setuptools import setup, Command
if sys.version_info < (2, 7) or (3, 0) <= sys.version_info < (3, 4): if sys.version_info < (3, 4):
print('Glances requires at least Python 2.7 or 3.4 to run.') print('Glances requires at least Python 3.4 to run.')
sys.exit(1) sys.exit(1)
PY2 = sys.version_info[0] == 2
PY3 = sys.version_info[0] == 3
# Global functions # Global functions
################## ##################
@ -52,14 +48,15 @@ def get_install_requires():
def get_install_extras_require(): def get_install_extras_require():
extras_require = { extras_require = {
'action': ['chevron'], 'action': ['chevron'],
'browser': ['zeroconf==0.19.1' if PY2 else 'zeroconf>=0.19.1'], 'browser': ['zeroconf>=0.19.1'],
'cloud': ['requests'], 'cloud': ['requests'],
'docker': ['docker>=2.0.0'], 'docker': ['docker>=2.0.0'],
'export': ['bernhard', 'cassandra-driver', 'couchdb', 'elasticsearch', 'export': ['bernhard', 'cassandra-driver', 'couchdb', 'elasticsearch',
'graphitesender', 'influxdb>=1.0.0', 'kafka-python', 'pika', 'graphitesender', 'influxdb>=1.0.0', 'influxdb-client',
'paho-mqtt', 'potsdb', 'prometheus_client', 'pyzmq', 'kafka-python', 'pika', 'paho-mqtt', 'potsdb', 'prometheus_client',
'statsd'], 'pyzmq', 'statsd'],
'folders': ['scandir'], # python_version<"3.5" 'folders': ['scandir'],
'gpu': ['py3nvml'],
'graph': ['pygal'], 'graph': ['pygal'],
'ip': ['netifaces'], 'ip': ['netifaces'],
'raid': ['pymdstat'], 'raid': ['pymdstat'],
@ -70,9 +67,6 @@ def get_install_extras_require():
'wifi': ['wifi'] 'wifi': ['wifi']
#'gpu' and 'sensors' ==> See bellow #'gpu' and 'sensors' ==> See bellow
} }
if PY3:
extras_require['export'].append('influxdb-client')
extras_require['gpu'] = ['py3nvml']
if sys.platform.startswith('linux'): if sys.platform.startswith('linux'):
extras_require['sensors'] = ['batinfo'] extras_require['sensors'] = ['batinfo']
@ -132,8 +126,6 @@ setup(
'Intended Audience :: System Administrators', 'Intended Audience :: System Administrators',
'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)', 'License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)',
'Operating System :: OS Independent', 'Operating System :: OS Independent',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.5',

View File

@ -1,7 +1,7 @@
# Required metadata # Required metadata
sonar.projectKey=glances sonar.projectKey=glances
sonar.projectName=Glances sonar.projectName=Glances
sonar.projectVersion=2.7 sonar.projectVersion=4.0
# Path to the parent source code directory. # Path to the parent source code directory.
# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. # Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows.

View File

@ -5,7 +5,7 @@
# tox # tox
[tox] [tox]
envlist = py27, py38, py39 envlist = py39
[testenv] [testenv]
deps = deps =