Commit e91787da authored by Julian Taylor's avatar Julian Taylor

Import pyzmq_17.0.0.orig.tar.gz

parent f9725a41
.idea
.vagrant
*.pyc
zmq/backend/cython/*.c
zmq/devices/*.c
......@@ -23,3 +25,5 @@ examples/security/private_keys
wheelhouse
.coverage
.cache
*.pickle
.ipynb_checkpoints
language: python
dist: trusty
cache:
apt
pip
- apt
- pip
python:
- 2.7
- 3.5
- pypy
- 3.6
- pypy2.7-5.8.0
- pypy3.5-5.8.0
env:
- ZMQ=
- ZMQ=bundled
......@@ -27,22 +29,45 @@ before_install:
unzip libzmq.zip
pushd "$ZMQ-master"
./autogen.sh
./configure
./configure --enable-drafts
make -j
sudo make install
sudo ldconfig
popd
export ZMQ=/usr/local
export ZMQ_DRAFT_API=1
fi
- pip install -r test-requirements.txt
- |
if [[ "$TORNADO" == "master" ]]; then
pip install https://github.com/tornadoweb/tornado/archive/master.zip
fi
- |
if [[ "$NOTORNADO" == "1" ]]; then
pip uninstall -yq tornado
fi
install:
- python setup.py build_ext --inplace --zmq=$ZMQ
matrix:
include:
- python: pypy
env: ZMQ=bundled
- python: 3.6-dev
env: ZMQ=bundled
- python: 3.6
env:
- ZMQ=
- NOTORNADO=1
- python: 3.6
env:
- ZMQ=
- TORNADO=master
- python: 2.7
env:
- ZMQ=
- TORNADO=master
- python: 3.5
env: ZMQ=libzmq
- python: 3.4
......@@ -53,9 +78,6 @@ matrix:
env: ZMQ=zeromq3-x
- python: 3.3
env: ZMQ=
# FIXME: pypy3 is still on unsupported Python 3.2
# - python: pypy3
# env: ZMQ=
- python: nightly
env: ZMQ=
- python: nightly
......
# Permission to Relicense under MPLv2 or BSD
Most of pyzmq is licensed under [3-Clause BSD](https://opensource.org/licenses/BSD-3-Clause).
For historical reasons, the 'core' of pyzmq (the low-level Cython bindings)
is licensed under LGPLv3, like libzmq itself.
libzmq is in the process of moving away from LGPL to the [Mozilla Public License, version
2](https://www.mozilla.org/en-US/MPL/2.0/).
I'd like to take this opportunity to follow libzmq's example and also eliminate LGPL from pyzmq.
For a similarly copyleft license, MPLv2 can be used for the core.
However, I would prefer to update the core to follow the example of the rest of pyzmq,
and adopt the 3-Clause BSD license.
This directory collects grants from individuals and firms that hold
copyrights in pyzmq to permit licensing the pyzmq code under
the MPLv2 or BSD license. See
the [0MQ Licensing Page](http://zeromq.org/area:licensing) and
[libzmq relicensing effort](https://github.com/zeromq/libzmq/pull/1917)
for some background information.
Please create a separate file in this directory for each individual
or firm holding copyright in pyzmq core, named after the individual or
firm holding the copyright.
Each patch must be made with a GitHub handle that is clearly
associated with the copyright owner, to guarantee the identity of
the signatory. Please avoid changing the files created by other
individuals or firms granting a copyright license over their
copyrights (if rewording is required contact them and ask them to
submit an updated version). This makes it easier to verify that
the license grant was made by an authorized GitHub account.
#!/usr/bin/env python3
"""Get the authors of the LGPL-licensed subset of pyzmq (Cython bindings)"""
from collections import defaultdict
from itertools import chain
from os.path import abspath, dirname, join
import re
import git
here = dirname(__file__)
root = dirname(abspath(here))
repo = git.Repo(root)
LAST_CORE_COMMIT = 'db1d4d2f2cdd97955a7db620e667a834920a938a'
PRE_CORE_COMMIT = 'd4e3453b012962fc9bf6ed621019b395f968340c'
EXCLUDED = {
# docstring only:
'c2db4af3c591aae99bf437a223d97b30ecbfcd38',
'7b1ac07a3bbffe70af3adcd663c0cbe6f2a724f7',
'ce97f46881168c4c05d7885dc48a430c520a9683',
'14c16a97ffa95bf645ab27bf5b06c3eabda30e5e',
# accidental swapfile
'93150feb4a80712c6a379f79d561fbc87405ade8',
}
def get_all_commits():
return chain(
repo.iter_commits('master', 'zmq/backend/cython'),
repo.iter_commits(LAST_CORE_COMMIT, 'zmq/core'),
repo.iter_commits(PRE_CORE_COMMIT, ['zmq/_zmq.*']),
)
mailmap = {}
email_names = {}
pat = re.compile(r'\<([^\>]+)\>')
with open(join(root, '.mailmap')) as f:
for line in f:
if not line.strip():
continue
dest, src = pat.findall(line)
mailmap[src] = dest
email_names[dest] = line[:line.index('<')].strip()
author_commits = defaultdict(lambda : [])
for commit in get_all_commits():
# exclude some specific commits (e.g. docstring typos)
if commit.hexsha in EXCLUDED:
continue
# exclude commits that only touch generated pxi files in backend/cython
backend_cython_files = {
f for f in commit.stats.files
if f.startswith('zmq/backend/cython')
}
if backend_cython_files and backend_cython_files.issubset({
'zmq/backend/cython/constant_enums.pxi',
'zmq/backend/cython/constants.pxi',
}):
continue
email = commit.author.email
email = mailmap.get(email, email)
name = email_names.setdefault(email, commit.author.name)
author_commits[email].append(commit)
def sort_key(email_commits):
commits = email_commits[1]
return (len(commits), commits[0].authored_date)
for email, commits in sorted(author_commits.items(), key=sort_key, reverse=True):
if len(commits) <= 2:
msg = '%s (%s)' % (' '.join(c.hexsha[:12] for c in commits), commits[0].authored_datetime.year)
else:
msg = "{commits} commits ({start}-{end})".format(
commits=len(commits),
start=commits[-1].authored_datetime.year,
end=commits[0].authored_datetime.year,
)
print("- [ ] {name} {email}: {msg}".format(
name=email_names[email],
email=email,
msg=msg,
))
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL
This is a statement by Chris Laws
that grants permission to relicense its copyrights in the Python ZeroMQ bindings
(pyzmq) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current PyZMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the GitHub handle "claws", with
commit author "Chris Laws clawsicus@gmail.com", are copyright of Chris Laws.
This document hereby grants the pyzmq project team permission to relicense pyzmq,
including all past, present, and future contributions of the author listed above.
Chris Laws
2017/07/18
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL
This is a statement by Brian E. Granger
that grants permission to relicense its copyrights in the Python ZeroMQ bindings
(pyzmq) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current PyZMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the GitHub handle "ellisonbg", with
commit author "Brian E. Granger", are copyright of Brian E. Granger.
This document hereby grants the pyzmq project team permission to relicense pyzmq,
including all past, present, and future contributions of the author listed above.
Brian Ellison Granger
2017/07/18
This is a statement by Frank Wiles
that grants permission to relicense its copyrights in the Python ZeroMQ bindings
(pyzmq) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current PyZMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the GitHub handle "frankwiles", with
commit author "Frank Wiles <frank@revsys.com>", are copyright of Frank Wiles .
This document hereby grants the libzmq project team to relicense pyzmq,
including all past, present and future contributions of the author listed above.
Frank Wiles
2017/07/17
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL
This is a statement by Julian Taylor
that grants permission to relicense its copyrights in the Python ZeroMQ bindings
(pyzmq) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current PyZMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the GitHub handle "juliantaylor", with
commit author "Julian Taylor <jtaylor.debian@googlemail.com>", are copyright of Julian Taylor.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Julian Taylor
2017/07/19
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL
This is a statement by LedgerX LLC. that grants permission to relicense its copyrights in the Python ZeroMQ bindings (pyzmq) under the Mozilla Public License v2 (MPLv2).
A portion of the commits made by the GitHub handle "amrali", with commit author "Amr Ali <amr@ledgerx.com>", are copyright of LedgerX LLC. This document hereby grants the pyzmq project team permission to relicense pyzmq, including all past, present, and future contributions of the author listed above.
Amr Ali
2017/09/11
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL
This is a statement by Boris Feld that grants permission to relicense its
copyrights in the Python ZeroMQ bindings (pyzmq) under the Mozilla Public
License v2 (MPLv2) or any other Open Source Initiative approved license chosen
by the current PyZMQ BDFL (Benevolent Dictator for Life).
A portion of the commits made by the GitHub handle "Lothiraldan", with commit
author "FELD Boris <lothiraldan@gmail.com>", are copyright of Boris Feld. This
document hereby grants the pyzmq project team permission to relicense pyzmq,
including all past, present, and future contributions of the author listed
above.
Boris Feld 2017/07/18
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL
This is a statement by Min Ragan-Kelley
that grants permission to relicense its copyrights in the libzmq C++
library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current PyZMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the GitHub handle "minrk", with
commit author "Min RK benjaminrk@gmail.com", are copyright of Min Ragan-Kelley.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Min Ragan-Kelley
2017/07/17
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL
This is a statement by Thomas Kluyver
that grants permission to relicense its copyrights in the Python ZeroMQ bindings
(pyzmq) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current PyZMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the GitHub handle "takluyver", with
commit author "Thomas Kluyver <takowl@gmail.com>", are copyright of Thomas Kluyver.
This document hereby grants the libzmq project team to relicense libzmq,
including all past, present and future contributions of the author listed above.
Thomas Kluyver
2017/07/18
# Permission to Relicense under BSD
This is a statement by {{ name of company / name of individual }}
that grants permission to relicense its copyrights in the Python ZeroMQ bindings
(pyzmq) under the 3-Clause BSD License (BSD3).
A portion of the commits made by the Github handle "{{github username}}", with
commit author "{{github commit author}}", are copyright of {{ name }}.
This document hereby grants the pyzmq project team permission to relicense pyzmq,
including all past, present, and future contributions of the author listed above.
{{ Full Name }}
{{ creation date of document (format: yyyy/mm/dd) }}
# Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL
This is a statement by {{ name of company / name of individual }}
that grants permission to relicense its copyrights in the Python ZeroMQ bindings
(pyzmq) under the Mozilla Public License v2 (MPLv2) or any other
Open Source Initiative approved license chosen by the current PyZMQ
BDFL (Benevolent Dictator for Life).
A portion of the commits made by the GitHub handle "{{github username}}", with
commit author "{{github commit author}}", are copyright of {{ name }} .
This document hereby grants the pyzmq project team permission to relicense pyzmq,
including all past, present, and future contributions of the author listed above.
{{ Full Name }}
{{ creation date of document (format: yyyy/mm/dd) }}
# Permission to Relicense under MPLv2
This is a statement by {{ name of company / name of individual }}
that grants permission to relicense its copyrights in the Python ZeroMQ bindings
(pyzmq) under the Mozilla Public License v2 (MPLv2).
A portion of the commits made by the GitHub handle "{{github username}}", with
commit author "{{github commit author}}", are copyright of {{ name }}.
This document hereby grants the pyzmq project team permission to relicense pyzmq,
including all past, present, and future contributions of the author listed above.
{{ Full Name }}
{{ creation date of document (format: yyyy/mm/dd) }}
#e -*- mode: ruby -*-
# vi: set ft=ruby :
# This will setup a clean Ubuntu1404 LTS env
$script = <<SCRIPT
add-apt-repository ppa:fkrull/deadsnakes-python2.7
apt-get update
apt-get install -y python-pip python3-pip python-dev git htop virtualenvwrapper python2.7 python-virtualenv python-support cython \
git build-essential libtool pkg-config autotools-dev autoconf automake cmake uuid-dev libpcre3-dev valgrind \
libffi-dev
SCRIPT
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = "2"
VAGRANTFILE_LOCAL = 'Vagrantfile.local'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
config.vm.box = 'ubuntu/trusty64'
config.vm.provision "shell", inline: $script
config.vm.provider :virtualbox do |vb|
vb.customize ["modifyvm", :id, "--cpus", "2", "--ioapic", "on", "--memory", "512" ]
vb.customize ["setextradata", :id, "VBoxInternal2/SharedFoldersEnableSymlinksCreate/v-root", "1"]
end
if File.file?(VAGRANTFILE_LOCAL)
external = File.read VAGRANTFILE_LOCAL
eval external
end
end
shallow_clone: false
skip_branch_with_pr: true
clone_depth: 1
# mostly copied from
environment:
global:
......@@ -7,6 +11,12 @@ environment:
CMD_IN_ENV: "cmd /E:ON /V:ON /C .\\tools\\run_with_env.cmd"
matrix:
- PYTHON: "C:\\Python36"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: 32
- PYTHON: "C:\\Python36-x64"
PYTHON_VERSION: "3.6.x"
PYTHON_ARCH: 64
- PYTHON: "C:\\Python35"
PYTHON_VERSION: "3.5.x"
PYTHON_ARCH: 32
......@@ -28,6 +38,9 @@ environment:
matrix:
fast_finish: true
cache:
- C:\Users\appveyor\AppData\Local\pip\Cache
install:
# If there is a newer build queued for the same PR, cancel this one.
# The AppVeyor 'rollout builds' option is supposed to serve the same
......@@ -50,8 +63,10 @@ install:
- "python -c \"import struct; print(struct.calcsize('P') * 8)\""
# Upgrade to the latest version of pip to avoid it displaying warnings
# about it being out of date.
- "%CMD_IN_ENV% pip install --disable-pip-version-check --user --upgrade pip setuptools wheel cython"
# about it being out of date. Install wheel package separate so that
# we also cache wheels
- pip install --upgrade pip wheel
- pip install --upgrade setuptools cython -r test-requirements.txt
build_script:
# Build the compiled extension
......@@ -61,11 +76,21 @@ build_script:
test_script:
# Run the project tests
- ps: cmd /c 'cd dist & python -c "import zmq; print(zmq.zmq_version())"'
- cd dist
- python -c "import zmq; print(zmq.zmq_version())"
# ``test_win32_shim`` will create a CTLR-C event which will be sent
# to all processes that share the same group id and creates problems
# with the appveyor build. To avoid the problems we single out that
# specific test run it using the ``start`` command and then check
# the junit report to pass or fail the build.
- pytest -vsx -m "not new_console" --pyargs zmq.tests
- start /W pytest -vsx -m "new_console" --pyargs zmq.tests --junit-xml=../results.xml
- python ../tools/check_junit_result.py ../results.xml
- cd ..
after_test:
# If tests are successful, create binary packages for the project.
- ps: "ls dist"
- ps: ls dist
artifacts:
# Archive the generated packages in the ci.appveyor.com build report.
......@@ -73,4 +98,3 @@ artifacts:
#on_success:
# - TODO: upload the content of dist/*.whl to a public wheelhouse
#
\ No newline at end of file
......@@ -60,10 +60,14 @@ def get_env_args():
settings = {}
zmq = os.environ.get("ZMQ_PREFIX", None)
if zmq is not None:
zmq = os.environ.get("ZMQ_PREFIX")
if zmq:
debug("Found environ var ZMQ_PREFIX=%s" % zmq)
settings['zmq_prefix'] = zmq
draft_api = os.environ.get("ZMQ_DRAFT_API")
if draft_api:
debug("Found environ var ZMQ_DRAFT_API=%s" % draft_api)
settings['zmq_draft_api'] = int(draft_api)
return settings
......@@ -141,6 +145,7 @@ def discover_settings(conf_base=None):
""" Discover custom settings for ZMQ path"""
settings = {
'zmq_prefix': '',
'zmq_draft_api': False,
'libzmq_extension': False,
'no_libzmq_extension': False,
'skip_check_zmq': False,
......
......@@ -34,7 +34,7 @@ def test_compilation(cfile, compiler=None, **compiler_attrs):
efile, ext = os.path.splitext(cfile)
cpreargs = lpreargs = None
cpreargs = lpreargs = []
if sys.platform == 'darwin':
# use appropriate arch for compiler
if platform.architecture()[0]=='32bit':
......@@ -53,31 +53,28 @@ def test_compilation(cfile, compiler=None, **compiler_attrs):
else:
lpreargs = ['-m64']
extra = compiler_attrs.get('extra_compile_args', None)
extra_link = compiler_attrs.get('extra_link_args', [])
lpreargs.extend(extra_link)
objs = cc.compile([cfile], extra_preargs=cpreargs, extra_postargs=extra)
cc.link_executable(objs, efile, extra_preargs=lpreargs)
return efile
def compile_and_run(basedir, src, compiler=None, **compiler_attrs):
def compile_and_forget(basedir, src, compiler=None, **compiler_attrs):
"""Make sure src compiles and links successfully.
The resulting binary is deleted without being run.
"""
if not os.path.exists(basedir):
os.makedirs(basedir)
cfile = pjoin(basedir, os.path.basename(src))
shutil.copy(src, cfile)
try:
cc = get_compiler(compiler, **compiler_attrs)
efile = test_compilation(cfile, compiler=cc)
patch_lib_paths(efile, cc.library_dirs)
result = Popen(efile, stdout=PIPE, stderr=PIPE)
so, se = result.communicate()
# for py3k:
so = so.decode()
se = se.decode()
efile = test_compilation(cfile, compiler=cc, **compiler_attrs)
finally:
shutil.rmtree(basedir)
return result.returncode, so, se
def detect_zmq(basedir, compiler=None, **compiler_attrs):
"""Compile, link & execute a test program, in empty directory `basedir`.
......@@ -116,7 +113,7 @@ def detect_zmq(basedir, compiler=None, **compiler_attrs):
compiler_attrs['libraries'].append('rt')
cc = get_compiler(compiler=compiler, **compiler_attrs)
efile = test_compilation(cfile, compiler=cc)
efile = test_compilation(cfile, compiler=cc, **compiler_attrs)
patch_lib_paths(efile, cc.library_dirs)
rc, so, se = get_output_error([efile])
......
......@@ -16,8 +16,6 @@ When imported from this module, blocking methods such as
:meth:`zmq.asyncio.Socket.recv_multipart`, :meth:`zmq.asyncio.Socket.poll`,
and :meth:`zmq.asyncio.Poller.poll` return :class:`~.asyncio.Future` s.
It also provides a :class:`zmq.asyncio.ZMQEventLoop`.
.. sourcecode:: python
import asyncio
......@@ -25,8 +23,6 @@ It also provides a :class:`zmq.asyncio.ZMQEventLoop`.
import zmq.asyncio
ctx = zmq.asyncio.Context()
loop = zmq.asyncio.ZMQEventLoop()
asyncio.set_event_loop(loop)
@asyncio.coroutine
def recv_and_process():
......@@ -36,7 +32,7 @@ It also provides a :class:`zmq.asyncio.ZMQEventLoop`.
reply = yield from async_process(msg)
yield from sock.send_multipart(reply)
loop.run_until_complete(recv_and_process())
asyncio.get_event_loop().run_until_complete(recv_and_process())
Classes
......@@ -45,8 +41,6 @@ Classes
:class:`ZMQEventLoop`
~~~~~~~~~~~~~~~~~~~~~
An asyncio event loop using zmq_poll for zmq socket support.
.. autoclass:: ZMQEventLoop
......
......@@ -19,7 +19,7 @@ These sockets let you easily use zmq with tornado's coroutines.
.. seealso::
:mod:`tornado:tornado.gen`
:mod:`tornado.gen`
.. sourcecode:: python
......
.. AUTO-GENERATED FILE -- DO NOT EDIT!
eventloop.ioloop
================
......@@ -12,34 +11,12 @@ Module: :mod:`eventloop.ioloop`
Classes
-------
:class:`DelayedCallback`
~~~~~~~~~~~~~~~~~~~~~~~~
.. autoclass:: DelayedCallback
:members:
:undoc-members:
:inherited-members:
:class:`ZMQIOLoop`
~~~~~~~~~~~~~~~~~~
.. autoclass:: ZMQIOLoop
:members:
:undoc-members:
:inherited-members:
:class:`ZMQPoller`
~~~~~~~~~~~~~~~~~~
.. autoclass:: ZMQPoller
:members:
:undoc-members:
:inherited-members:
Function
......
......@@ -36,7 +36,25 @@ Basic Classes
boolean - whether the socket has been closed.
If True, you can no longer use this Socket.
.. attribute:: copy_threshold
integer - size (in bytes) below which messages
should always be copied.
Zero-copy support has nontrivial overhead
due to the need to coordinate garbage collection
with the libzmq IO thread,
so sending small messages (typically < 10s of kB)
with ``copy=False`` is often more expensive
than with ``copy=True``.
The initial default value is 65536 (64kB),
a reasonable default based on testing.
Defaults to :const:`zmq.COPY_THRESHOLD` on socket construction.
Setting :const:`zmq.COPY_THRESHOLD` will define the default
value for any subsequently created sockets.
.. versionadded:: 17
:class:`Frame`
......
......@@ -9,6 +9,44 @@ Changes in PyZMQ
This is a coarse summary of changes in pyzmq versions.
For a full changelog, consult the `git log <https://github.com/zeromq/pyzmq/commits>`_.
17.0.0
======
- Add :meth:`zmq.Socket.send_serialized` and :meth:`zmq.Socket.recv_serialized`
for sending/receiving messages with custom serialization.
- Add :attr:`zmq.Socket.copy_threshold` and :const:`zmq.COPY_THRESHOLD`.
Messages smaller than this are always copied, regardless of ``copy=False``,
to avoid overhead of zero-copy bookkeeping on small messages.
- Added visible deprecation warnings to bundled tornado IOLoop.
Tornado eventloop integration shouldn't be used without a proper tornado install
since pyzmq 14.
- Allow pyzmq asyncio/tornado integration to run without installing :func:`zmq_poll`
implementation. The following methods and classes are deprecated and no longer required:
- :func:`zmq.eventloop.ioloop.install`
- :class:`zmq.eventloop.ioloop.IOLoop`
- :func:`zmq.asyncio.install`
- :class:`zmq.asyncio.ZMQEventLoop`
- Set RPATH correctly when building on macOS.
- Compatibility fixes with tornado 5.0.dev (may not be quite enough for 5.0 final,
which is not yet released as of pyzmq 17).
- Draft support for CLIENT-SERVER `routing_id` and `group`.
.. seealso::
:ref:`draft`
16.0.4