~ubuntu-branches/ubuntu/precise/pyzmq/precise

« back to all changes in this revision

Viewing changes to .pc/fix_distutils.diff/setup.py

  • Committer: Package Import Robot
  • Author(s): Debian Python Modules Team
  • Date: 2011-09-23 00:16:39 UTC
  • mfrom: (1.1.4 upstream)
  • Revision ID: package-import@ubuntu.com-20110923001639-girjqodpb7uv17yu
Tags: 2.1.9-1
* New upstream version
  - should build on kFreeBSD without patches (Closes: #637777).
* Build-depend on zeromq 2.1.9

Show diffs side-by-side

added added

removed removed

Lines of Context:
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
77
78
    ignore_common_warnings=False
78
79
 
79
80
# the minimum zeromq version this will work against:
80
 
min_zmq = (2,1,0)
 
81
min_zmq = (2,1,4)
81
82
 
82
83
# set dylib ext:
83
84
if sys.platform.startswith('win'):
210
211
        pyzmq_version = extract_version().strip('abcdefghijklmnopqrstuvwxyz')
211
212
 
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)
 
217
            print('*'*42)
 
218
        elif vs >= '3.0':
 
219
            warn("Detected ZMQ version: %s. pyzmq's support for libzmq-dev is experimental."%vs)
216
220
            print('*'*42)
217
221
 
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:
 
255
                action = 'compile'
 
256
            elif etype is LinkError:
 
257
                action = 'link'
 
258
            else:
 
259
                action = 'run'
249
260
            fatal("""
250
 
    Failed to compile ZMQ test program.  Please check to make sure:
 
261
    Failed to %s ZMQ test program.  Please check to make sure:
251
262
 
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)))
256
271
            
257
272
        else:
258
273
            savepickle('configure.pickle', config)
365
380
                if d == '__pycache__':
366
381
                    self._clean_trees.append(pjoin(root, d))
367
382
        
368
 
        for d in ('build', 'conf'):
 
383
        for d in ('build',):
369
384
            if os.path.exists(d):
370
385
                self._clean_trees.append(d)
371
 
        
 
386
 
372
387
        bundled = glob(pjoin('zmq', 'libzmq*'))
373
388
        self._clean_me.extend(bundled)
374
389
        
375
 
                # else:
376
 
        # for d in [ 'build' ]:
377
 
        #     if os.path.isdir(d):
378
 
        #         self._clean_trees.append(d)
379
390
 
380
391
 
381
392
    def finalize_options(self):
480
491
def dotc(subdir, name):
481
492
    return os.path.abspath(pjoin('zmq', subdir, name+'.c'))
482
493
 
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')
489
500
 
490
501
submodules = dict(
491
 
    core = {'constants': [czmq],
492
 
            'error':[czmq],
493
 
            'poll':[czmq],
494
 
            'stopwatch':[czmq, pxd('core','stopwatch')],
495
 
            'context':[socket, context, czmq],
496
 
            'message':[czmq, buffers, message],
497
 
            'socket':[context, message, socket, czmq, buffers],
498
 
            'device':[czmq],
499
 
            'version':[czmq],
 
502
    core = {'constants': [libzmq],
 
503
            'error':[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],
 
510
            'version':[libzmq],
500
511
    },
501
512
    devices = {
502
 
            'monitoredqueue':[buffers, czmq, monqueue],
 
513
            'monitoredqueue':[buffers, libzmq, monqueue, socket, context],
503
514
    },
504
515
    utils = {
505
 
            'initthreads':[czmq]
 
516
            'initthreads':[libzmq],
 
517
            'rebuffer':[buffers],
506
518
    }
507
519
)
508
520
 
571
583
    else:
572
584
        return __version__
573
585
 
 
586
def find_packages():
 
587
    """adapted from IPython's setupbase.find_packages()"""
 
588
    packages = []
 
589
    for dir,subdirs,files in os.walk('zmq'):
 
590
        package = dir.replace(os.path.sep, '.')
 
591
        if '__init__.py' not in files:
 
592
            # not a package
 
593
            continue
 
594
        packages.append(package)
 
595
    return packages
 
596
 
574
597
#-----------------------------------------------------------------------------
575
598
# Main setup
576
599
#-----------------------------------------------------------------------------
584
607
setup(
585
608
    name = "pyzmq",
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.",