Skip to content

Commit

Permalink
Merge pull request #10 from dave-shawley/update-tornado
Browse files Browse the repository at this point in the history
Update tornadoes (>=4.5,<6.5) & pythons (2.7, >=3.5,<3.8)
  • Loading branch information
dave-shawley committed Apr 22, 2019
2 parents 4c34b10 + 10e45f5 commit 6dec435
Show file tree
Hide file tree
Showing 13 changed files with 62 additions and 50 deletions.
8 changes: 4 additions & 4 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
language: python
python:
- 2.7
- 3.3
- 3.4
- "2.7"
- "3.5"
- "3.6"
- pypy
install:
- pip install -r requirements.txt -r test-requirements.txt
Expand All @@ -18,4 +18,4 @@ deploy:
tags: true
repo: dave-shawley/glinda
all_branches: true
python: 3.4
python: 3.6
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2015, Dave Shawley
Copyright (c) 2015-2019, Dave Shawley
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
9 changes: 4 additions & 5 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
-r requirements.txt
-r test-requirements.txt
detox>=0.9,<1
flake8>=2.2,<3
pyflakes>=0.8,<1
sphinx>=1.2,<2
sphinx-rtd-theme>=0.1,<1
pycodestyle==2.5.0
sphinx==2.0.1
sphinx-rtd-theme==0.4.3
tox==3.9.0
15 changes: 14 additions & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,18 @@
Changelog
---------

* `1.0.0`_ (22 Apr 2019)

- Adjust supported Python versions

- Add support for 3.5, 3.6, & 3.7
- Drop support for 3.3, & 3.4

- Adjust supported Tornado versions

- Add support for 4.5, 5, and 6
- Drop support for 3-4.5

* `0.1.0`_ (3 Jul 2017)

- Modify content negotiation to 406 when asked for an unknown character set
Expand Down Expand Up @@ -30,7 +42,8 @@ Changelog
- Add :class:`glinda.testing.services.Request`
- Add :class:`glinda.testing.services.Response`

.. _Next Release: https://github.com/dave-shawley/glinda/compare/0.1.0...master
.. _Next Release: https://github.com/dave-shawley/glinda/compare/1.0.0...master
.. _1.0.0: https://github.com/dave-shawley/glinda/compare/0.1.0...1.0.0
.. _0.1.0: https://github.com/dave-shawley/glinda/compare/0.0.3...0.1.0
.. _0.0.3: https://github.com/dave-shawley/glinda/compare/0.0.2...0.0.3
.. _0.0.2: https://github.com/dave-shawley/glinda/compare/0.0.1...0.0.2
Expand Down
6 changes: 3 additions & 3 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@


project = 'glinda'
copyright = '2015, Dave Shawley'
copyright = '2015-2019, Dave Shawley'
version = __version__
release = '.'.join(str(x) for x in version_info[:2])

Expand All @@ -28,6 +28,6 @@
exclude_patterns = []

intersphinx_mapping = {
'python': ('http://docs.python.org/', None),
'tornado': ('http://tornadoweb.org/en/latest/', None),
'python': ('https://docs.python.org/', None),
'tornado': ('https://www.tornadoweb.org/en/latest/', None),
}
5 changes: 2 additions & 3 deletions docs/hacking.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@ though.
- All tests pass. This is non-negotiable. If you cannot get a particular
test case to pass. Submit the PR on github and we can probably work
through it. What I won't do is accept code that breaks a pile of tests
without any effort to fix them. Run ``env/bin/detox`` or ``env/bin/tox``
to run the tests.
without any effort to fix them. Run ``env/bin/tox`` to run the tests.

- Features are documented. I use `sphinx`_ for all documentation. Edit
the documentation sources as required and make sure that running
Expand Down Expand Up @@ -44,7 +43,7 @@ test, document, and generally hack on the code base.

.. code-block:: sh
$ pyvenv env
$ python3 -mvenv env
$ env/bin/pip install -r dev-requirements.txt
Running Tests
Expand Down
2 changes: 1 addition & 1 deletion glinda/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version_info = (0, 1, 0)
version_info = (1, 0, 0)
__version__ = '.'.join(str(x) for x in version_info)
24 changes: 8 additions & 16 deletions glinda/testing/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,23 +42,22 @@ class ServiceLayer(object):
behavior as item lookup as well (e.g., ``__getitem__``)::
>>> from tornado.ioloop import IOLoop
>>> services = ServiceLayer(IOLoop.instance())
>>> services = ServiceLayer()
>>> services['service-name'] is services.get_service('service-name')
True
Once you have a named service instance, you can configure it to
respond by calling :meth:`Service.add_response` method.
>>> from tornado import httpclient, ioloop
>>> iol = ioloop.IOLoop.instance()
>>> services = ServiceLayer(iol)
>>> services = ServiceLayer()
>>> service = services.get_service('endpoint')
>>> service.add_response(Request('GET', '/endpoint'),
... Response(222))
>>> def get():
... client = httpclient.AsyncHTTPClient(io_loop=iol)
... client = httpclient.AsyncHTTPClient()
... return client.fetch(service.url_for('endpoint'))
>>> rsp = iol.run_sync(get)
>>> rsp = ioloop.IOLoop.instance().run_sync(get)
>>> rsp.code
222
>>>
Expand All @@ -69,18 +68,11 @@ class ServiceLayer(object):
"""

def __init__(self, io_loop=None):
"""
Initialize the service layer.
:param tornado.ioloop.IOLoop io_loop: optional IOLoop instance
to attach to. If unspecified, the default loop is used.
"""
def __init__(self):
"""Initialize the service layer."""
super(ServiceLayer, self).__init__()
self._application = _Application()
self._server = httpserver.HTTPServer(self._application,
io_loop=io_loop)
self._server = httpserver.HTTPServer(self._application)
self._services = {}

def get_service(self, service):
Expand Down Expand Up @@ -368,7 +360,7 @@ def add_resource(self, service, resource):
handler = web.url(resource, _ServiceHandler,
kwargs={'service': service})
# leave the error handler at the end
self.handlers[-1][1].insert(-1, handler)
self.default_router.rules.insert(-1, handler)


class _ServiceHandler(web.RequestHandler):
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
ietfparse>=1.2.2,<2
tornado>=3,<4.5
tornado>=4.5,<6.5
6 changes: 4 additions & 2 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,20 @@ universal = 1
[build_sphinx]
all-files = 1

[coverage:report]
show_missing = 1

[nosetests]
nocapture = 1
verbosity = 2
stop = 1
with-doctest = 1
with-coverage = 1
cover-package = glinda
cover-erase = 1
cover-branches = 1
# note that the glinda.testing module is treated as a test :/
doctest-tests = 1
cover-tests = 1

[flake8]
[pycodestyle]
exclude = build,dist,docs,env
7 changes: 4 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,11 @@ def read_requirements_file(name):
'Operating System :: OS Independent',
'Programming Language :: Python',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3.3',
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: Implementation :: CPython',
'Programming Language :: Python :: Implementation :: PyPy',
'Development Status :: 4 - Beta',
'Development Status :: 5 - Production/Stable',
],
)
6 changes: 3 additions & 3 deletions test-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
coverage>=3.7,<4
msgpack-python>=0.4,<1
nose>=1.3,<2
coverage==4.5.3
msgpack-python==0.5.6
nose==1.3.7
20 changes: 13 additions & 7 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[tox]
envlist = py27,py33,py34,pypy3,tornado3,tornado4
envlist = py27,py35,py36,py37,pypy3,tornado4,tornado5,tornado6
skip_missing_interpreters = True
toxworkdir = {toxinidir}/build/tox

Expand All @@ -12,14 +12,20 @@ deps =
{[testenv]deps}
mock

[testenv:tornado3]
basepython = python3.4
[testenv:tornado4]
basepython = python3.7
deps =
tornado>=3,<4
tornado>=4.5,<5
{[testenv]deps}

[testenv:tornado4]
basepython = python3.4
[testenv:tornado5]
basepython = python3.7
deps =
tornado>=5,<6
{[testenv]deps}

[testenv:tornado6]
basepython = python3.7
deps =
tornado>=4,<5
tornado>=6,<6.5
{[testenv]deps}

0 comments on commit 6dec435

Please sign in to comment.