Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CZMQ version check to installer #17

Merged
merged 1 commit into from
Dec 18, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pyczmq/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

from . import (
zmq,
zsys,
zctx,
zsocket,
zstr,
Expand Down
18 changes: 18 additions & 0 deletions pyczmq/zsys.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
from pyczmq._cffi import C, ffi, cdef

__doc__ = """
The zsys class provides miscellaneous functions. Only a limited set of
functions are exposed from the czmq zsys module as many duplicate
functionality of built-in python types or libraries.
"""

@cdef('void zsys_version (int *major, int *minor, int *patch);')
def zsys_version():
"""
Returns the tuple (major, minor, patch) of the current czmq version.
"""
major = ffi.new('int*')
minor= ffi.new('int*')
patch = ffi.new('int*')
C.zsys_version(major, minor, patch)
return (major[0], minor[0], patch[0])
5 changes: 3 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@
======
"""
from pyczmq.zmq import version as zmq_version
from pyczmq.zsys import zsys_version as czmq_version
from setuptools import setup, find_packages
import sys


if zmq_version() < (4,0,0):
print "ERROR: pyczmq requires libzmq 4.0.0 or later."
if zmq_version() < (4,0,0) or czmq_version() < (2, 1, 0):
print "ERROR: pyczmq requires libzmq 4.0.0 or later and libczmq 2.1.0 or later"
sys.exit(1)


Expand Down