Commit 22bd36a6 authored by SVN-Git Migration's avatar SVN-Git Migration

Imported Upstream version 14.3.1

parent 7da43676
*.pyc
zmq/*/*.c
zmq/*/*/*.c
zmq/utils/*.json
__pycache__
build
dist
......
......@@ -8,6 +8,7 @@ python:
- 2.7
- 3.2
- 3.3
- 3.4
- pypy
env:
- ZMQ=
......@@ -37,6 +38,10 @@ matrix:
env: ZMQ=bundled
- python: 3.2
env: ZMQ=master
- python: 3.3
env: ZMQ=bundled
- python: 3.3
env: ZMQ=master
allow_failures:
- env: ZMQ=master
......
......@@ -9,6 +9,7 @@ The following people have contributed to the project:
- Alexander Else (alexander DOT else AT team DOT telstra DOT com)
- Alexander Pyhalov (apyhalov AT gmail DOT com)
- Alexandr Emelin (frvzmb AT gmail DOT com)
- Andre Caron (andre DOT l DOT caron AT gmail DOT com)
- Andrea Crotti (andrea DOT crotti DOT 0 AT gmail DOT com)
- Andrew Gwozdziewycz (git AT apgwoz DOT com)
- Baptiste Lepilleur (baptiste DOT lepilleur AT gmail DOT com)
......@@ -18,12 +19,14 @@ The following people have contributed to the project:
- Chris Laws (clawsicus AT gmail DOT com)
- Christian Wyglendowski (christian AT bu DOT mp)
- Christoph Gohlke (cgohlke AT uci DOT edu)
- Curtis (curtis AT tinbrain DOT net)
- Cyril Holweck (cyril DOT holweck AT free DOT fr)
- Dan Colish (dcolish AT gmail DOT com)
- Daniel Lundin (dln AT eintr DOT org)
- Daniel Truemper (truemped AT googlemail DOT com)
- Douglas Creager (douglas DOT creager AT redjack DOT com)
- Eduardo Stalinho (eduardooc DOT 86 AT gmail DOT com)
- Eren Güven (erenguven0 AT gmail DOT com)
- Erick Tryzelaar (erick DOT tryzelaar AT gmail DOT com)
- Erik Tollerud (erik DOT tollerud AT gmail DOT com)
- FELD Boris (lothiraldan AT gmail DOT com)
......@@ -33,6 +36,7 @@ The following people have contributed to the project:
- Frank Wiles (frank AT revsys DOT com)
- Gavrie Philipson (gavriep AT il DOT ibm DOT com)
- Godefroid Chapelle (gotcha AT bubblenet DOT be)
- Greg Banks (gbanks AT mybasis DOT com)
- Greg Ward (greg AT gerg DOT ca)
- Guido Goldstein (github AT a-nugget DOT de)
- Ivo Danihelka (ivo AT danihelka DOT net)
......@@ -43,9 +47,12 @@ The following people have contributed to the project:
- Justin Bronder (jsbronder AT gmail DOT com)
- Justin Riley (justin DOT t DOT riley AT gmail DOT com)
- Marc Abramowitz (marc AT marc-abramowitz DOT com)
- Matthew Aburn (mattja6 AT gmail DOT com)
- Michel Pelletier (pelletier DOT michel AT gmail DOT com)
- Michel Zou (xantares09 AT hotmail DOT com)
- Min Ragan-Kelley (benjaminrk AT gmail DOT com)
- Nell Hardcastle (nell AT dev-nell DOT com)
- Nicholas Pilkington (nicholas DOT pilkington AT gmail DOT com)
- Nicholas Piël (nicholas AT nichol DOT as)
- Nick Pellegrino (npellegrino AT mozilla DOT com)
- Nicolas Delaby (nicolas DOT delaby AT ezeep DOT com)
......@@ -59,6 +66,7 @@ The following people have contributed to the project:
- Ryan Kelly (ryan AT rfk DOT id DOT au)
- Scott Maxwell (scott AT codecobblers DOT com)
- Scott Sadler (github AT mashi DOT org)
- Simon Knight (simon DOT knight AT gmail DOT com)
- Stefan Friesel (sf AT cloudcontrol DOT de)
- Stefan van der Walt (stefan AT sun DOT ac DOT za)
- Stephen Diehl (stephen DOT m DOT diehl AT gmail DOT com)
......@@ -68,7 +76,7 @@ The following people have contributed to the project:
- Torsten Landschoff (torsten DOT landschoff AT dynamore DOT de)
- Vadim Markovtsev (v DOT markovtsev AT samsung DOT com)
- Zbigniew Jędrzejewski-Szmek (zbyszek AT in DOT waw DOT pl)
- hugo shi (hugoshi AT bleb2 DOT (none))
- hugo shi (hugoshi AT bleb2 DOT (none))
- jdgleeson (jdgleeson AT mac DOT com)
- kyledj (kyle AT bucebuce DOT com)
- spez (steve AT hipmunk DOT com)
......@@ -77,7 +85,7 @@ The following people have contributed to the project:
as reported by:
git log --all --format='- %aN (%aE)' | sort -u | sed 's/@/ AT /1' | sed -e 's/\./ DOT /g'
git log --all --format='- %aN (%aE)' | sort -u | sed 's/@/ AT /1' | sed -e 's/\.\([^ ]\)/ DOT \1/g'
with some adjustments.
......
"""utilities for fetching build dependencies."""
#-----------------------------------------------------------------------------
# Copyright (c) 2012 Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
#
# This bundling code is largely adapted from pyzmq-static's get.sh by
# Brandon Craig-Rhodes, which is itself BSD licensed.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
import os
import shutil
......
"""Config functions"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 Brian Granger, Min Ragan-Kelley
# Copyright (C) PyZMQ Developers
#
# This file is part of pyzmq, copied and adapted from h5py.
# h5py source used under the New BSD license
......
......@@ -11,14 +11,8 @@ Currently generates the following files from templates:
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013 Brian E. Granger & Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import os
import sys
......
"""Detect zmq version"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 Brian Granger, Min Ragan-Kelley
# Copyright (C) PyZMQ Developers
#
# This file is part of pyzmq, copied and adapted from h5py.
# h5py source used under the New BSD license
......
......@@ -228,13 +228,13 @@
#define ZMQ_HAVE_TCP_KEEPALIVE 1
/* Whether TCP_KEEPCNT is supported. */
#define ZMQ_HAVE_TCP_KEEPCNT 1
/* #undef ZMQ_HAVE_TCP_KEEPCNT */
/* Whether TCP_KEEPIDLE is supported. */
/* #undef ZMQ_HAVE_TCP_KEEPIDLE */
/* Whether TCP_KEEPINTVL is supported. */
#define ZMQ_HAVE_TCP_KEEPINTVL 1
/* #undef ZMQ_HAVE_TCP_KEEPINTVL */
/* Have uio.h header. */
#define ZMQ_HAVE_UIO 1
......
"""misc build utility functions"""
#-----------------------------------------------------------------------------
# Copyright (C) 2012 Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
def customize_mingw(cc):
# strip -mno-cygwin from mingw32 (Python Issue #12641)
......
"""logging"""
#-----------------------------------------------------------------------------
# Copyright (C) 2011 Brian Granger, Min Ragan-Kelley
# Copyright (C) PyZMQ Developers
#
# This file is part of pyzmq, copied and adapted from h5py.
# h5py source used under the New BSD license
......
......@@ -9,10 +9,20 @@ Changes in PyZMQ
This is a coarse summary of changes in pyzmq versions. For a real changelog, consult the
`git log <https://github.com/zeromq/pyzmq/commits>`_
14.3.1
======
Minor bugfixes to pyzmq 14.3:
- Fixes to building bundled libzmq on OS X < 10.9
- Fixes to import-failure warnings on Python 3.4
- Fixes to tests
- Pull upstream fixes to zmq.ssh for ssh multiplexing
14.3.0
======
- PyZMQ no longer calls :meth:`Socket.close` or :meth:`Context.term` during process cleanup.
- PyZMQ no longer calls :meth:`.Socket.close` or :meth:`.Context.term` during process cleanup.
Changes to garbage collection in Python 3.4 make this impossible to do sensibly.
- :meth:`ZMQStream.close` closes its socket immediately, rather than scheduling a timeout.
- Raise the original ImportError when importing zmq fails.
......
......@@ -43,21 +43,37 @@ but it is less convenient. First, you must instruct the tornado IOLoop to use th
.. sourcecode:: python
from tornado.ioloop import IOLoop
from zmq.eventloop.ioloop import ZMQPoller
from zmq.eventloop.ioloop import ZMQIOLoop
loop = IOLoop(ZMQPoller())
loop = ZMQIOLoop()
Then, when you instantiate tornado and ZMQStream objects, you must pass the `io_loop`
argument to ensure that they use this loop, instead of the global instance. You can
install this IOLoop as the global tornado instance, with:
argument to ensure that they use this loop, instead of the global instance.
This is especially useful for writing tests, such as this:
.. sourcecode:: python
from tornado.testing import AsyncTestCase
from zmq.eventloop.ioloop import ZMQIOLoop
from zmq.eventloop.zmqstream import ZMQStream
class TestZMQBridge(AsyncTestCase):
# Use a ZMQ-compatible I/O loop so that we can use `ZMQStream`.
def get_new_ioloop(self):
return ZMQIOLoop()
You can also manually install this IOLoop as the global tornado instance, with:
.. sourcecode:: python
from zmq.eventloop.ioloop import ZMQIOLoop
loop = ZMQIOLoop()
loop.install()
but it will **NOT** be the global *pyzmq* IOLoop instance, so it must still be passed to
your ZMQStream constructors.
but it will **NOT** be the global *pyzmq* IOLoop instance, so it must still be
passed to your ZMQStream constructors.
:meth:`send`
......
......@@ -44,4 +44,3 @@ if __name__ == "__main__":
ioloop.IOLoop.instance().start()
#!/usr/bin/env python
# coding: utf-8
#-----------------------------------------------------------------------------
# Copyright (c) 2013 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
#
# Some original test code Copyright (c) 2007-2010 iMatix Corporation,
# Used under LGPLv3
#-----------------------------------------------------------------------------
import argparse
import time
......
#!/usr/bin/env python
#-----------------------------------------------------------------------------
# Copyright (c) 2012 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
#
# The `configure` subcommand is copied and adaped from h5py
# h5py source used under the New BSD license
......@@ -18,9 +14,6 @@
# pyzmq-static: <https://github.com/brandon-rhodes/pyzmq-static>
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
from __future__ import with_statement
import copy
......@@ -932,6 +925,46 @@ cmdclass = {'test':TestCommand, 'clean':CleanCommand, 'revision':GitRevisionComm
'sdist': CheckSDist, 'constants': ConstantsCommand,
}
if 'bdist_wheel' in sys.argv and sys.platform == 'darwin':
from wheel.bdist_wheel import bdist_wheel
class bdist_wheel_mac_tag(bdist_wheel):
"""add 'current' platform tags to wheels
A 10.6-intel wheel works on all 10.X >= 10.6 and arch in 32,64,intel.
Since that would produce a ludicrous filename, just add the two most common:
- current-intel
- current-x86_64
partial workaround for pypa/pip#1465
"""
def get_tag(self):
import platform
impl, abi, plat = bdist_wheel.get_tag(self)
plat_tag_re = re.compile(r'macosx_(\d+)_(\d+)_(.+)')
m = plat_tag_re.match(plat)
if m:
plat_tags = [plat]
major, minor, arch = m.groups()
arches = [arch]
if arch == 'intel':
arches.append('x86_64')
host_list = re.findall('\d+', platform.mac_ver()[0])
host = (int(host_list[0]), int(host_list[1]))
host_s = '%s_%s' % tuple(host_list[:2])
target = (int(major), int(minor))
if host > target or len(arches) > 1:
for arch in arches:
plat_tags.append('macosx_%s_%s' % (host_s, arch))
plat = '.'.join(sorted(set(plat_tags)))
return (impl, abi, plat)
cmdclass['bdist_wheel'] = bdist_wheel_mac_tag
def makename(path, ext):
return os.path.abspath(pjoin('zmq', *path)) + ext
......@@ -1090,7 +1123,7 @@ def extract_version():
with open(pjoin('zmq', 'sugar', 'version.py')) as f:
while True:
line = f.readline()
if line.startswith('# Code'):
if line.startswith('VERSION'):
lines = []
while line and not line.startswith('def'):
lines.append(line)
......
"""Python bindings for 0MQ."""
#-----------------------------------------------------------------------------
# Copyright (C) 2010-2012 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import os
import sys
......
"""Base implementation of 0MQ authentication."""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import logging
......
"""0MQ authentication related functions and classes."""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import datetime
......
......@@ -3,14 +3,8 @@
.. versionadded:: 14.1
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from zmq.eventloop import ioloop, zmqstream
from .base import Authenticator
......
......@@ -3,14 +3,8 @@
.. versionadded:: 14.1
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import logging
from threading import Thread
......
"""Import basic exposure of libzmq C API as a backend"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Brian Granger, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import os
import platform
......@@ -38,9 +29,14 @@ else:
_ns = select_backend(first)
except Exception:
exc_info = sys.exc_info()
exc = exc_info[1]
try:
_ns = select_backend(second)
except ImportError:
# prevent 'During handling of the above exception...' on py3
# can't use `raise ... from` on Python 2
if hasattr(exc, '__cause__'):
exc.__cause__ = None
# raise the *first* error, not the fallback
reraise(*exc_info)
......
"""CFFI backend (for PyPY)"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Felipe Cruz
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from zmq.backend.cffi import (constants, error, message, context, socket,
_poll, devices, utils)
......
# coding: utf-8
"""The main CFFI wrapping of libzmq"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Felipe Cruz
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import json
import os
......@@ -22,10 +13,6 @@ from cffi import FFI
from zmq.utils.constant_names import all_names, no_prefix
#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------
ffi = FFI()
base_zmq_version = (3,2,2)
......
# coding: utf-8
"""zmq poll function"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Felipe Cruz
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from ._cffi import C, ffi, zmq_version_info
......
# coding: utf-8
"""zmq Context class"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Felipe Cruz
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import weakref
......
# coding: utf-8
"""zmq device functions"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Felipe Cruz
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from ._cffi import C, ffi, zmq_version_info
from .socket import Socket
......
"""zmq error functions"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Felipe Cruz
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from ._cffi import C, ffi
......
"""Dummy Frame object"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Felipe Cruz
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from ._cffi import ffi, C
......
# coding: utf-8
"""zmq Socket class"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Felipe Cruz
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
import random
import codecs
......
# coding: utf-8
"""miscellaneous zmq_utils wrapping"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Felipe Cruz, Min Ragan-Kelley
#
# This file is part of pyzmq
#
# Distributed under the terms of the New BSD License. The full license is in
# the file COPYING.BSD, distributed as part of this software.
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Modified BSD License.
from ._cffi import ffi, C
......
"""Python bindings for core 0MQ objects."""
#
# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
#
# This file is part of pyzmq.
#
# pyzmq is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# pyzmq is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Lesser GNU General Public License for more details.
#
# You should have received a copy of the Lesser GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Copyright (C) PyZMQ Developers
# Distributed under the terms of the Lesser GNU Public License (LGPL).
from . import (constants, error, message, context,
socket, utils, _poll, _version, _device )
......
"""0MQ Context class."""
# coding: utf-8
#
# Copyright (c) 2010-2011 Brian E. Granger & Min Ragan-Kelley
#
# This file is part of pyzmq.
#
# pyzmq is free software; you can redistribute it and/or modify it under
# the terms of the Lesser GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# pyzmq is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# Lesser GNU General Public License for more details.
#
# You should have received a copy of the Lesser GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
#-----------------------------------------------------------------------------
# Imports
#-----------------------------------------------------------------------------
# Copyright (c) PyZMQ Developers.
# Distributed under the terms of the Lesser GNU Public License (LGPL).
from libc.stdlib cimport free, malloc, realloc
......@@ -34,9 +14,6 @@ cdef extern from "getpid_compat.h":
from zmq.error import ZMQError
from zmq.backend.cython.checkrc cimport _check_rc
#-----------------------------------------------------------------------------
# Code
#-----------------------------------------------------------------------------
_instance = None
......
"""Import basic exposure of libzmq C API as a backend"""
#-----------------------------------------------------------------------------
# Copyright (C) 2013 Brian Granger, Min Ragan-Kelley
#