Skip to content

Commit

Permalink
PYEK-31 | Subscriber returns 400 on TypeError, make linter fine, drop…
Browse files Browse the repository at this point in the history
… 2.7, 3.4, 3.5
  • Loading branch information
mas15 committed Dec 16, 2020
1 parent 8e21340 commit 2e583ef
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 29 deletions.
2 changes: 1 addition & 1 deletion pyhermes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from pyhermes.decorators import publisher, subscriber
from pyhermes.publishing import publish

__version__ = '0.4.2'
__version__ = '0.4.3'

__all__ = [
'publish',
Expand Down
8 changes: 4 additions & 4 deletions pyhermes/apps/flask/blueprints.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ def subscriber_view(subscriber_name):
except TopicHandlersNotFoundError:
logger.error('subscriber `{}` does not exist.'.format(subscriber_name))
return abort(404)
except ValueError:
# json loading error
# TODO: better handling
except (ValueError, TypeError) as e:
# Input loading error
logger.error(str(e))
return abort(400)
else:
return ('', 204)
return '', 204
14 changes: 7 additions & 7 deletions pyhermes/management.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ def integrations_command_handler(topic, message):
from pyhermes.publishing import publish
from pyhermes.settings import HERMES_SETTINGS
if not HERMES_SETTINGS.ENABLED:
sys.stderr.write(
'Hermes integration is disabled. '
'Check HERMES.ENABLED variable '
'in your settings or environment.'
)
return
sys.stderr.write(
'Hermes integration is disabled. '
'Check HERMES.ENABLED variable '
'in your settings or environment.'
)
return
if topic == TOPICS_ALL:
topics = HERMES_SETTINGS.PUBLISHING_TOPICS.keys()
topics = HERMES_SETTINGS.PUBLISHING_TOPICS.keys()
else:
topics = [topic]

Expand Down
4 changes: 2 additions & 2 deletions requirements/dev.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
bumpversion==0.5.3
wheel==0.24.0
bumpversion==0.6.0
wheel==0.36.2
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.4.2
current_version = 0.4.3
commit = True
tag = True

Expand Down
7 changes: 3 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,9 @@ def get_version(*file_paths):
'Intended Audience :: Developers',
'License :: OSI Approved :: Apache Software License',
'Natural Language :: English',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
],
)
17 changes: 7 additions & 10 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[tox]
envlist =
{py27,py34,py35,py36}
{py27,py34,py35,py36}-django{18,19,110,111,dev},
{py27,py34}-django{17},
{py27,py34,py35,py36}-flask{012,10,dev},
{py36,py37,py38}
{py36,py37,py38}-django{111,dev},
{py36,py37,py38}-flask{125,10,dev},

[testenv]
setenv =
Expand All @@ -18,11 +17,9 @@ setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/pyhermes
commands = python runtests_django.py tests/test_apps/test_django/
deps =
django17: Django==1.7.11
django18: Django==1.8.17
django19: Django==1.9.12
django110: Django==1.10.4
django111: Django==1.11.a1
django111: Django==1.11.29
django2: Django==2.2.17
django31: Django==3.1.4
djangodev: git+git://github.com/django/django.git
-r{toxinidir}/requirements/test.txt

Expand All @@ -32,7 +29,7 @@ setenv =
PYTHONPATH = {toxinidir}:{toxinidir}/pyhermes
commands = python -m unittest discover tests/test_apps/test_flask/
deps =
flask122: Flask==0.12.2
flask125: Flask==0.12.5
flask10: Flask==1.0.2
flaskdev: git+git://github.com/pallets/flask.git
-r{toxinidir}/requirements/test.txt

0 comments on commit 2e583ef

Please sign in to comment.