40
40
from distutils.core import setup, Command
41
41
from distutils.ccompiler import get_default_compiler
42
42
from distutils.extension import Extension
43
from distutils.errors import CompileError, LinkError
43
44
from distutils.command.build import build
44
45
from distutils.command.build_ext import build_ext
45
46
from distutils.command.sdist import sdist
210
211
pyzmq_version = extract_version().strip('abcdefghijklmnopqrstuvwxyz')
212
213
if vs < pyzmq_version:
213
warn("Detected ZMQ version: %s, but pyzmq is based on zmq %s."%(
214
warn("Detected ZMQ version: %s, but pyzmq targets zmq %s."%(
214
215
vs, pyzmq_version))
215
warn("Some features may be missing or broken.")
216
warn("libzmq features and fixes introduced after %s will be unavailable."%vs)
219
warn("Detected ZMQ version: %s. pyzmq's support for libzmq-dev is experimental."%vs)
218
222
if sys.platform.startswith('win'):
246
250
print (" Custom ZMQ dir: %s" % (ZMQ,))
247
251
config = detect_zmq(self.tempdir, **settings)
248
252
except Exception:
253
etype = sys.exc_info()[0]
254
if etype is CompileError:
256
elif etype is LinkError:
250
Failed to compile ZMQ test program. Please check to make sure:
261
Failed to %s ZMQ test program. Please check to make sure:
252
263
* You have a C compiler installed
253
264
* A development version of Python is installed (including header files)
254
* A development version of ZeroMQ >= 2.1.0 is installed (including header files)
255
* If ZMQ is not in a default location, supply the argument --zmq=<path>""")
265
* A development version of ZMQ >= %s is installed (including header files)
266
* If ZMQ is not in a default location, supply the argument --zmq=<path>
267
* If you did recently install ZMQ to a default location,
268
try rebuilding the ld cache with `sudo ldconfig`
269
or specify zmq's location with `--zmq=/usr/local`
270
"""%(action, v_str(min_zmq)))
258
273
savepickle('configure.pickle', config)
365
380
if d == '__pycache__':
366
381
self._clean_trees.append(pjoin(root, d))
368
for d in ('build', 'conf'):
369
384
if os.path.exists(d):
370
385
self._clean_trees.append(d)
372
387
bundled = glob(pjoin('zmq', 'libzmq*'))
373
388
self._clean_me.extend(bundled)
376
# for d in [ 'build' ]:
377
# if os.path.isdir(d):
378
# self._clean_trees.append(d)
381
392
def finalize_options(self):
480
491
def dotc(subdir, name):
481
492
return os.path.abspath(pjoin('zmq', subdir, name+'.c'))
483
czmq = pxd('core', 'czmq')
494
libzmq = pxd('core', 'libzmq')
484
495
buffers = pxd('utils', 'buffers')
485
496
message = pxd('core', 'message')
486
497
context = pxd('core', 'context')
488
499
monqueue = pxd('devices', 'monitoredqueue')
490
501
submodules = dict(
491
core = {'constants': [czmq],
494
'stopwatch':[czmq, pxd('core','stopwatch')],
495
'context':[socket, context, czmq],
496
'message':[czmq, buffers, message],
497
'socket':[context, message, socket, czmq, buffers],
502
core = {'constants': [libzmq],
504
'poll':[libzmq, socket],
505
'stopwatch':[libzmq, pxd('core','stopwatch')],
506
'context':[context, libzmq],
507
'message':[libzmq, buffers, message],
508
'socket':[context, message, socket, libzmq, buffers],
509
'device':[libzmq, socket, context],
502
'monitoredqueue':[buffers, czmq, monqueue],
513
'monitoredqueue':[buffers, libzmq, monqueue, socket, context],
516
'initthreads':[libzmq],
517
'rebuffer':[buffers],
572
584
return __version__
587
"""adapted from IPython's setupbase.find_packages()"""
589
for dir,subdirs,files in os.walk('zmq'):
590
package = dir.replace(os.path.sep, '.')
591
if '__init__.py' not in files:
594
packages.append(package)
574
597
#-----------------------------------------------------------------------------
576
599
#-----------------------------------------------------------------------------
586
609
version = extract_version(),
587
packages = ['zmq', 'zmq.tests', 'zmq.eventloop', 'zmq.log', 'zmq.core',
588
'zmq.devices', 'zmq.utils'],
610
packages = find_packages(),
589
611
ext_modules = extensions,
590
612
package_data = package_data,
591
author = "Brian E. Granger",
592
author_email = "ellisonbg@gmail.com",
613
author = "Brian E. Granger, Min Ragan-Kelley",
614
author_email = "zeromq-dev@lists.zeromq.org",
593
615
url = 'http://github.com/zeromq/pyzmq',
594
616
download_url = 'http://github.com/zeromq/pyzmq/downloads',
595
617
description = "Python bindings for 0MQ.",