├── .coveragerc ├── .flake8 ├── .github ├── ISSUE_TEMPLATE │ ├── bug.yml │ └── config.yml ├── dependabot.yml └── workflows │ ├── test-docs.yml │ ├── test.yml │ └── wheels.yml ├── .gitignore ├── .mailmap ├── .obs └── workflows.yml ├── .pre-commit-config.yaml ├── .prettierignore ├── .readthedocs.yml ├── AUTHORS.md ├── CMakeLists.txt ├── CONTRIBUTING.md ├── LICENSE.md ├── MANIFEST.in ├── README.md ├── RELICENSE ├── README.md ├── authors.py ├── chrislaws.md ├── ellisonbg.md ├── frankwiles.md ├── juliantaylor.md ├── ledgerx.md ├── lothiraldan.md ├── minrk.md ├── takluyver.md └── templates │ ├── relicense-template-bsd.txt │ ├── relicense-template-mplv2-any-osi.txt │ └── relicense-template-mplv2.txt ├── SECURITY.md ├── Vagrantfile ├── buildutils ├── build_cffi.py ├── bundle.py ├── constants.py └── templates │ ├── constant_enums.pxi │ └── constants.py ├── cmake ├── FindVcvars.cmake └── Findsodium.cmake ├── codecov.yml ├── docs ├── Makefile ├── requirements.txt └── source │ ├── _static │ ├── logo.png │ └── zeromq.ico │ ├── api │ ├── index.md │ ├── zmq.asyncio.md │ ├── zmq.auth.asyncio.md │ ├── zmq.auth.ioloop.md │ ├── zmq.auth.md │ ├── zmq.auth.thread.md │ ├── zmq.decorators.md │ ├── zmq.devices.md │ ├── zmq.eventloop.future.md │ ├── zmq.eventloop.ioloop.md │ ├── zmq.eventloop.zmqstream.md │ ├── zmq.green.md │ ├── zmq.log.handlers.md │ ├── zmq.md │ ├── zmq.ssh.tunnel.md │ ├── zmq.utils.jsonapi.md │ ├── zmq.utils.monitor.md │ ├── zmq.utils.win32.md │ └── zmq.utils.z85.md │ ├── changelog.md │ ├── conf.py │ ├── howto │ ├── build.md │ ├── cross-android.Dockerfile │ ├── cross.Dockerfile │ ├── devices.md │ ├── draft.md │ ├── eventloop.md │ ├── index.md │ ├── logging.md │ ├── morethanbindings.md │ ├── serialization.md │ └── ssh.md │ └── index.md ├── examples ├── LICENSE ├── README.md ├── asyncio │ ├── coroutines.py │ ├── helloworld_pubsub_dealerrouter.py │ ├── router_router.py │ └── tornado_asyncio.py ├── cython │ ├── .gitignore │ ├── README.md │ ├── cyzmq.pyx │ ├── example.py │ └── setup.py ├── device │ └── device.py ├── draft │ ├── client-server.py │ ├── install.sh │ └── radio-dish.py ├── eventloop │ ├── asyncweb.py │ ├── coroutines.py │ ├── echo.py │ ├── echofuture.py │ └── echostream.py ├── gevent │ ├── poll.py │ ├── reqrep.py │ └── simple.py ├── heartbeat │ ├── heart.py │ ├── heartbeater.py │ ├── ping.py │ └── pong.py ├── logger │ └── zmqlogger.py ├── mongodb │ ├── client.py │ └── controller.py ├── monitoring │ ├── simple_monitor.py │ └── zmq_monitor_class.py ├── poll │ ├── pair.py │ ├── pubsub.py │ └── reqrep.py ├── pubsub │ ├── publisher.py │ ├── subscriber.py │ ├── topics_pub.py │ └── topics_sub.py ├── recv_into │ ├── discard.py │ └── recv_into_array.py ├── security │ ├── asyncio-ironhouse.py │ ├── generate_certificates.py │ ├── grasslands.py │ ├── ioloop-ironhouse.py │ ├── ironhouse.py │ ├── stonehouse.py │ ├── strawhouse.py │ └── woodhouse.py ├── serialization │ └── serialsocket.py └── win32-interrupt │ └── display.py ├── licenses └── LICENSE.tornado.txt ├── mypy.ini ├── mypy_tests ├── test_context.py ├── test_socket.py ├── test_socket_async.py └── test_toplevel.py ├── packaging ├── README.md ├── debian │ ├── changelog │ ├── compat │ ├── control │ ├── copyright │ ├── pyzmq.dsc.obs │ ├── rules │ └── source │ │ └── format ├── obs │ └── _service └── redhat │ └── python-pyzmq.spec ├── perf ├── Dockerfile ├── Makefile ├── collect.py ├── perf.ipynb └── perf.py ├── pyproject.toml ├── pytest.ini ├── test-requirements.txt ├── tests ├── conftest.py ├── cython_ext.pyx ├── test_asyncio.py ├── test_auth.py ├── test_cffi_backend.py ├── test_constants.py ├── test_context.py ├── test_cython.py ├── test_decorators.py ├── test_device.py ├── test_draft.py ├── test_error.py ├── test_etc.py ├── test_ext.py ├── test_future.py ├── test_imports.py ├── test_includes.py ├── test_ioloop.py ├── test_log.py ├── test_message.py ├── test_monitor.py ├── test_monqueue.py ├── test_multipart.py ├── test_mypy.py ├── test_pair.py ├── test_poll.py ├── test_proxy_steerable.py ├── test_pubsub.py ├── test_reqrep.py ├── test_retry_eintr.py ├── test_security.py ├── test_socket.py ├── test_ssh.py ├── test_version.py ├── test_win32_shim.py ├── test_z85.py ├── test_zmqstream.py └── zmq_test_utils.py ├── tools ├── backend_imports.py ├── circle_wheels.py ├── collect_cmake.py ├── find_vcredist.py ├── install_libzmq.sh ├── showvcvars.py ├── test_sdist.py ├── test_wheel.py ├── wheel-requirements.txt └── wheel_summary.py ├── zmq ├── __init__.pxd ├── __init__.py ├── __init__.pyi ├── _future.py ├── _future.pyi ├── _typing.py ├── asyncio.py ├── auth │ ├── __init__.py │ ├── asyncio.py │ ├── base.py │ ├── certs.py │ ├── ioloop.py │ └── thread.py ├── backend │ ├── __init__.py │ ├── __init__.pyi │ ├── cffi │ │ ├── README.md │ │ ├── __init__.py │ │ ├── _cdefs.h │ │ ├── _cffi_src.c │ │ ├── _poll.py │ │ ├── context.py │ │ ├── devices.py │ │ ├── error.py │ │ ├── message.py │ │ ├── socket.py │ │ └── utils.py │ ├── cython │ │ ├── __init__.pxd │ │ ├── __init__.py │ │ ├── _externs.pxd │ │ ├── _zmq.pxd │ │ ├── _zmq.py │ │ ├── constant_enums.pxi │ │ └── libzmq.pxd │ └── select.py ├── constants.py ├── decorators.py ├── devices │ ├── __init__.py │ ├── basedevice.py │ ├── monitoredqueue.py │ ├── monitoredqueuedevice.py │ ├── proxydevice.py │ └── proxysteerabledevice.py ├── error.py ├── eventloop │ ├── __init__.py │ ├── _deprecated.py │ ├── future.py │ ├── ioloop.py │ └── zmqstream.py ├── green │ ├── __init__.py │ ├── core.py │ ├── device.py │ ├── eventloop │ │ ├── __init__.py │ │ ├── ioloop.py │ │ └── zmqstream.py │ └── poll.py ├── log │ ├── __init__.py │ ├── __main__.py │ └── handlers.py ├── py.typed ├── ssh │ ├── __init__.py │ ├── forward.py │ └── tunnel.py ├── sugar │ ├── __init__.py │ ├── __init__.pyi │ ├── attrsettr.py │ ├── context.py │ ├── frame.py │ ├── poll.py │ ├── socket.py │ ├── stopwatch.py │ ├── tracker.py │ └── version.py ├── tests │ └── __init__.py └── utils │ ├── __init__.py │ ├── garbage.py │ ├── getpid_compat.h │ ├── interop.py │ ├── ipcmaxlen.h │ ├── jsonapi.py │ ├── monitor.py │ ├── mutex.h │ ├── pyversion_compat.h │ ├── strtypes.py │ ├── win32.py │ ├── z85.py │ └── zmq_compat.h └── zmqversion.py /.coveragerc: -------------------------------------------------------------------------------- 1 | [run] 2 | plugins = Cython.Coverage 3 | parallel = True 4 | branch = False 5 | omit = 6 | zmq/eventloop/minitornado/* 7 | zmq/tests/* 8 | 9 | [report] 10 | exclude_lines = 11 | pragma: no cover 12 | ignore_errors = True 13 | -------------------------------------------------------------------------------- /.flake8: -------------------------------------------------------------------------------- 1 | # flake8 no longer used, 2 | # ruff config in pyproject.toml 3 | [flake8] 4 | exclude = .git,dist,docs,zmq/eventloop/minitornado,buildutils/templates 5 | ignore = E,W 6 | 7 | per-file-ignores = 8 | **/__init__.py:F401,F403 9 | zmq/tests/**:F841 10 | examples/**:F841 11 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/config.yml: -------------------------------------------------------------------------------- 1 | contact_links: 2 | - name: "\U0001F914 Question about how to use zeromq" 3 | url: https://stackoverflow.com/questions/tagged/zeromq 4 | about: The pyzmq development repo is not the place to ask about how to use zeromq. There just aren't that many eyes on it! 5 | 6 | - name: "\U0001F914 Bug reports for zeromq" 7 | url: https://github.com/zeromq/libzmq/issues 8 | about: Report general issues about zeromq socket behavior on the libzmq repo. pyzmq only exposes libzmq to Python, it does not influence zmq socket behavior. 9 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | # dependabot.yaml reference: https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuration-options-for-the-dependabot.yml-file 2 | version: 2 3 | updates: 4 | # Maintain dependencies in our GitHub Workflows 5 | - package-ecosystem: github-actions 6 | directory: "/" 7 | schedule: 8 | interval: monthly 9 | - package-ecosystem: pip 10 | directory: "/tools" 11 | schedule: 12 | interval: weekly 13 | -------------------------------------------------------------------------------- /.github/workflows/test-docs.yml: -------------------------------------------------------------------------------- 1 | name: Test docs 2 | 3 | # The tests defined in docs/ are currently influenced by changes to _version.py 4 | # and scopes.py. 5 | on: 6 | pull_request: 7 | paths: 8 | - "docs/**" 9 | - "zmq/**" 10 | - ".github/workflows/test-docs.yml" 11 | push: 12 | paths: 13 | - "docs/**" 14 | - "zmq/**" 15 | - ".github/workflows/test-docs.yml" 16 | branches-ignore: 17 | - "dependabot/**" 18 | - "pre-commit-ci-update-config" 19 | tags: 20 | - "**" 21 | workflow_dispatch: 22 | 23 | env: 24 | LANG: C.UTF-8 25 | SPHINXOPTS: "-W" 26 | 27 | jobs: 28 | test-docs: 29 | runs-on: ubuntu-24.04 30 | steps: 31 | - uses: actions/checkout@v4 32 | 33 | - uses: actions/setup-python@v5 34 | with: 35 | python-version: "3.12" 36 | cache: pip 37 | 38 | - name: Install libzmq 39 | run: | 40 | sudo apt-get -y install libzmq3-dev 41 | 42 | - name: Install pyzmq 43 | run: | 44 | pip install -v . 45 | 46 | - name: Install requirements 47 | run: | 48 | pip install -r docs/requirements.txt 49 | 50 | # readthedocs doesn't halt on warnings, 51 | # so raise any warnings here 52 | - name: build docs 53 | run: | 54 | cd docs 55 | make html 56 | 57 | - name: check links 58 | run: | 59 | cd docs 60 | make linkcheck 61 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .idea 2 | .vagrant 3 | *.pyc 4 | zmq/backend/cython/*.c 5 | zmq/backend/cffi/*.o 6 | zmq/devices/*.c 7 | zmq/utils/*.json 8 | zmq/include/*.h 9 | __pycache__ 10 | build 11 | dist 12 | conf 13 | bundled 14 | libzmq-dll 15 | *.egg-info 16 | *.so 17 | *.pyd 18 | *.dll 19 | *.dylib 20 | docs/source/api/generated 21 | docs/gh-pages 22 | setup.cfg 23 | MANIFEST 24 | .tox 25 | examples/security/public_keys 26 | examples/security/private_keys 27 | wheelhouse 28 | .coverage 29 | .cache 30 | .pytest_cache 31 | win-dist 32 | *.pickle 33 | .ipynb_checkpoints 34 | venv 35 | *.code-workspace 36 | .vscode 37 | .mypy_cache 38 | .coverage 39 | htmlcov 40 | coverage.xml 41 | env 42 | .eggs 43 | 44 | CMakeFiles 45 | CMakeCache.txt 46 | cmake_install.cmake 47 | _deps 48 | /Makefile 49 | _src 50 | licenses/* 51 | !licenses/LICENSE.tornado.txt 52 | .virtual_documents 53 | /libsodium-* 54 | /zeromq-* 55 | *.tar.gz 56 | -------------------------------------------------------------------------------- /.mailmap: -------------------------------------------------------------------------------- 1 | Brian E. Granger Brian Granger 2 | Chris Laws Chris Laws 3 | Daniel Lundin Daniel Lundin 4 | Min Ragan-Kelley Min RK 5 | Min Ragan-Kelley MinRK 6 | Michel Pelletier Michel Pelletier 7 | Nicholas Piël nicholas 8 | Felipe Cruz felipecruz 9 | Felipe Cruz Felipe cruz 10 | Yannick Hold Yannick Hold 11 | -------------------------------------------------------------------------------- /.obs/workflows.yml: -------------------------------------------------------------------------------- 1 | workflow: 2 | steps: 3 | - link_package: 4 | source_project: network:messaging:zeromq:git-draft 5 | source_package: pyzmq 6 | -------------------------------------------------------------------------------- /.pre-commit-config.yaml: -------------------------------------------------------------------------------- 1 | ci: 2 | autoupdate_schedule: monthly 3 | 4 | exclude: ^zmq/eventloop/minitornado/ 5 | repos: 6 | - repo: local 7 | hooks: 8 | - id: constants 9 | name: constants 10 | files: "^.*/constants.py" 11 | description: Generate constants files 12 | entry: python -m buildutils.constants 13 | language: python 14 | pass_filenames: false 15 | additional_dependencies: 16 | - ruff 17 | - repo: https://github.com/executablebooks/mdformat 18 | rev: 0.7.22 # Use the ref you want to point at 19 | hooks: 20 | - id: mdformat 21 | # Optionally add plugins 22 | additional_dependencies: 23 | - mdformat-black 24 | - mdformat-myst 25 | exclude: LICENSE.md 26 | 27 | # autoformat and lint Python code 28 | - repo: https://github.com/astral-sh/ruff-pre-commit 29 | rev: v0.11.8 30 | hooks: 31 | - id: ruff 32 | types_or: 33 | - python 34 | - jupyter 35 | - pyi 36 | args: ["--fix", "--show-fixes"] 37 | - id: ruff-format 38 | types_or: 39 | - python 40 | - jupyter 41 | - pyi 42 | # don't format zmq/constants.py twice 43 | exclude: zmq/constants.py 44 | 45 | - repo: https://github.com/pre-commit/mirrors-mypy 46 | rev: v1.15.0 47 | hooks: 48 | - id: mypy 49 | files: zmq/.* 50 | # mypy gets the wrong results 51 | # if we pass specific files instead of the zmq dir 52 | # no idea why 53 | pass_filenames: false 54 | args: [zmq] 55 | additional_dependencies: 56 | - types-paramiko 57 | - repo: https://github.com/pre-commit/pre-commit-hooks 58 | rev: v5.0.0 59 | hooks: 60 | - id: end-of-file-fixer 61 | - id: check-executables-have-shebangs 62 | - id: requirements-txt-fixer 63 | -------------------------------------------------------------------------------- /.prettierignore: -------------------------------------------------------------------------------- 1 | docs/source/_templates 2 | externals 3 | -------------------------------------------------------------------------------- /.readthedocs.yml: -------------------------------------------------------------------------------- 1 | # Read the Docs configuration file 2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details 3 | 4 | version: 2 5 | formats: all 6 | 7 | build: 8 | os: ubuntu-22.04 9 | tools: 10 | python: "3.11" 11 | 12 | sphinx: 13 | configuration: docs/source/conf.py 14 | fail_on_warning: true 15 | 16 | python: 17 | install: 18 | - requirements: docs/requirements.txt 19 | - path: . 20 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Testing 2 | 3 | pyzmq is tested on GitHub Actions. 4 | 5 | ![Build Status](https://github.com/zeromq/pyzmq/actions/workflows/test.yml/badge.svg)\](https://github.com/zeromq/pyzmq/actions/workflows/test.yml) 6 | 7 | ## Opening an Issue 8 | 9 | For a good bug report: 10 | 11 | 1. [Search] for existing Issues, both on GitHub and in general with Google/Stack Overflow before posting a duplicate question. 12 | 1. Update to pyzmq main, if possible, especially if you are already using git. It's 13 | possible that the bug you are about to report has already been fixed. 14 | 15 | Many things reported as pyzmq Issues are often just libzmq-related, 16 | and don't have anything to do with pyzmq itself. 17 | These are better directed to [zeromq-dev]. 18 | 19 | When making a bug report, it is helpful to tell us as much as you can about your system 20 | (such as pyzmq version, libzmq version, Python version, OS Version, how you built/installed pyzmq and libzmq, etc.) 21 | 22 | The basics: 23 | 24 | ```python 25 | import sys 26 | import zmq 27 | 28 | print("libzmq-%s" % zmq.zmq_version()) 29 | print("pyzmq-%s" % zmq.pyzmq_version()) 30 | print("Python-%s" % sys.version) 31 | ``` 32 | 33 | Which will give something like: 34 | 35 | ``` 36 | libzmq-4.3.4 37 | pyzmq-22.3.0 38 | Python-3.9.9 | packaged by conda-forge | (main, Dec 20 2021, 02:38:53) 39 | [Clang 11.1.0 ] 40 | ``` 41 | 42 | ### Your contributions 43 | 44 | **Pull Requests are welcome!** 45 | 46 | When you contribute to PyZMQ, your contributions are made under the same 47 | license as the file you are working on. Any new, original code should be BSD 48 | licensed. 49 | 50 | We use [pre-commit] for autoformatting, 51 | so you hopefully don't need to worry too much about style. 52 | 53 | To install pre-commit: 54 | 55 | ``` 56 | pip install pre-commit 57 | pre-commit install 58 | ``` 59 | 60 | Examples are copyright their respective authors, and BSD unless otherwise 61 | specified by the author. 62 | 63 | ### Inherited licenses in pyzmq 64 | 65 | Some code outside the core is taken from other open-source projects, and 66 | inherits that project's license. 67 | 68 | - zmq/eventloop contains some code derived from [tornado], used under the Apache 2.0 license 69 | 70 | - zmq/ssh/forward.py is from [paramiko], and inherits LGPL 71 | 72 | - perf examples are (c) iMatix, and MPL 73 | 74 | [paramiko]: http://www.lag.net/paramiko 75 | [pre-commit]: https://pre-commit.com 76 | [search]: https://github.com/zeromq/pyzmq/issues 77 | [tornado]: http://www.tornadoweb.org 78 | [zeromq-dev]: mailto:zeromq-dev@zeromq.org 79 | -------------------------------------------------------------------------------- /LICENSE.md: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2009-2012, Brian Granger, Min Ragan-Kelley 4 | 5 | All rights reserved. 6 | 7 | Redistribution and use in source and binary forms, with or without 8 | modification, are permitted provided that the following conditions are met: 9 | 10 | 1. Redistributions of source code must retain the above copyright notice, this 11 | list of conditions and the following disclaimer. 12 | 13 | 2. Redistributions in binary form must reproduce the above copyright notice, 14 | this list of conditions and the following disclaimer in the documentation 15 | and/or other materials provided with the distribution. 16 | 17 | 3. Neither the name of the copyright holder nor the names of its 18 | contributors may be used to endorse or promote products derived from 19 | this software without specific prior written permission. 20 | 21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 25 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 26 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 27 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 28 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 29 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | -------------------------------------------------------------------------------- /MANIFEST.in: -------------------------------------------------------------------------------- 1 | # only need to track non-version-controlled files to add 2 | include bundled/zeromq/COPYING* 3 | graft bundled/zeromq/include 4 | graft bundled/zeromq/src 5 | graft bundled/zeromq/external/wepoll 6 | exclude bundled/zeromq/src/Makefile* 7 | exclude bundled/zeromq/src/platform.hpp 8 | -------------------------------------------------------------------------------- /RELICENSE/README.md: -------------------------------------------------------------------------------- 1 | # Permission to Relicense under MPLv2 or BSD 2 | 3 | pyzmq starting with 26.0.0 is fully licensed under the 3-clause Modified BSD License. 4 | A small part of the core (Cython backend only) was previously licensed under LGPLv3 for historical reasons. 5 | Permission has been granted by the contributors of the vast majority of those components to relicense under MPLv2 or BSD. 6 | This backend has been completely replaced in pyzmq 26, and the new implementation is fully licensed under BSD-3-Clause, 7 | so pyzmq is now under a single license. 8 | 9 | Original text: 10 | 11 | Most of pyzmq is licensed under [3-Clause BSD](https://opensource.org/licenses/BSD-3-Clause). 12 | For historical reasons, the 'core' of pyzmq (the low-level Cython bindings) 13 | was licensed under LGPLv3, like libzmq itself. 14 | 15 | libzmq is in the process of moving away from LGPL to the [Mozilla Public License, version 16 | 2](https://www.mozilla.org/en-US/MPL/2.0/). 17 | I'd like to take this opportunity to follow libzmq's example and also eliminate LGPL from pyzmq. 18 | For a similarly copyleft license, MPLv2 can be used for the core. 19 | However, I would prefer to update the core to follow the example of the rest of pyzmq, 20 | and adopt the 3-Clause BSD license. 21 | 22 | This directory collects grants from individuals and firms that hold 23 | copyrights in pyzmq to permit licensing the pyzmq code under 24 | the MPLv2 or BSD license. See 25 | the [0MQ Licensing Page](http://zeromq.org/area:licensing) and 26 | [libzmq relicensing effort](https://github.com/zeromq/libzmq/pull/1917) 27 | for some background information. 28 | 29 | Please create a separate file in this directory for each individual 30 | or firm holding copyright in pyzmq core, named after the individual or 31 | firm holding the copyright. 32 | 33 | Each patch must be made with a GitHub handle that is clearly 34 | associated with the copyright owner, to guarantee the identity of 35 | the signatory. Please avoid changing the files created by other 36 | individuals or firms granting a copyright license over their 37 | copyrights (if rewording is required contact them and ask them to 38 | submit an updated version). This makes it easier to verify that 39 | the license grant was made by an authorized GitHub account. 40 | -------------------------------------------------------------------------------- /RELICENSE/authors.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python3 2 | """Get the authors of the LGPL-licensed subset of pyzmq (Cython bindings)""" 3 | 4 | import re 5 | from collections import defaultdict 6 | from itertools import chain 7 | from os.path import abspath, dirname, join 8 | 9 | import git 10 | 11 | here = dirname(__file__) 12 | root = dirname(abspath(here)) 13 | repo = git.Repo(root) 14 | 15 | LAST_CORE_COMMIT = 'db1d4d2f2cdd97955a7db620e667a834920a938a' 16 | PRE_CORE_COMMIT = 'd4e3453b012962fc9bf6ed621019b395f968340c' 17 | 18 | EXCLUDED = { 19 | # docstring only: 20 | 'c2db4af3c591aae99bf437a223d97b30ecbfcd38', 21 | '7b1ac07a3bbffe70af3adcd663c0cbe6f2a724f7', 22 | 'ce97f46881168c4c05d7885dc48a430c520a9683', 23 | '14c16a97ffa95bf645ab27bf5b06c3eabda30e5e', 24 | # accidental swapfile 25 | '93150feb4a80712c6a379f79d561fbc87405ade8', 26 | } 27 | 28 | 29 | def get_all_commits(): 30 | return chain( 31 | repo.iter_commits('master', 'zmq/backend/cython'), 32 | repo.iter_commits(LAST_CORE_COMMIT, 'zmq/core'), 33 | repo.iter_commits(PRE_CORE_COMMIT, ['zmq/_zmq.*']), 34 | ) 35 | 36 | 37 | mailmap = {} 38 | email_names = {} 39 | 40 | pat = re.compile(r'\<([^\>]+)\>') 41 | with open(join(root, '.mailmap')) as f: 42 | for line in f: 43 | if not line.strip(): 44 | continue 45 | dest, src = pat.findall(line) 46 | mailmap[src] = dest 47 | email_names[dest] = line[: line.index('<')].strip() 48 | 49 | author_commits = defaultdict(list) 50 | 51 | for commit in get_all_commits(): 52 | # exclude some specific commits (e.g. docstring typos) 53 | if commit.hexsha in EXCLUDED: 54 | continue 55 | # exclude commits that only touch generated pxi files in backend/cython 56 | backend_cython_files = { 57 | f for f in commit.stats.files if f.startswith('zmq/backend/cython') 58 | } 59 | if backend_cython_files and backend_cython_files.issubset( 60 | { 61 | 'zmq/backend/cython/constant_enums.pxi', 62 | 'zmq/backend/cython/constants.pxi', 63 | } 64 | ): 65 | continue 66 | 67 | email = commit.author.email 68 | email = mailmap.get(email, email) 69 | name = email_names.setdefault(email, commit.author.name) 70 | author_commits[email].append(commit) 71 | 72 | 73 | def sort_key(email_commits): 74 | commits = email_commits[1] 75 | return (len(commits), commits[0].authored_date) 76 | 77 | 78 | for email, commits in sorted(author_commits.items(), key=sort_key, reverse=True): 79 | if len(commits) <= 2: 80 | msg = '{} ({})'.format( 81 | ' '.join(c.hexsha[:12] for c in commits), 82 | commits[0].authored_datetime.year, 83 | ) 84 | else: 85 | msg = f"{len(commits)} commits ({commits[-1].authored_datetime.year}-{commits[0].authored_datetime.year})" 86 | print(f"- [ ] {email_names[email]} {email}: {msg}") 87 | -------------------------------------------------------------------------------- /RELICENSE/chrislaws.md: -------------------------------------------------------------------------------- 1 | # Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL 2 | 3 | This is a statement by Chris Laws 4 | that grants permission to relicense its copyrights in the Python ZeroMQ bindings 5 | (pyzmq) under the Mozilla Public License v2 (MPLv2) or any other 6 | Open Source Initiative approved license chosen by the current PyZMQ 7 | BDFL (Benevolent Dictator for Life). 8 | 9 | A portion of the commits made by the GitHub handle "claws", with 10 | commit author "Chris Laws clawsicus@gmail.com", are copyright of Chris Laws. 11 | This document hereby grants the pyzmq project team permission to relicense pyzmq, 12 | including all past, present, and future contributions of the author listed above. 13 | 14 | Chris Laws 15 | 2017/07/18 16 | -------------------------------------------------------------------------------- /RELICENSE/ellisonbg.md: -------------------------------------------------------------------------------- 1 | # Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL 2 | 3 | This is a statement by Brian E. Granger 4 | that grants permission to relicense its copyrights in the Python ZeroMQ bindings 5 | (pyzmq) under the Mozilla Public License v2 (MPLv2) or any other 6 | Open Source Initiative approved license chosen by the current PyZMQ 7 | BDFL (Benevolent Dictator for Life). 8 | 9 | A portion of the commits made by the GitHub handle "ellisonbg", with 10 | commit author "Brian E. Granger", are copyright of Brian E. Granger. 11 | This document hereby grants the pyzmq project team permission to relicense pyzmq, 12 | including all past, present, and future contributions of the author listed above. 13 | 14 | Brian Ellison Granger 15 | 2017/07/18 16 | -------------------------------------------------------------------------------- /RELICENSE/frankwiles.md: -------------------------------------------------------------------------------- 1 | This is a statement by Frank Wiles 2 | that grants permission to relicense its copyrights in the Python ZeroMQ bindings 3 | (pyzmq) under the Mozilla Public License v2 (MPLv2) or any other 4 | Open Source Initiative approved license chosen by the current PyZMQ 5 | BDFL (Benevolent Dictator for Life). 6 | 7 | A portion of the commits made by the GitHub handle "frankwiles", with 8 | commit author "Frank Wiles ", are copyright of Frank Wiles . 9 | This document hereby grants the libzmq project team to relicense pyzmq, 10 | including all past, present and future contributions of the author listed above. 11 | 12 | Frank Wiles 13 | 2017/07/17 14 | -------------------------------------------------------------------------------- /RELICENSE/juliantaylor.md: -------------------------------------------------------------------------------- 1 | # Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL 2 | 3 | This is a statement by Julian Taylor 4 | that grants permission to relicense its copyrights in the Python ZeroMQ bindings 5 | (pyzmq) under the Mozilla Public License v2 (MPLv2) or any other 6 | Open Source Initiative approved license chosen by the current PyZMQ 7 | BDFL (Benevolent Dictator for Life). 8 | 9 | A portion of the commits made by the GitHub handle "juliantaylor", with 10 | commit author "Julian Taylor ", are copyright of Julian Taylor. 11 | This document hereby grants the libzmq project team to relicense libzmq, 12 | including all past, present and future contributions of the author listed above. 13 | 14 | Julian Taylor 15 | 2017/07/19 16 | -------------------------------------------------------------------------------- /RELICENSE/ledgerx.md: -------------------------------------------------------------------------------- 1 | # Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL 2 | 3 | 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). 4 | 5 | A portion of the commits made by the GitHub handle "amrali", with commit author "Amr Ali ", 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. 6 | 7 | Amr Ali 8 | 2017/09/11 9 | -------------------------------------------------------------------------------- /RELICENSE/lothiraldan.md: -------------------------------------------------------------------------------- 1 | # Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL 2 | 3 | This is a statement by Boris Feld that grants permission to relicense its 4 | copyrights in the Python ZeroMQ bindings (pyzmq) under the Mozilla Public 5 | License v2 (MPLv2) or any other Open Source Initiative approved license chosen 6 | by the current PyZMQ BDFL (Benevolent Dictator for Life). 7 | 8 | A portion of the commits made by the GitHub handle "Lothiraldan", with commit 9 | author "FELD Boris ", are copyright of Boris Feld. This 10 | document hereby grants the pyzmq project team permission to relicense pyzmq, 11 | including all past, present, and future contributions of the author listed 12 | above. 13 | 14 | Boris Feld 2017/07/18 15 | -------------------------------------------------------------------------------- /RELICENSE/minrk.md: -------------------------------------------------------------------------------- 1 | # Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL 2 | 3 | This is a statement by Min Ragan-Kelley 4 | that grants permission to relicense its copyrights in the libzmq C++ 5 | library (ZeroMQ) under the Mozilla Public License v2 (MPLv2) or any other 6 | Open Source Initiative approved license chosen by the current PyZMQ 7 | BDFL (Benevolent Dictator for Life). 8 | 9 | A portion of the commits made by the GitHub handle "minrk", with 10 | commit author "Min RK benjaminrk@gmail.com", are copyright of Min Ragan-Kelley. 11 | This document hereby grants the libzmq project team to relicense libzmq, 12 | including all past, present and future contributions of the author listed above. 13 | 14 | Min Ragan-Kelley 15 | 2017/07/17 16 | -------------------------------------------------------------------------------- /RELICENSE/takluyver.md: -------------------------------------------------------------------------------- 1 | # Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL 2 | 3 | This is a statement by Thomas Kluyver 4 | that grants permission to relicense its copyrights in the Python ZeroMQ bindings 5 | (pyzmq) under the Mozilla Public License v2 (MPLv2) or any other 6 | Open Source Initiative approved license chosen by the current PyZMQ 7 | BDFL (Benevolent Dictator for Life). 8 | 9 | A portion of the commits made by the GitHub handle "takluyver", with 10 | commit author "Thomas Kluyver ", are copyright of Thomas Kluyver. 11 | This document hereby grants the libzmq project team to relicense libzmq, 12 | including all past, present and future contributions of the author listed above. 13 | 14 | Thomas Kluyver 15 | 2017/07/18 16 | -------------------------------------------------------------------------------- /RELICENSE/templates/relicense-template-bsd.txt: -------------------------------------------------------------------------------- 1 | # Permission to Relicense under BSD 2 | 3 | This is a statement by {{ name of company / name of individual }} 4 | that grants permission to relicense its copyrights in the Python ZeroMQ bindings 5 | (pyzmq) under the 3-Clause BSD License (BSD3). 6 | 7 | A portion of the commits made by the Github handle "{{github username}}", with 8 | commit author "{{github commit author}}", are copyright of {{ name }}. 9 | This document hereby grants the pyzmq project team permission to relicense pyzmq, 10 | including all past, present, and future contributions of the author listed above. 11 | 12 | {{ Full Name }} 13 | {{ creation date of document (format: yyyy/mm/dd) }} 14 | -------------------------------------------------------------------------------- /RELICENSE/templates/relicense-template-mplv2-any-osi.txt: -------------------------------------------------------------------------------- 1 | # Permission to Relicense under MPLv2 or any other OSI approved license chosen by the current PyZMQ BDFL 2 | 3 | This is a statement by {{ name of company / name of individual }} 4 | that grants permission to relicense its copyrights in the Python ZeroMQ bindings 5 | (pyzmq) under the Mozilla Public License v2 (MPLv2) or any other 6 | Open Source Initiative approved license chosen by the current PyZMQ 7 | BDFL (Benevolent Dictator for Life). 8 | 9 | A portion of the commits made by the GitHub handle "{{github username}}", with 10 | commit author "{{github commit author}}", are copyright of {{ name }} . 11 | This document hereby grants the pyzmq project team permission to relicense pyzmq, 12 | including all past, present, and future contributions of the author listed above. 13 | 14 | {{ Full Name }} 15 | {{ creation date of document (format: yyyy/mm/dd) }} 16 | -------------------------------------------------------------------------------- /RELICENSE/templates/relicense-template-mplv2.txt: -------------------------------------------------------------------------------- 1 | # Permission to Relicense under MPLv2 2 | 3 | This is a statement by {{ name of company / name of individual }} 4 | that grants permission to relicense its copyrights in the Python ZeroMQ bindings 5 | (pyzmq) under the Mozilla Public License v2 (MPLv2). 6 | 7 | A portion of the commits made by the GitHub handle "{{github username}}", with 8 | commit author "{{github commit author}}", are copyright of {{ name }}. 9 | This document hereby grants the pyzmq project team permission to relicense pyzmq, 10 | including all past, present, and future contributions of the author listed above. 11 | 12 | {{ Full Name }} 13 | {{ creation date of document (format: yyyy/mm/dd) }} 14 | -------------------------------------------------------------------------------- /SECURITY.md: -------------------------------------------------------------------------------- 1 | # Security Policies and Procedures 2 | 3 | This document outlines security procedures and general policies for the pyzmq project. 4 | 5 | - [Reporting a Bug](#reporting-a-bug) 6 | - [Disclosure Policy](#disclosure-policy) 7 | - [Comments on this Policy](#comments-on-this-policy) 8 | 9 | ## Reporting a Bug 10 | 11 | Thank you for improving the security of pyzmq. We appreciate your efforts and 12 | responsible disclosure and will make every effort to acknowledge your 13 | contributions. 14 | 15 | Report security bugs by emailing the lead maintainer at benjaminrk AT gmail.com. 16 | 17 | The lead maintainer will acknowledge your email as promptly as possible, 18 | and will follow up with a more detailed response. 19 | 20 | When the issue is confirmed, a GitHub security advisory will be created to discuss resolutions. 21 | We will endeavor to keep you informed of the progress towards a fix and full 22 | announcement, and may ask for additional information or guidance. 23 | 24 | Report security bugs in libzmq itself or other packages to the mainainers of those packages. 25 | 26 | ## Disclosure Policy 27 | 28 | When the security team receives a security bug report, they will assign it to a 29 | primary handler. This person will coordinate the fix and release process, 30 | involving the following steps: 31 | 32 | - Confirm the problem and determine the affected versions. 33 | - Audit code to find any potential similar problems. 34 | - Prepare fixes for all releases still under maintenance. These fixes will be 35 | released as fast as possible to npm. 36 | 37 | ## Comments on this Policy 38 | 39 | If you have suggestions on how this process could be improved please submit a 40 | pull request. 41 | -------------------------------------------------------------------------------- /Vagrantfile: -------------------------------------------------------------------------------- 1 | #e -*- mode: ruby -*- 2 | # vi: set ft=ruby : 3 | 4 | # This will setup a clean Ubuntu1404 LTS env 5 | 6 | $script = <