Commits on Jul 9, 2016
  1. @mreiferson

    bump: v0.7.0

    mreiferson committed May 16, 2016
Commits on Jun 10, 2016
  1. @mreiferson

    Merge pull request #158 from virtuald/minor

    Minor performance tweaks
    mreiferson committed on GitHub Jun 10, 2016
  2. @virtuald
Commits on Jun 6, 2016
  1. @mreiferson

    Merge pull request #156 from ploxiln/optim_backofftimer

    reader: optimize BackoffTimer using float
    mreiferson committed Jun 6, 2016
  2. @mreiferson

    Merge pull request #157 from virtuald/struct

    Reuse struct objects
    mreiferson committed Jun 6, 2016
  3. @ploxiln

    optimize BackoffTimer by caching and short-circuiting

    cache the calculation+conversion for get_interval()
    if get_interval() is 0, then success() can be short-circuited
    ploxiln committed Jun 4, 2016
Commits on Jun 5, 2016
  1. @virtuald

    Reuse struct objects

    virtuald committed Jun 5, 2016
Commits on May 16, 2016
  1. @mreiferson

    Merge pull request #150 from nickstenning/py3-compat

    Python 3 compatibility, round two
    mreiferson committed May 16, 2016
Commits on May 13, 2016
  1. @nickstenning

    Support Python 2.6 struct without compromising on unicode_literals

    Using `from __future__ import unicode_literals` ensures that the use of
    bytestrings vs. text is consistent between Python 2.x and Python 3.x --
    it means, for example, that we don't accidentally add code for Python
    2.x which deals in str objects, which suddenly become unicode in Python
    3.
    
    Unfortunately, the `struct` package in Python 2.6 poses a problem, as it
    only accepts `str` values for its `fmt` argument, and raises a TypeError
    if you pass it `unicode`. Using
    
      b'bytestring literals'
    
    is an option, but it seems ugly when the parameter is clearly text (even
    if it is guaranteed to be ASCII). It seems wrong to make this concession
    for Python 2.6 when Python 2.7 and 3.x do the right thing.
    
    So, we introduce a compat layer for `struct.pack` and `struct.unpack`
    which can be removed once support for Python 2.6 is dropped.
    nickstenning committed Feb 14, 2016
  2. @nickstenning
  3. @nickstenning

    Ensure compatibility with recent mock

    Since mock v1.1.0, MagicMock objects are not orderable by default,
    meaning that we need to return an orderable object from the mock
    `ioloop.time()` method.
    
    We also make the call assertions explicit using `mock.call` objects
    rather than relying on tuple unpacking.
    nickstenning committed Feb 14, 2016
  4. @nickstenning
  5. @nickstenning

    Use the correct division operator in Py3

    The division operator has changed in Python 3. A simple
    
        int / int
    
    operation, which in Python 2 would have returned an integer, now returns
    a float.
    
    See: https://www.python.org/dev/peps/pep-0238/
    nickstenning committed Feb 14, 2016
  6. @nickstenning

    Make it clear that all protocol ops act on bytestrings

    Running the tests as-was in Python 3.x results in a number of errors
    because in Python 2.x the literal
    
        'foo'
    
    is a bytestring, whereas it is a character sequence (a unicode object)
    in Python 3.x. All protocol-level operations act on bytestrings, and
    indeed raise errors if they are passed non-bytestrings, so this commit
    makes liberal use of the literal form
    
        b'foo'
    
    to make this clear. This is compatible with Python 2.6 and above.
    nickstenning committed Feb 14, 2016
  7. @nickstenning
  8. @nickstenning

    Don't rely on map returning a list

    The `map` builtin returns a list in Python 2.x, and an iterator in
    Python 3.x. Rather than being caught out by this, just use a list
    comprehension, which works in both.
    nickstenning committed Feb 14, 2016
  9. @nickstenning

    Ensure integer typechecks are Py3 compatible

    The `long` type no longer exists in Python 3. Add an `integer_types`
    tuple to the compat module so that checks for integer types work in
    Python 2 and 3.
    nickstenning committed Feb 14, 2016
  10. @nickstenning

    Make use of iter{items,values} Py3 compatible

    Collection iterators got renamed in Python 3 from
    iter{keys,values,items} to plain {keys,values,items}. Expose top-level
    functions in the compat module to ensure the correct methods are called
    on collections.
    nickstenning committed Feb 14, 2016
  11. @nickstenning

    Make urllib/urlparse imports Py3 compatible

    The urlencode function moved in Python 3, as did the urlparse library.
    This commit ensures that both are referenced through the `nsq._compat`
    module.
    nickstenning committed Feb 14, 2016
  12. @nickstenning

    Make string/bytes conversions and typechecking Py3 compatible

    This commit introduces a compatibility module, `nsq._compat`, designed
    for package-internal use only, which makes it easier to write code that
    is compatible with both Python 2.x and 3.x.
    
    Throughout the codebase, the following replacements are made:
    
    - `(str, unicode)` -> `nsq._compat.string_types`, which becomes `(str,)`
      on Python 3.
    - `unicode` -> `nsq._compat.text_type`, which becomes `str` on Python 3.
    - Explicit conversions of strings to UTF-8 byte sequences are now done
      with `nsq._compat.to_bytes` which works on both Python 2 and Python 3.
    
    For more on this approach to Python 3 compatibility, see this blog post
    from Armin Ronacher:
    
      http://lucumr.pocoo.org/2013/5/21/porting-to-python-3-redux/
    nickstenning committed Feb 14, 2016
  13. @nickstenning

    Make exception catching syntax Python 3 compatible

    The form "except Exception as e" is compatible with all versions of
    Python from 2.6, and the older "except Exception, e" format is a
    SyntaxError in Python 3.x.
    
    See: https://www.python.org/dev/peps/pep-3110/
    nickstenning committed Feb 14, 2016
Commits on Feb 21, 2016
  1. @mreiferson

    bump: v0.6.9

    mreiferson committed Feb 21, 2016
Commits on Feb 14, 2016
  1. @mreiferson

    Merge pull request #149 from nsqio/mreiferson-patch-1

    test: update build matrix
    mreiferson committed Feb 14, 2016
  2. @mreiferson @mreiferson

    test: update build matrix

    mreiferson committed with mreiferson Feb 14, 2016
  3. @mreiferson

    Merge pull request #148 from nickstenning/travis-fixes

    Tidy up travis_test.sh and ensure tests actually run
    mreiferson committed Feb 14, 2016
  4. @mreiferson

    Merge pull request #147 from nickstenning/workaround-autospec-bug

    Work around a bug in mock's autospec support
    mreiferson committed Feb 14, 2016
  5. @nickstenning

    Tidy up travis_test.sh and ensure tests actually run

    Currently, the tests aren't running on Travis, as we "cd snappy" and
    never "cd ..", meaning that py.test discovery doesn't find any tests to
    run.
    
    This commit tidies up the `travis_test.sh` script a little, improves the
    output on Travis by folding non-test-related output, and ensures that
    we're in the correct directory when we run py.test.
    nickstenning committed Feb 14, 2016
  6. @nickstenning

    Work around a bug in mock's autospec support

    In order to get the tests passing with recent versions of mock, we need
    to omit the `autospec=True` parameter for `socket.socket` mocks.
    
    See:
    
      testing-cabal/mock#323
    nickstenning committed Feb 14, 2016
Commits on Feb 5, 2016
  1. @mreiferson

    Merge pull request #146 from klucar/master

    set max_rdy_count to value received from IDENTIFY response. see #131
    mreiferson committed Feb 5, 2016
  2. @klucar
  3. @mreiferson

    Merge pull request #144 from iameugenejo/infinite-attempts

    #142 allow infinite attempts
    mreiferson committed Feb 4, 2016
  4. #142 allow infinite attempts

    Eugene Jo committed Feb 4, 2016
Commits on Dec 21, 2015
  1. @mreiferson

    Merge pull request #140 from iameugenejo/dpub

    #139 support DPUB
    mreiferson committed Dec 21, 2015
  2. @iameugenejo

    #139 support DPUB

    iameugenejo committed Dec 21, 2015
Commits on Oct 18, 2015
  1. @mreiferson

    docs: update README typo

    mreiferson committed Oct 18, 2015