10000 Upgrade to Tornado 6 by 0golovatyi · Pull Request #328 · tableau/TabPy · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Upgrade to Tornado 6 #328

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 9 commits into from
Jul 31, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,7 @@ language: python
python: 3.6
install:
- ./startup.sh --no-startup --print-install-logs
- pip install pytest
- pip install pytest-cov
- pip install coveralls
- pip install pytest pytest-cov coveralls
- npm install -g markdownlint-cli
script:
- source utils/set_env.sh
Expand Down
10 changes: 10 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,16 @@
This file lists notable changes for TabPy project releases.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## v0.7

### Improvements

- Added t-test model
- Fixed models call with /evaluate for HTTPS
- Migrated to Tornado 6
- Timeout is configurable with TABPY_EVALUATE_TIMEOUT config
file option

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Didn't we also bring over jessica's timeout work?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating changelog...

## v0.6

### Improvements
Expand Down
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ order:
* [TabPy Tools](docs/tabpy-tools.md)

Troubleshooting:

* [FAQ for configuration, startup and other issues](docs/FAQ.md)

More technical topics:
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.6
0.7
3 changes: 2 additions & 1 deletion docs/FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,5 @@

### AttributeError: module 'tornado.web' has no attribute 'asynchronous'

TabPy uses Tornado 5.1.1. To it to your Python environment run `pip install tornado==5.1.1` and then try to start TabPy again.
TabPy uses Tornado 5.1.1. To it to your Python environment run
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we are no longer bound to 5.1.1 should we remove this from the documentation?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, we should. But I'll keep it for now for 2 reasons:

  1. People may still have the issue using an older version of TabPy, and
  2. The file itself will be empty before we add any other Q/A there :)

`pip install tornado==5.1.1` and then try to start TabPy again.
4 changes: 1 addition & 3 deletions tabpy-server/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,14 @@
'decorator',
'future',
'genson',
'jsonschema~=2.3.0',
'mock',
'numpy',
'pyopenssl',
'python-dateutil',
'requests',
'singledispatch',
'six',
'tornado==5.1.1',
'Tornado-JSON',
'tornado',
'urllib3<1.25,>=1.21.1'
]
)
5 changes: 1 addition & 4 deletions tabpy-server/tabpy_server/app/app.py
9E81
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@
EvaluationPlaneHandler, QueryPlaneHandler,
ServiceInfoHandler, StatusHandler,
UploadDestinationHandler)
from tornado_json.constants import TORNADO_MAJOR
import tornado


Expand Down Expand Up @@ -251,9 +250,7 @@ def set_parameter(settings_key,
config=tabpy_state, settings=self.settings)

self.python_service = PythonServiceHandler(PythonService())
self.settings['compress_response'] = True if TORNADO_MAJOR >= 4\
else "gzip"

self.settings['compress_response'] = True
set_parameter(SettingsParameters.StaticPath,
ConfigParameters.TABPY_STATIC_PATH,
default_val='./')
Expand Down
2 changes: 0 additions & 2 deletions tabpy-server/tabpy_server/handlers/endpoint_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ def get(self, endpoint_name):
self.error_out(404, 'Unknown endpoint',
info=f'Endpoint {endpoint_name} is not found')

@tornado.web.asynchronous
@gen.coroutine
def put(self, name):
if self.should_fail_with_not_authorized():
Expand Down Expand Up @@ -94,7 +93,6 @@ def put(self, name):
self.error_out(500, err_msg)
self.finish()

@tornado.web.asynchronous
@gen.coroutine
def delete(self, name):
if self.should_fail_with_not_authorized():
Expand Down
1 change: 0 additions & 1 deletion tabpy-server/tabpy_server/handlers/endpoints_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ def get(self):
self._add_CORS_header()
self.write(json.dumps(self.tabpy_state.get_endpoints()))

@tornado.web.asynchronous
@gen.coroutine
def post(self):
if self.should_fail_with_not_authorized():
Expand Down
5 changes: 3 additions & 2 deletions tabpy-server/tabpy_server/handlers/query_plane_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from tabpy_server.common.util import format_exception
import urllib
import tornado.web
from tornado import gen


def _get_uuid():
Expand Down Expand Up @@ -207,7 +208,7 @@ def _get_actual_model(self, endpoint_name):

return (endpoint_name, all_endpoint_names)

@tornado.web.asynchronous
@gen.coroutine
def get(self, endpoint_name):
if self.should_fail_with_not_authorized():
self.fail_with_not_authorized()
Expand All @@ -217,7 +218,7 @@ def get(self, endpoint_name):
endpoint_name = urllib.parse.unquote(endpoint_name)
self._process_query(endpoint_name, start)

@tornado.web.asynchronous
@gen.coroutine
def post(self, endpoint_name):
self.logger.log(logging.DEBUG,
f'Processing POST for /query/{endpoint_name}...')
Expand Down
3 changes: 1 addition & 2 deletions tabpy-tools/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
install_requires=[
'cloudpickle',
'requests',
'genson',
'jsonschema'
'genson'
]
)
2 changes: 1 addition & 1 deletion tabpy-tools/tabpy_tools/schema.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import logging
import genson as _genson

from jsonschema import validate as _validate
from json import validate as _validate


logger = logging.getLogger(__name__)
Expand Down
0