Skip to content

Commit

Permalink
same but simpler
Browse files Browse the repository at this point in the history
  • Loading branch information
claws committed Dec 17, 2013
1 parent d6773d6 commit 33b2465
Showing 1 changed file with 3 additions and 20 deletions.
23 changes: 3 additions & 20 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,33 +4,16 @@
pyczmq
======
"""
from cffi import FFI
from pyczmq.zmq import version as zmq_version
from setuptools import setup, find_packages
import sys

ffi = FFI()
Z = ffi.dlopen('zmq')
C = ffi.dlopen('czmq')

ffi.cdef('void zmq_version (int *major, int *minor, int *patch);')

def zmq_version(lib):
"""
Returns the tuple (major, minor, patch) of the current libzmq version.
"""
major = ffi.new('int*')
minor= ffi.new('int*')
patch = ffi.new('int*')
Z.zmq_version(major, minor, patch)
return (major[0], minor[0], patch[0])

zmq_version = zmq_version(Z)


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


setup(
name="pyczmq",
version="0.0.4",
Expand Down

0 comments on commit 33b2465

Please sign in to comment.