Merge "Make greenlet optional"

This commit is contained in:
Zuul 2024-02-13 15:43:20 +00:00 committed by Gerrit Code Review
commit 592d8ac51a
4 changed files with 13 additions and 4 deletions

@ -75,6 +75,11 @@ from oslo_reports.generators import threading as tgen
from oslo_reports.generators import version as pgen from oslo_reports.generators import version as pgen
from oslo_reports import report from oslo_reports import report
try:
import greenlet
except ImportError:
greenlet = None
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
@ -240,8 +245,9 @@ class GuruMeditation(object):
self.add_section('Threads', self.add_section('Threads',
tgen.ThreadReportGenerator(self.traceback)) tgen.ThreadReportGenerator(self.traceback))
self.add_section('Green Threads', if greenlet:
tgen.GreenThreadReportGenerator()) self.add_section('Green Threads',
tgen.GreenThreadReportGenerator())
self.add_section('Processes', self.add_section('Processes',
prgen.ProcessReportGenerator()) prgen.ProcessReportGenerator())

@ -4,5 +4,4 @@ oslo.serialization!=2.19.1,>=2.18.0 # Apache-2.0
psutil>=3.2.2 # BSD psutil>=3.2.2 # BSD
oslo.i18n>=3.15.3 # Apache-2.0 oslo.i18n>=3.15.3 # Apache-2.0
oslo.utils>=3.33.0 # Apache-2.0 oslo.utils>=3.33.0 # Apache-2.0
greenlet>=0.4.15 # MIT
oslo.config>=5.1.0 # Apache-2.0 oslo.config>=5.1.0 # Apache-2.0

@ -22,6 +22,10 @@ classifier =
Programming Language :: Python :: 3 :: Only Programming Language :: Python :: 3 :: Only
Programming Language :: Python :: Implementation :: CPython Programming Language :: Python :: Implementation :: CPython
[extras]
greenlet =
greenlet>=0.4.15 # MIT
[files] [files]
packages = packages =
oslo_reports oslo_reports

@ -2,6 +2,6 @@ oslotest>=3.2.0 # Apache-2.0
stestr>=2.0.0 # Apache-2.0 stestr>=2.0.0 # Apache-2.0
# for testing optional parts # for testing optional parts
eventlet!=0.18.3,!=0.20.1,>=0.18.2 # MIT greenlet>=0.4.15 # MIT
coverage!=4.4,>=4.0 # Apache-2.0 coverage!=4.4,>=4.0 # Apache-2.0