Refactor setup.py

This commit is contained in:
nicolargo 2024-05-13 22:48:07 +02:00
commit c98b7fcf1d
4 changed files with 23 additions and 15 deletions

View File

@ -10,6 +10,12 @@ Under development, see roadmap here: https://github.com/nicolargo/glances/milest
Contributors are welcome !
===============
Version 4.0.1
===============
Correct issue with CI (miss pydantic dep).
===============
Version 4.0.0
===============

View File

@ -87,7 +87,9 @@ class PluginModel(GlancesPluginModel):
# Init the sensor class
start_duration.reset()
self.glances_grab_sensors = GlancesGrabSensors()
# Hotfix! Refactor to use only one `GlancesGrabSensors` later
self.glances_grab_sensors_fan_speed = GlancesGrabSensors()
self.glances_grab_sensors_temperature = GlancesGrabSensors()
logger.debug("Generic sensor plugin init duration: {} seconds".format(start_duration.get()))
# Instance for the HDDTemp Plugin in order to display the hard disks
@ -115,7 +117,7 @@ class PluginModel(GlancesPluginModel):
def __get_temperature(self, stats, index):
try:
temperature = self.__set_type(self.glances_grab_sensors.get(SENSOR_TEMP_TYPE), SENSOR_TEMP_TYPE)
temperature = self.__set_type(self.glances_grab_sensors_temperature.get(SENSOR_TEMP_TYPE), SENSOR_TEMP_TYPE)
except Exception as e:
logger.error("Cannot grab sensors temperatures (%s)" % e)
else:
@ -123,7 +125,7 @@ class PluginModel(GlancesPluginModel):
def __get_fan_speed(self, stats, index):
try:
fan_speed = self.__set_type(self.glances_grab_sensors.get(SENSOR_FAN_TYPE), SENSOR_FAN_TYPE)
fan_speed = self.__set_type(self.glances_grab_sensors_fan_speed.get(SENSOR_FAN_TYPE), SENSOR_FAN_TYPE)
except Exception as e:
logger.error("Cannot grab FAN speed (%s)" % e)
else:

View File

@ -36,19 +36,18 @@ def get_data_files():
def get_install_requires():
requires = [
'psutil>=5.6.7',
'defusedxml',
'packaging',
'ujson>=5.4.0',
]
if sys.platform.startswith('win'):
requires.append('fastapi')
requires.append('uvicorn')
requires.append('jinja2')
requires.append('requests')
required = []
with open('requirements.txt') as f:
required = f.read().splitlines()
return requires
# On Windows, install WebUI by default
if sys.platform.startswith('win'):
required.append('fastapi')
required.append('uvicorn')
required.append('jinja2')
required.append('requests')
return required
def get_install_extras_require():

View File

@ -18,6 +18,7 @@ deps =
psutil
defusedxml
packaging
pydantic
ujson
fastapi
uvicorn