Пример #1
0
def get_distribution(always=False):
    dist = distutils.core._setup_distribution
    # XXX Hack to get numpy installable with easy_install.
    # The problem is easy_install runs it's own setup(), which
    # sets up distutils.core._setup_distribution. However,
    # when our setup() runs, that gets overwritten and lost.
    # We can't use isinstance, as the DistributionWithoutHelpCommands
    # class is local to a function in setuptools.command.easy_install
    if dist is not None and "DistributionWithoutHelpCommands" in repr(dist):
        dist = None
    if always and dist is None:
        dist = NumpyDistribution()
    return dist
Пример #2
0
def test_ccompiler():
    '''
    scikit-image/scikit-image issue 4369
    We unconditionally add ``-std-c99`` to the gcc compiler in order
    to support c99 with very old gcc compilers. However the same call
    is used to get the flags for the c++ compiler, just with a kwarg.
    Make sure in this case, where it would not be legal, the option is **not** added
    '''
    dist = NumpyDistribution()
    compiler = new_compiler()
    compiler.customize(dist)
    if hasattr(compiler, 'compiler') and 'gcc' in compiler.compiler[0]:
        assert 'c99' in ' '.join(compiler.compiler)

    compiler = new_compiler()
    compiler.customize(dist, need_cxx=True)
    if hasattr(compiler, 'compiler') and 'gcc' in compiler.compiler[0]:
        assert 'c99' not in ' '.join(compiler.compiler)