forked from pool/python-flower
Accepting request 977774 from home:pgajdos:python
- version update to 1.0.0
* no upstream changelog file found
* Remove flower as individual command.
- modified patches
% backport_run_in_executor.patch (refreshed)
- deleted patches
- pr_1021.patch (upstreamed)
- added patches
fix 70b1ae40b4
+ python-flower-new-humanize.patch
OBS-URL: https://build.opensuse.org/request/show/977774
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-flower?expand=0&rev=13
This commit is contained in:
committed by
Git OBS Bridge
parent
48afcaaa32
commit
4c03fbf59e
67
python-flower-new-humanize.patch
Normal file
67
python-flower-new-humanize.patch
Normal file
@@ -0,0 +1,67 @@
|
||||
diff --git a/flower/utils/__init__.py b/flower/utils/__init__.py
|
||||
index 45289d51..29486ac9 100644
|
||||
--- a/flower/utils/__init__.py
|
||||
+++ b/flower/utils/__init__.py
|
||||
@@ -20,11 +20,11 @@ def bugreport(app=None):
|
||||
return 'flower -> flower:%s tornado:%s humanize:%s%s' % (
|
||||
__version__,
|
||||
tornado.version,
|
||||
- humanize.VERSION,
|
||||
+ humanize.__version__,
|
||||
app.bugreport()
|
||||
)
|
||||
- except (ImportError, AttributeError):
|
||||
- return 'Unknown Celery version'
|
||||
+ except (ImportError, AttributeError) as e:
|
||||
+ return f"Error when generating bug report: {e}. Have you installed correct versions of Flower's dependencies?"
|
||||
|
||||
|
||||
def abs_path(path):
|
||||
diff --git a/requirements/default.txt b/requirements/default.txt
|
||||
index 93c831ef..9ffa2f89 100644
|
||||
--- a/requirements/default.txt
|
||||
+++ b/requirements/default.txt
|
||||
@@ -1,5 +1,5 @@
|
||||
celery>=5.0.5
|
||||
tornado>=5.0.0,<7.0.0
|
||||
prometheus_client>=0.8.0
|
||||
-humanize
|
||||
+humanize==3.12.0
|
||||
pytz
|
||||
diff --git a/tests/unit/utils/test_utils.py b/tests/unit/utils/test_utils.py
|
||||
index a0032619..4e4fada4 100644
|
||||
--- a/tests/unit/utils/test_utils.py
|
||||
+++ b/tests/unit/utils/test_utils.py
|
||||
@@ -1,4 +1,5 @@
|
||||
import unittest
|
||||
+from unittest.mock import Mock
|
||||
|
||||
from flower.utils import bugreport
|
||||
from celery import Celery
|
||||
@@ -7,7 +8,7 @@
|
||||
class BugreportTests(unittest.TestCase):
|
||||
def test_default(self):
|
||||
report = bugreport()
|
||||
- self.assertFalse('Unknown Celery version' in report)
|
||||
+ self.assertFalse('Error when generating bug report' in report)
|
||||
self.assertTrue('tornado' in report)
|
||||
self.assertTrue('humanize' in report)
|
||||
self.assertTrue('celery' in report)
|
||||
@@ -15,7 +16,15 @@ def test_default(self):
|
||||
def test_with_app(self):
|
||||
app = Celery()
|
||||
report = bugreport(app)
|
||||
- self.assertFalse('Unknown Celery version' in report)
|
||||
+ self.assertFalse('Error when generating bug report' in report)
|
||||
self.assertTrue('tornado' in report)
|
||||
self.assertTrue('humanize' in report)
|
||||
self.assertTrue('celery' in report)
|
||||
+
|
||||
+ def test_when_unable_to_generate_report(self):
|
||||
+ fake_app = Mock()
|
||||
+ fake_app.bugreport.side_effect = ImportError('import error message')
|
||||
+ report = bugreport(fake_app)
|
||||
+ self.assertTrue('Error when generating bug report' in report)
|
||||
+ self.assertTrue('import error message' in report)
|
||||
+ self.assertTrue("Have you installed correct versions of Flower's dependencies?" in report)
|
||||
|
||||
Reference in New Issue
Block a user