Skip to content
This repository has been archived by the owner on Dec 10, 2018. It is now read-only.
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Thriftpy/thriftpy
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.3.3
Choose a base ref
...
head repository: Thriftpy/thriftpy
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: develop
Choose a head ref

Commits on Jan 21, 2016

  1. Copy the full SHA
    70bfa0b View commit details

Commits on Jan 27, 2016

  1. add handshake logic in tracker

    xin li committed Jan 27, 2016
    Copy the full SHA
    3b09149 View commit details
  2. Merge pull request #179 from air-upc/add_handshake_logic

    add handshake logic in tracker
    lxyu committed Jan 27, 2016
    Copy the full SHA
    e3451b6 View commit details

Commits on Feb 2, 2016

  1. Copy the full SHA
    6b342c7 View commit details

Commits on Feb 4, 2016

  1. fix set_timeout backwards compatibility

    Then given `None` as a timeout value, the set_timeout method would not actually set the timeouts to `None`.  This would leave the values at 3 s if the `TSocket` object was instantiated with default args.  This change ensures that calling `set_timeout(None)` really sets the timeouts to `None`.
    laserson committed Feb 4, 2016
    Copy the full SHA
    4db14a7 View commit details

Commits on Feb 5, 2016

  1. Merge pull request #183 from laserson/compat

    fix set_timeout backwards compatibility
    lxyu committed Feb 5, 2016
    Copy the full SHA
    010717e View commit details

Commits on Feb 16, 2016

  1. make TPayload struct unhashable, fix #184

    mutable container should be unhashable
    lxyu committed Feb 16, 2016
    1
    Copy the full SHA
    daa213d View commit details
  2. Copy the full SHA
    d87c9a5 View commit details
  3. Copy the full SHA
    40219d4 View commit details
  4. Copy the full SHA
    2250547 View commit details
  5. fix typo in CHANGES.rst

    lxyu committed Feb 16, 2016
    Copy the full SHA
    6891290 View commit details
  6. add compact protocol

    caorong authored and lxyu committed Feb 16, 2016
    Copy the full SHA
    391921b View commit details
  7. Copy the full SHA
    7071681 View commit details
  8. Copy the full SHA
    d8fb4c1 View commit details

Commits on Mar 17, 2016

  1. Copy the full SHA
    2ff7c42 View commit details
  2. Merge pull request #188 from Damnever/set_timeout_only_works_before_t…

    …socket_open
    
    fix set_timeout only works before TSocket().open()
    lxyu committed Mar 17, 2016
    Copy the full SHA
    11aa134 View commit details

Commits on Mar 24, 2016

  1. transport code clean up

    lxyu committed Mar 24, 2016
    Copy the full SHA
    b5c9649 View commit details
  2. Copy the full SHA
    fc1f91b View commit details
  3. Copy the full SHA
    00c6553 View commit details
  4. cafile capath certfile keyfile now optional

    1. add capath as additional argument that may be passed to SSLContext
    2. make certfile and keyfile optional
    3. copied argument doc string from std lib.
    lxyu committed Mar 24, 2016
    Copy the full SHA
    da2e933 View commit details
  5. Copy the full SHA
    671652b View commit details
  6. Copy the full SHA
    185c031 View commit details
  7. 1
    Copy the full SHA
    6f9e436 View commit details
  8. Copy the full SHA
    9e5a863 View commit details
  9. Copy the full SHA
    c938b44 View commit details

Commits on Mar 28, 2016

  1. Propagate decode_response to nested structs

    Nested maps, lists, sets and structs now correctly take the
    "decode_response" argument into account instead of unconditionally
    attempting bytes to text decoding.
    
    Fixes #193.
    wbolster committed Mar 28, 2016
    Copy the full SHA
    ed1d0cc View commit details

Commits on Mar 30, 2016

  1. Merge pull request #194 from wbolster/propagate-decode-response-flag-…

    …for-container-types
    
    Propagate decode_response to nested structs
    lxyu committed Mar 30, 2016
    Copy the full SHA
    d9afc32 View commit details

Commits on Apr 14, 2016

  1. Copy the full SHA
    f52bab5 View commit details
  2. Merge pull request #195 from maralla/socket_handle

    expose socket handle in cython transports
    lxyu committed Apr 14, 2016
    Copy the full SHA
    5da1ff3 View commit details

Commits on Apr 23, 2016

  1. tornado ssl supported

    nlzc committed Apr 23, 2016
    Copy the full SHA
    98d0b4b View commit details

Commits on Apr 25, 2016

  1. Merge pull request #196 from zouchao2010/tornado_ssl

    tornado ssl supported
    lxyu committed Apr 25, 2016
    Copy the full SHA
    9a6e570 View commit details

Commits on May 3, 2016

  1. Copy the full SHA
    71629b6 View commit details
  2. fix typo in changelog

    lxyu committed May 3, 2016
    Copy the full SHA
    5aa0b90 View commit details

Commits on Jun 6, 2016

  1. Copy the full SHA
    c8efb16 View commit details

Commits on Jun 23, 2016

  1. Dynamically compile spec'd __init__ functions

    init_func_generator() previously used a single argument-less `init` base
    function coupled with a locals() hack to build spec-aware __init__()
    functions. This worked well, but profiling indicated that we were spending a
    good amount of time calling locals() and dict.copy()'ing its result.
    
    We now dynamically generate unique, per-spec __init__() functions using
    compile(..., 'exec'). This results in much faster runtime performance at the
    expense of a little compile-time complexity.
    
    The benchmark indicates this change results in ~10% faster decoding (for both
    the native and cybin implementations).
    
    Also, because this code no longer requires version-specific code paths, it can
    be moved out of _compat.py and into thrift.py.
    jparise committed Jun 23, 2016
    Copy the full SHA
    5661d15 View commit details
  2. Drop to_bytes() in favor of inline UTF-8 encoding

    We should only need to perform the UTF-8 encoding step when we are handed
    a Unicode string, and performing the encoding inline lets Cython translate
    this directly into a call to PyUnicode_AsUTF8String().
    jparise committed Jun 23, 2016
    Copy the full SHA
    0cd962f View commit details
  3. Tell c_read_binary that it's decoding characters

    These type and size hints let cython optimize the string decoding operation
    to a pair of `__Pyx_PyObject_AsString` / `__Pyx_decode_c_string()` calls. This
    is a lot more efficient than the previous code generation which invoked the
    "encode" method on the abstract "py_data" object.
    
    The performance improvement here varies based on how much string data exists
    in the input buffer, but the benchmark suite shows a 40%+ speed improvement
    with this change.
    jparise committed Jun 23, 2016
    Copy the full SHA
    724ebfa View commit details

Commits on Jun 28, 2016

  1. Merge pull request #210 from jparise/init-compile

    Dynamically compile spec'd __init__ functions
    lxyu authored Jun 28, 2016
    Copy the full SHA
    ec10dca View commit details
  2. Merge pull request #212 from jparise/c-read-string

    Tell c_read_binary that it's decoding characters
    lxyu authored Jun 28, 2016
    Copy the full SHA
    073ec0b View commit details
  3. Merge pull request #211 from jparise/cymemory-utf8

    Drop to_bytes() in favor of inline UTF-8 encoding
    lxyu authored Jun 28, 2016
    Copy the full SHA
    43bd436 View commit details

Commits on Jun 30, 2016

  1. Merge pull request #206 from microdog/develop

    Preserve traceback when re-raise undeclared exception
    lxyu authored Jun 30, 2016
    Copy the full SHA
    f13657b View commit details
  2. Copy the full SHA
    0edd37a View commit details
  3. Copy the full SHA
    9609a82 View commit details
  4. Copy the full SHA
    7626108 View commit details
  5. Copy the full SHA
    739a447 View commit details
  6. Copy the full SHA
    2d9bc02 View commit details
  7. Refactor explicit DEFAULT_HTTP_CLIENT_TIMEOUT_MS.

    Remove unsupported ssl_options to avoid mistake of supporting.
    keitheis committed Jun 30, 2016
    Copy the full SHA
    aa3ca2b View commit details

Commits on Jul 20, 2016

  1. Copy the full SHA
    65c038a View commit details

Commits on Jul 21, 2016

  1. Copy the full SHA
    115b8a8 View commit details
  2. Merge pull request #218 from hit9/fix-215

    Add word boundary for true/false literal lexing, close #215
    lxyu authored Jul 21, 2016
    Copy the full SHA
    e9c087f View commit details
Showing with 2,788 additions and 367 deletions.
  1. +2 −3 .travis.yml
  2. +96 −0 CHANGES.rst
  3. +12 −5 README.rst
  4. +2 −2 docs/conf.py
  5. +10 −9 docs/index.rst
  6. +6 −4 setup.py
  7. 0 tests/compatible/__init__.py
  8. 0 tests/compatible/version_2/__init__.py
  9. +301 −0 tests/compatible/version_2/tracking.py
  10. +16 −0 tests/compatible/version_2/tracking.thrift
  11. +55 −0 tests/parser-cases/annotations.thrift
  12. +1 −0 tests/parser-cases/cpp_include.thrift
  13. +10 −0 tests/parser-cases/doubles.thrift
  14. +6 −0 tests/parser-cases/issue_215.thrift
  15. +7 −0 tests/parser-cases/issue_252.thrift
  16. +3 −4 tests/ssl/README.md
  17. +21 −1 tests/test_base.py
  18. +2 −2 tests/test_const.py
  19. +3 −2 tests/test_container.py
  20. +18 −0 tests/test_cytransport.py
  21. +149 −0 tests/test_http.py
  22. +6 −5 tests/test_loader.py
  23. +29 −2 tests/test_parser.py
  24. +7 −0 tests/test_protocol_binary.py
  25. +264 −0 tests/test_protocol_compact.py
  26. +8 −1 tests/test_protocol_cybinary.py
  27. +96 −4 tests/test_rpc.py
  28. +31 −0 tests/test_socket.py
  29. +10 −3 tests/test_sslsocket.py
  30. +2 −2 tests/test_tornado.py
  31. +238 −40 tests/test_tracking.py
  32. +1 −1 thriftpy/__init__.py
  33. +6 −70 thriftpy/_compat.py
  34. +42 −12 thriftpy/contrib/tracking/__init__.py
  35. +45 −0 thriftpy/contrib/tracking/tracker.py
  36. +12 −2 thriftpy/contrib/tracking/tracking.thrift
  37. +318 −0 thriftpy/http.py
  38. +1 −1 thriftpy/parser/__init__.py
  39. +5 −3 thriftpy/parser/lexer.py
  40. +113 −46 thriftpy/parser/parser.py
  41. +3 −1 thriftpy/protocol/__init__.py
  42. +28 −16 thriftpy/protocol/binary.py
  43. +566 −0 thriftpy/protocol/compact.py
  44. +33 −18 thriftpy/protocol/cybin/cybin.pyx
  45. +40 −8 thriftpy/rpc.py
  46. +1 −1 thriftpy/server.py
  47. +53 −8 thriftpy/thrift.py
  48. +13 −7 thriftpy/tornado.py
  49. +1 −1 thriftpy/transport/__init__.py
  50. +3 −21 thriftpy/transport/_ssl.py
  51. +16 −16 thriftpy/transport/buffered/__init__.py
  52. +0 −1 thriftpy/transport/buffered/cybuffered.pyx
  53. +2 −0 thriftpy/transport/cybase.pxd
  54. +6 −0 thriftpy/transport/cybase.pyx
  55. +21 −18 thriftpy/transport/framed/__init__.py
  56. +0 −1 thriftpy/transport/framed/cyframed.pyx
  57. +5 −9 thriftpy/transport/memory/cymemory.pyx
  58. +20 −2 thriftpy/transport/socket.py
  59. +21 −13 thriftpy/transport/sslsocket.py
  60. +2 −2 tox.ini
5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -2,17 +2,16 @@ sudo: false
language: python

python:
- 2.6
- 2.7
- 3.3
- 3.4
- 3.5
- 3.6
- pypy

matrix:
# include test for flake8
include:
- python: 3.5
- python: 3.6
script: tox -e flake8

install:
96 changes: 96 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -4,6 +4,102 @@ Changelog
0.3.x
~~~~~

Version 0.3.9
-------------

Released on August 26, 2016.

- add support for timeout and ssl in `make_server` / `make_client` helper
funcs, via `#204`_, `#205`_ and `#229`_.
- add support for `thrift_file` path in http protocol, via `#225`_.

- preserve traceback when re-raise undeclared exception, via `#206`_.
- performance improvement by dynamically compile spec'd `__init__`
functions, via `#210`_ and `#227`_.
- performance improvement by refine cython encoding/decoding,
via `#211`_ and `#212_`.

- bugfix for type error in `cast_byte` parser and improve include dirs
function, via `#214`_
- bugfix for parse error when field begin with true/false keyword,
via `#215`_ and `#218`_.
- bugfix for `is_open` not return false when socket closed after open,
via `#230`_.

.. _`#204`: https://github.com/eleme/thriftpy/pull/204
.. _`#205`: https://github.com/eleme/thriftpy/pull/205
.. _`#206`: https://github.com/eleme/thriftpy/pull/206
.. _`#210`: https://github.com/eleme/thriftpy/pull/210
.. _`#211`: https://github.com/eleme/thriftpy/pull/211
.. _`#212`: https://github.com/eleme/thriftpy/pull/212
.. _`#214`: https://github.com/eleme/thriftpy/pull/214
.. _`#215`: https://github.com/eleme/thriftpy/pull/215
.. _`#218`: https://github.com/eleme/thriftpy/pull/218
.. _`#225`: https://github.com/eleme/thriftpy/pull/225
.. _`#227`: https://github.com/eleme/thriftpy/pull/227
.. _`#229`: https://github.com/eleme/thriftpy/pull/229
.. _`#230`: https://github.com/eleme/thriftpy/pull/230


Version 0.3.8
-------------

Released on May 3, 2016.

- add propagate decode_response to nested structs, via `#194`_.
- add support for tornado ssl, via `#196`_.

.. _`#194`: https://github.com/eleme/thriftpy/pull/194
.. _`#196`: https://github.com/eleme/thriftpy/pull/196


Version 0.3.7
-------------

Released on Mar 24, 2016.

- bugfix for a possible unicode decode error in cybin.
- use a better unhashable implementation for payload.


Version 0.3.6
-------------

Released on Mar 24, 2016.

- add compact protocol support, via `#159`_.
- add option to force return bytes on response, via `#190`_.

- bugfix for ssl socket can't be init without certfile and keyfile,
and add additional `capath` argument for SSLContext. via `#186`_.
- bugfix for set_timeout only works before socket open, via `#188`_.

.. _`#159`: https://github.com/eleme/thriftpy/pull/159
.. _`#186`: https://github.com/eleme/thriftpy/pull/186
.. _`#188`: https://github.com/eleme/thriftpy/pull/188
.. _`#190`: https://github.com/eleme/thriftpy/pull/190


Version 0.3.5
-------------

Released on Feb 16, 2016.

- fix another set_timeout backward compat issue introduced in last version.
- make thrift container struct unhashable, via `#184`_.

.. _`#184`: https://github.com/eleme/thriftpy/pull/184


Version 0.3.4
-------------

Released on Feb 3, 2016.

- fix backward compat issue introduced in last version, add back
`set_timeout` api in socket.


Version 0.3.3
-------------

17 changes: 12 additions & 5 deletions README.rst
Original file line number Diff line number Diff line change
@@ -2,6 +2,9 @@
ThriftPy
========

**Thriftpy has been deprecated, please migrate to** `thriftpy2 <https://github.com/Thriftpy/thriftpy2>`_


.. image:: http://img.shields.io/travis/eleme/thriftpy/develop.svg?style=flat
:target: https://travis-ci.org/eleme/thriftpy

@@ -76,7 +79,7 @@ And a client:
from thriftpy.rpc import make_client
client = make_client(pingpong_thrift.PingPong, '127.0.0.1', 6000)
client.ping()
print(client.ping())
See, it's that easy!

@@ -91,7 +94,7 @@ Features
Currently ThriftPy have these features (also advantages over the upstream
python lib):

- Supports python2.6+, python3.3+, pypy and pypy3.
- Supports Python 2.7, Python 3.4+, PyPy and PyPy3.

- Pure python implementation. No longer need to compile & install the 'thrift'
package. All you need is thriftpy and thrift file.
@@ -104,13 +107,17 @@ python lib):

* binary protocol (python and cython)

* buffered transport (python & cython)
* compact protocol (python and cython)

* tornado server and client (with tornado 4.0)
* json protocol

* buffered transport (python & cython)

* framed transport

* json protocol
* tornado server and client (with tornado 4.0)

* http server and client

- Can directly load thrift file as module, the sdk code will be generated on
the fly.
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -53,9 +53,9 @@
# built documents.
#
# The short X.Y version.
version = '0.3.3'
version = '0.3.9'
# The full version, including alpha/beta/rc tags.
release = '0.3.3'
release = '0.3.9'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
19 changes: 10 additions & 9 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -72,7 +72,7 @@ Features
Currently ThriftPy have these features (also advantages over the upstream
python lib):

- Supports python2.6+, python3.3+, pypy and pypy3.
- Supports Python 2.7, Python 3.4+, PyPy and PyPy3.

- Pure python implementation. No longer need to compile & install the 'thrift'
package. All you need is thriftpy and thrift file.
@@ -85,14 +85,15 @@ python lib):

* binary protocol (python and cython)

* buffered transport (python & cython)
* compact protocol (python and cython)

* tornado server and client (with tornado 4.0)
* json protocol

* framed transport
* buffered transport (python & cython)

* json protocol
* framed transport

* tornado server and client (with tornado 4.0)
- Can directly load thrift file as module, the sdk code will be generated on
the fly.

@@ -130,17 +131,17 @@ Usage Notice
Cython Binary Protocol
----------------------

The cython accelerated binary protocol is enabled by default for CPython if
available, and is disabled for Pypy.
The Cython accelerating binary protocol is enabled by default for CPython if it's
available, but disabled for PyPy.

To force use pure python version of binary protocol, you must import them from
the direct module.

.. code:: python
from thriftpy.protocol.binary import TBinaryProtocolFactory
from thriftpy.transport.transport import TBufferedTransportFactory
from thriftpy.transport.transport import TFramedTransportFactory
from thriftpy.transport.buffered import TBufferedTransportFactory
from thriftpy.transport.framed import TFramedTransportFactory
Better Module
10 changes: 6 additions & 4 deletions setup.py
Original file line number Diff line number Diff line change
@@ -19,12 +19,12 @@

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

dev_requires = [
"cython>=0.23",
"flake8>=2.8",
"flake8>=2.5",
"pytest>=2.8",
"sphinx-rtd-theme>=0.1.9",
"sphinx>=1.3",
@@ -79,6 +79,7 @@
long_description=open("README.rst").read(),
install_requires=install_requires,
tests_require=tornado_requires,
python_requires='>=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*',
extras_require={
"dev": dev_requires,
"tornado": tornado_requires
@@ -90,11 +91,12 @@
"Development Status :: 4 - Beta",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Programming Language :: Python :: 2.6",
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
"Programming Language :: Python :: Implementation :: CPython",
"Programming Language :: Python :: Implementation :: PyPy",
])
Empty file added tests/compatible/__init__.py
Empty file.
Empty file.
Loading