Skip to content

Commit

Permalink
Merge pull request #1 from hroncok/notoro
Browse files Browse the repository at this point in the history
Make toro only required with tornado 4
  • Loading branch information
microdog authored Aug 5, 2018
2 parents 0fda618 + f5c1082 commit f1b33d3
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,16 @@

tornado_requires = [
"tornado>=4.0,<6.0",
"toro>=0.6"
]

try:
from tornado import version as tornado_version
if tornado_version < '5.0':
tornado_requires.append("toro>=0.6")
except ImportError:
# tornado will now only get installed and we'll get the newer one
pass

dev_requires = [
"cython>=0.23",
"flake8>=2.5",
Expand Down
6 changes: 5 additions & 1 deletion thriftpy/tornado.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
try:
from tornado.locks import Lock
except ImportError:
from toro import Lock
try:
from toro import Lock
except ImportError:
raise RuntimeError('With tornado {}, you need to install '
'"toro"'.format(tornado_version))


logger = logging.getLogger(__name__)
Expand Down
1 change: 0 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ commands =
deps =
pytest
tornado>=4.0,<6.0
toro
cython

[testenv:flake8]
Expand Down

0 comments on commit f1b33d3

Please sign in to comment.