Python numpy.distutils.core.setup.py() Examples

The following are code examples for showing how to use numpy.distutils.core.setup.py(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: LaserTOF   Author: kyleuckert   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 2
Project: FX-RER-Value-Extraction   Author: tsKenneth   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 3
Project: recruit   Author: Frank-qlu   File: setup.py    Apache License 2.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 4
Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: setup.py    GNU General Public License v3.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 5
Project: FUTU_Stop_Loss   Author: BigtoC   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 6
Project: MARRtino-2.0   Author: DaniAffCH   File: setup.py    GNU General Public License v3.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 7
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 8
Project: vnpy_crypto   Author: birforce   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 9
Project: scikit-multiflow   Author: scikit-multiflow   File: setup.py    BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def build_from_c_and_cpp_files(extensions):
    """Modify the extensions to build from the .c and .cpp files.

    This is useful for releases, this way cython is not required to
    run python setup.py install.
    """
    for extension in extensions:
        sources = []
        for sfile in extension.sources:
            path, ext = os.path.splitext(sfile)
            if ext in ('.pyx', '.py'):
                if extension.language == 'c++':
                    ext = '.cpp'
                else:
                    ext = '.c'
                sfile = path + ext
            sources.append(sfile)
        extension.sources = sources 
Example 10
Project: ble5-nrf52-mac   Author: tomasero   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 11
Project: Computable   Author: ktraunmueller   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 12
Project: poker   Author: surgebiswas   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 13
Project: P3_image_processing   Author: latedude2   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 14
Project: GraphicDesignPatternByPython   Author: Relph1119   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 15
Project: 3dprinteros-client   Author: panasevychol   File: setup.py    GNU Affero General Public License v3.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 16
Project: 3dprinteros-client   Author: panasevychol   File: setup.py    GNU Affero General Public License v3.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 17
Project: predictive-maintenance-using-machine-learning   Author: awslabs   File: setup.py    Apache License 2.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 18
Project: fund   Author: Frank-qlu   File: setup.py    Apache License 2.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 19
Project: Python-iBeacon-Scan   Author: NikNitro   File: autowrap.py    GNU General Public License v3.0 6 votes vote down vote up
def _generate_code(self, routine, helpers):
        with open('%s.py' % self.module_name, 'w') as f:
            printed = ", ".join(
                [str(res.expr) for res in routine.result_variables])
            # convert OutputArguments to return value like f2py
            args = filter(lambda x: not isinstance(
                x, OutputArgument), routine.arguments)
            retvals = []
            for val in routine.result_variables:
                if isinstance(val, Result):
                    retvals.append('nameless')
                else:
                    retvals.append(val.result_var)

            print(DummyWrapper.template % {
                'name': routine.name,
                'expr': printed,
                'args': ", ".join([str(a.name) for a in args]),
                'retvals': ", ".join([str(val) for val in retvals])
            }, end="", file=f) 
Example 20
Project: Python-iBeacon-Scan   Author: NikNitro   File: autowrap.py    GNU General Public License v3.0 6 votes vote down vote up
def _prepare_files(self, routine):
        pyxfilename = self.module_name + '.pyx'
        codefilename = "%s.%s" % (self.filename, self.generator.code_extension)

        # pyx
        with open(pyxfilename, 'w') as f:
            self.dump_pyx([routine], f, self.filename)

        # setup.py
        ext_args = [repr(self.module_name), repr([pyxfilename, codefilename])]
        if self._need_numpy:
            np_import = 'import numpy as np\n'
            np_includes = '    include_dirs = [np.get_include()],\n'
        else:
            np_import = ''
            np_includes = ''
        with open('setup.py', 'w') as f:
            f.write(self.setup_template.format(ext_args=", ".join(ext_args),
                                               np_import=np_import,
                                               np_includes=np_includes)) 
Example 21
Project: pySINDy   Author: luckystarufo   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 22
Project: Programming-for-Non-Technical-Roles-   Author: PacktPublishing   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 23
Project: linear_neuron   Author: uglyboxer   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 24
Project: facethin   Author: ParkerGod   File: setup.py    GNU General Public License v3.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 25
Project: islam-buddy   Author: hamir   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 26
Project: mxnet-lambda   Author: awslabs   File: setup.py    Apache License 2.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 27
Project: Deribit_funding_rate_indicator   Author: Dimasik007   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 28
Project: psychrometric-chart-makeover   Author: buds-lab   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 29
Project: wine-ml-on-aws-lambda   Author: pierreant   File: setup.py    Apache License 2.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 30
Project: linux-cross-gcc   Author: nmercier   File: setup.py    BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 31
Project: SignLanguage_ML   Author: mareep-raljodid   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 32
Project: ImageFusion   Author: pfchai   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 33
Project: sarah   Author: ChonchoFronto   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 34
Project: honours_project   Author: JFriel   File: setup.py    GNU General Public License v3.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 35
Project: honours_project   Author: JFriel   File: setup.py    GNU General Public License v3.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 36
Project: Blackjack-Tracker   Author: martinabeleda   File: setup.py    MIT License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 37
Project: Splunking-Crime   Author: nccgroup   File: setup.py    GNU Affero General Public License v3.0 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 38
Project: PYPIC   Author: max614   File: setup.py    BSD 2-Clause "Simplified" License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 39
Project: PYPIC   Author: max614   File: setup.py    BSD 2-Clause "Simplified" License 6 votes vote down vote up
def check_mathlib(config_cmd):
    # Testing the C math library
    mathlibs = []
    mathlibs_choices = [[], ['m'], ['cpml']]
    mathlib = os.environ.get('MATHLIB')
    if mathlib:
        mathlibs_choices.insert(0, mathlib.split(','))
    for libs in mathlibs_choices:
        if config_cmd.check_func("exp", libraries=libs, decl=True, call=True):
            mathlibs = libs
            break
    else:
        raise EnvironmentError("math library missing; rerun "
                               "setup.py after setting the "
                               "MATHLIB env variable")
    return mathlibs 
Example 40
Project: LaserTOF   Author: kyleuckert   File: setup.py    MIT License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 41
Project: FUTU_Stop_Loss   Author: BigtoC   File: setup.py    MIT License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 42
Project: auto-alt-text-lambda-api   Author: abhisuri97   File: setup.py    MIT License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 43
Project: cython_template   Author: jakevdp   File: setup.py    BSD 2-Clause "Simplified" License 5 votes vote down vote up
def version(package, encoding='utf-8'):
    """Obtain the packge version from a python file e.g. pkg/__init__.py

    See <https://packaging.python.org/en/latest/single_source_version.html>.
    """
    path = os.path.join(os.path.dirname(__file__), package, '__init__.py')
    with io.open(path, encoding=encoding) as fp:
        version_info = fp.read()
    version_match = re.search(r"""^__version__ = ['"]([^'"]*)['"]""",
                              version_info, re.M)
    if not version_match:
        raise RuntimeError("Unable to find version string.")
    return version_match.group(1) 
Example 44
Project: cython_template   Author: jakevdp   File: setup.py    BSD 2-Clause "Simplified" License 5 votes vote down vote up
def generate_cython(package):
    """Cythonize all sources in the package"""
    cwd = os.path.abspath(os.path.dirname(__file__))
    print("Cythonizing sources")
    p = subprocess.call([sys.executable,
                         os.path.join(cwd, 'tools', 'cythonize.py'),
                         package],
                        cwd=cwd)
    if p != 0:
        raise RuntimeError("Running cythonize failed!") 
Example 45
Project: vnpy_crypto   Author: birforce   File: setup.py    MIT License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 46
Project: pmdarima   Author: alkaline-ml   File: setup.py    MIT License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    from numpy.distutils.misc_util import Configuration

    libs = []
    if os.name == 'posix':
        libs.append('m')

    config = Configuration('pmdarima', parent_package, top_path)

    # build utilities
    config.add_subpackage('__check_build')
    config.add_subpackage('_build_utils')

    # submodules that do NOT have their own setup.py. manually add their tests
    config.add_subpackage('compat')
    config.add_subpackage('compat/tests')
    config.add_subpackage('datasets')
    config.add_subpackage('datasets/tests')
    config.add_subpackage('model_selection')
    config.add_subpackage('model_selection/tests')

    # the following packages have cython or their own setup.py files.
    config.add_subpackage('arima')
    config.add_subpackage('preprocessing')
    config.add_subpackage('utils')

    # add test directory
    config.add_subpackage('tests')

    # Do cythonization, but only if this is not a release tarball, since the
    # C/C++ files are not necessarily forward compatible with future versions
    # of python.
    if 'sdist' not in sys.argv:
        cythonize_extensions(top_path, config)

    return config 
Example 47
Project: scikit-multiflow   Author: scikit-multiflow   File: setup.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def configuration(parent_package="", top_path=None):
    config = Configuration('trees', parent_package, top_path)

    # submodules which do not have their own setup.py
    config.add_subpackage('attribute_observer')
    config.add_subpackage('attribute_test')
    config.add_subpackage('nodes')
    config.add_subpackage('split_criterion')

    return config 
Example 48
Project: scikit-multiflow   Author: scikit-multiflow   File: setup.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    from numpy.distutils.misc_util import Configuration

    config = Configuration('skmultiflow', parent_package, top_path)

    # submodules which do not have their own setup.py
    config.add_subpackage('anomaly_detection')
    config.add_subpackage('bayes')
    config.add_subpackage('core')
    config.add_subpackage('data')
    config.add_subpackage('drift_detection')
    config.add_subpackage('evaluation')
    config.add_subpackage('meta')
    config.add_subpackage('neural_networks')
    config.add_subpackage('prototype')
    config.add_subpackage('rules')
    config.add_subpackage('transform')
    config.add_subpackage('trees')
    config.add_subpackage('utils')
    config.add_subpackage('visualization')

    # submodules which have their own setup.py
    config.add_subpackage('lazy')
    config.add_subpackage('metrics')

    # Check if should run cythonize or build from source files
    maybe_cythonize_extensions(top_path, config)

    return config


########################################################################################################################
# Utilities useful during the build. Based on sklearn._build_utils                                                     #
######################################################################################################################## 
Example 49
Project: poker   Author: surgebiswas   File: setup.py    MIT License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 50
Project: viznet   Author: GiggleLiu   File: setup.py    MIT License 5 votes vote down vote up
def get_version():
    """Obtain the version number"""
    import imp
    mod = imp.load_source('version', os.path.join(PACKAGE_NAME, 'version.py'))
    return mod.__version__ 
Example 51
Project: GraphicDesignPatternByPython   Author: Relph1119   File: setup.py    MIT License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 52
Project: Python-iBeacon-Scan   Author: NikNitro   File: autowrap.py    GNU General Public License v3.0 5 votes vote down vote up
def command(self):
        command = [sys.executable, "setup.py", "build_ext", "--inplace"]
        return command 
Example 53
Project: Python-iBeacon-Scan   Author: NikNitro   File: autowrap.py    GNU General Public License v3.0 5 votes vote down vote up
def command(self):
        command = [sys.executable, "setup.py", "build_ext", "--inplace"]
        return command 
Example 54
Project: Python-iBeacon-Scan   Author: NikNitro   File: autowrap.py    GNU General Public License v3.0 5 votes vote down vote up
def _prepare_files(self, routines, funcname):

        # C
        codefilename = self.module_name + '.c'
        with open(codefilename, 'w') as f:
            self.dump_c(routines, f, self.filename, funcname=funcname)

        # setup.py
        with open('setup.py', 'w') as f:
            self.dump_setup(f) 
Example 55
Project: pySINDy   Author: luckystarufo   File: setup.py    MIT License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 56
Project: billiard   Author: chenyu93   File: setup.py    MIT License 5 votes vote down vote up
def version(package, encoding='utf-8'):
    """Obtain the packge version from a python file e.g. pkg/__init__.py

    See <https://packaging.python.org/en/latest/single_source_version.html>.
    """
    path = os.path.join(os.path.dirname(__file__), package, '__init__.py')
    with io.open(path, encoding=encoding) as fp:
        version_info = fp.read()
    version_match = re.search(r"""^__version__ = ['"]([^'"]*)['"]""",
                              version_info, re.M)
    if not version_match:
        raise RuntimeError("Unable to find version string.")
    return version_match.group(1) 
Example 57
Project: billiard   Author: chenyu93   File: setup.py    MIT License 5 votes vote down vote up
def generate_cython(package):
    """Cythonize all sources in the package"""
    cwd = os.path.abspath(os.path.dirname(__file__))
    print("Cythonizing sources")
    p = subprocess.call([sys.executable,
                         os.path.join(cwd, 'tools', 'cythonize.py'),
                         package],
                        cwd=cwd)
    if p != 0:
        raise RuntimeError("Running cythonize failed!") 
Example 58
Project: medusa   Author: marinkaz   File: setup.py    GNU General Public License v2.0 5 votes vote down vote up
def get_version():
    """Obtain the version number"""
    import imp
    mod = imp.load_source('version', os.path.join(PACKAGE_NAME, 'version.py'))
    return mod.__version__

# Documentation building command 
Example 59
Project: linear_neuron   Author: uglyboxer   File: setup.py    MIT License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 60
Project: nrg_mapping   Author: GiggleLiu   File: setup.py    MIT License 5 votes vote down vote up
def get_version():
    """Obtain the version number"""
    import imp
    mod = imp.load_source('version', os.path.join(PACKAGE_NAME, 'version.py'))
    return mod.__version__ 
Example 61
Project: islam-buddy   Author: hamir   File: setup.py    MIT License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 62
Project: mxnet-lambda   Author: awslabs   File: setup.py    Apache License 2.0 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 63
Project: wine-ml-on-aws-lambda   Author: pierreant   File: setup.py    Apache License 2.0 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 64
Project: linux-cross-gcc   Author: nmercier   File: setup.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py'+sys.version[:3]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 65
Project: scikit-kge   Author: mnick   File: setup.py    MIT License 5 votes vote down vote up
def get_version():
    """Obtain the version number"""
    import imp
    mod = imp.load_source('version', os.path.join(PACKAGE_NAME, 'version.py'))
    return mod.__version__

# Documentation building command 
Example 66
Project: sarah   Author: ChonchoFronto   File: setup.py    MIT License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 67
Project: honours_project   Author: JFriel   File: setup.py    GNU General Public License v3.0 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 68
Project: honours_project   Author: JFriel   File: setup.py    GNU General Public License v3.0 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 69
Project: Blackjack-Tracker   Author: martinabeleda   File: setup.py    MIT License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 70
Project: Splunking-Crime   Author: nccgroup   File: setup.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 71
Project: PYPIC   Author: max614   File: setup.py    BSD 2-Clause "Simplified" License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 72
Project: PYPIC   Author: max614   File: setup.py    BSD 2-Clause "Simplified" License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 73
Project: PYPIC   Author: max614   File: setup.py    BSD 2-Clause "Simplified" License 5 votes vote down vote up
def configuration(parent_package='', top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py' + os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:] == '.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write(_get_f2py_shebang() + '\n')
            mainloc = os.path.join(os.path.dirname(__file__), "__main__.py")
            with open(mainloc) as mf:
                f.write(mf.read())
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 74
Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: setup.py    GNU General Public License v3.0 4 votes vote down vote up
def configuration(parent_package='',top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('docs')
    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          'f2py.1'
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py'+os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:]=='.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write('''\
#!%s
# See http://cens.ioc.ee/projects/f2py2e/
import os, sys
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]:
    try:
        i=sys.argv.index("--"+mode)
        del sys.argv[i]
        break
    except ValueError: pass
os.environ["NO_SCIPY_IMPORT"]="f2py"
if mode=="g3-numpy":
    sys.stderr.write("G3 f2py support is not implemented, yet.\\n")
    sys.exit(1)
elif mode=="2e-numeric":
    from f2py2e import main
elif mode=="2e-numarray":
    sys.argv.append("-DNUMARRAY")
    from f2py2e import main
elif mode=="2e-numpy":
    from numpy.f2py import main
else:
    sys.stderr.write("Unknown mode: " + repr(mode) + "\\n")
    sys.exit(1)
main()
'''%(sys.executable))
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 75
Project: att   Author: Centre-Alt-Rendiment-Esportiu   File: build_tools.py    GNU General Public License v3.0 4 votes vote down vote up
def create_extension(module_path, **kw):
    """ Create an Extension that can be buil by setup.py

        See build_extension for information on keyword arguments.
    """

    # this is a screwy trick to get rid of a ton of warnings on Unix
    distutils.sysconfig.get_config_vars()
    if 'OPT' in distutils.sysconfig._config_vars:
        flags = distutils.sysconfig._config_vars['OPT']
        flags = flags.replace('-Wall','')
        distutils.sysconfig._config_vars['OPT'] = flags

    # get the name of the module and the extension directory it lives in.
    module_dir,cpp_name = os.path.split(os.path.abspath(module_path))
    module_name,ext = os.path.splitext(cpp_name)

    # the business end of the function
    sources = kw.get('sources',[])
    kw['sources'] = [module_path] + sources

    #--------------------------------------------------------------------
    # added access to environment variable that user can set to specify
    # where python (and other) include files are located.  This is
    # very useful on systems where python is installed by the root, but
    # the user has also installed numerous packages in their own
    # location.
    #--------------------------------------------------------------------
    if 'PYTHONINCLUDE' in os.environ:
        path_string = os.environ['PYTHONINCLUDE']
        if sys.platform == "win32":
            extra_include_dirs = path_string.split(';')
        else:
            extra_include_dirs = path_string.split(':')
        include_dirs = kw.get('include_dirs',[])
        kw['include_dirs'] = include_dirs + extra_include_dirs

    # SunOS specific
    # fix for issue with linking to libstdc++.a. see:
    # http://mail.python.org/pipermail/python-dev/2001-March/013510.html
    platform = sys.platform
    version = sys.version.lower()
    if platform[:5] == 'sunos' and 'gcc' in version:
        extra_link_args = kw.get('extra_link_args',[])
        kw['extra_link_args'] = ['-mimpure-text'] + extra_link_args

    ext = Extension(module_name, **kw)
    return ext 
Example 76
Project: Computable   Author: ktraunmueller   File: build_tools.py    MIT License 4 votes vote down vote up
def create_extension(module_path, **kw):
    """ Create an Extension that can be buil by setup.py

        See build_extension for information on keyword arguments.
    """

    # this is a screwy trick to get rid of a ton of warnings on Unix
    distutils.sysconfig.get_config_vars()
    if 'OPT' in distutils.sysconfig._config_vars:
        flags = distutils.sysconfig._config_vars['OPT']
        flags = flags.replace('-Wall','')
        distutils.sysconfig._config_vars['OPT'] = flags

    # get the name of the module and the extension directory it lives in.
    module_dir,cpp_name = os.path.split(os.path.abspath(module_path))
    module_name,ext = os.path.splitext(cpp_name)

    # the business end of the function
    sources = kw.get('sources',[])
    kw['sources'] = [module_path] + sources

    #--------------------------------------------------------------------
    # added access to environment variable that user can set to specify
    # where python (and other) include files are located.  This is
    # very useful on systems where python is installed by the root, but
    # the user has also installed numerous packages in their own
    # location.
    #--------------------------------------------------------------------
    if 'PYTHONINCLUDE' in os.environ:
        path_string = os.environ['PYTHONINCLUDE']
        if sys.platform == "win32":
            extra_include_dirs = path_string.split(';')
        else:
            extra_include_dirs = path_string.split(':')
        include_dirs = kw.get('include_dirs',[])
        kw['include_dirs'] = include_dirs + extra_include_dirs

    # SunOS specific
    # fix for issue with linking to libstdc++.a. see:
    # http://mail.python.org/pipermail/python-dev/2001-March/013510.html
    platform = sys.platform
    version = sys.version.lower()
    if platform[:5] == 'sunos' and 'gcc' in version:
        extra_link_args = kw.get('extra_link_args',[])
        kw['extra_link_args'] = ['-mimpure-text'] + extra_link_args

    ext = Extension(module_name, **kw)
    return ext 
Example 77
Project: poker   Author: surgebiswas   File: build_tools.py    MIT License 4 votes vote down vote up
def create_extension(module_path, **kw):
    """ Create an Extension that can be buil by setup.py

        See build_extension for information on keyword arguments.
    """

    # this is a screwy trick to get rid of a ton of warnings on Unix
    distutils.sysconfig.get_config_vars()
    if 'OPT' in distutils.sysconfig._config_vars:
        flags = distutils.sysconfig._config_vars['OPT']
        flags = flags.replace('-Wall','')
        distutils.sysconfig._config_vars['OPT'] = flags

    # get the name of the module and the extension directory it lives in.
    module_dir,cpp_name = os.path.split(os.path.abspath(module_path))
    module_name,ext = os.path.splitext(cpp_name)

    # the business end of the function
    sources = kw.get('sources',[])
    kw['sources'] = [module_path] + sources

    #--------------------------------------------------------------------
    # added access to environment variable that user can set to specify
    # where python (and other) include files are located.  This is
    # very useful on systems where python is installed by the root, but
    # the user has also installed numerous packages in their own
    # location.
    #--------------------------------------------------------------------
    if 'PYTHONINCLUDE' in os.environ:
        path_string = os.environ['PYTHONINCLUDE']
        if sys.platform == "win32":
            extra_include_dirs = path_string.split(';')
        else:
            extra_include_dirs = path_string.split(':')
        include_dirs = kw.get('include_dirs',[])
        kw['include_dirs'] = include_dirs + extra_include_dirs

    # SunOS specific
    # fix for issue with linking to libstdc++.a. see:
    # http://mail.python.org/pipermail/python-dev/2001-March/013510.html
    platform = sys.platform
    version = sys.version.lower()
    if platform[:5] == 'sunos' and 'gcc' in version:
        extra_link_args = kw.get('extra_link_args',[])
        kw['extra_link_args'] = ['-mimpure-text'] + extra_link_args

    ext = Extension(module_name, **kw)
    return ext 
Example 78
Project: 3dprinteros-client   Author: panasevychol   File: setup.py    GNU Affero General Public License v3.0 4 votes vote down vote up
def configuration(parent_package='',top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('docs')
    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          'f2py.1'
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py'+os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:]=='.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write('''\
#!%s
# See http://cens.ioc.ee/projects/f2py2e/
import os, sys
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]:
    try:
        i=sys.argv.index("--"+mode)
        del sys.argv[i]
        break
    except ValueError: pass
os.environ["NO_SCIPY_IMPORT"]="f2py"
if mode=="g3-numpy":
    sys.stderr.write("G3 f2py support is not implemented, yet.\\n")
    sys.exit(1)
elif mode=="2e-numeric":
    from f2py2e import main
elif mode=="2e-numarray":
    sys.argv.append("-DNUMARRAY")
    from f2py2e import main
elif mode=="2e-numpy":
    from numpy.f2py import main
else:
    sys.stderr.write("Unknown mode: " + repr(mode) + "\\n")
    sys.exit(1)
main()
'''%(sys.executable))
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 79
Project: 3dprinteros-client   Author: panasevychol   File: setup.py    GNU Affero General Public License v3.0 4 votes vote down vote up
def configuration(parent_package='',top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('docs')
    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          'f2py.1'
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py'+os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:]=='.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write('''\
#!%s
# See http://cens.ioc.ee/projects/f2py2e/
import os, sys
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]:
    try:
        i=sys.argv.index("--"+mode)
        del sys.argv[i]
        break
    except ValueError: pass
os.environ["NO_SCIPY_IMPORT"]="f2py"
if mode=="g3-numpy":
    sys.stderr.write("G3 f2py support is not implemented, yet.\\n")
    sys.exit(1)
elif mode=="2e-numeric":
    from f2py2e import main
elif mode=="2e-numarray":
    sys.argv.append("-DNUMARRAY")
    from f2py2e import main
elif mode=="2e-numpy":
    from numpy.f2py import main
else:
    sys.stderr.write("Unknown mode: " + repr(mode) + "\\n")
    sys.exit(1)
main()
'''%(sys.executable))
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config 
Example 80
Project: ImageFusion   Author: pfchai   File: setup.py    MIT License 4 votes vote down vote up
def configuration(parent_package='',top_path=None):
    config = Configuration('f2py', parent_package, top_path)

    config.add_data_dir('docs')
    config.add_data_dir('tests')

    config.add_data_files('src/fortranobject.c',
                          'src/fortranobject.h',
                          'f2py.1'
                          )

    config.make_svn_version_py()

    def generate_f2py_py(build_dir):
        f2py_exe = 'f2py'+os.path.basename(sys.executable)[6:]
        if f2py_exe[-4:]=='.exe':
            f2py_exe = f2py_exe[:-4] + '.py'
        if 'bdist_wininst' in sys.argv and f2py_exe[-3:] != '.py':
            f2py_exe = f2py_exe + '.py'
        target = os.path.join(build_dir, f2py_exe)
        if newer(__file__, target):
            log.info('Creating %s', target)
            f = open(target, 'w')
            f.write('''\
#!%s
# See http://cens.ioc.ee/projects/f2py2e/
import os, sys
for mode in ["g3-numpy", "2e-numeric", "2e-numarray", "2e-numpy"]:
    try:
        i=sys.argv.index("--"+mode)
        del sys.argv[i]
        break
    except ValueError: pass
os.environ["NO_SCIPY_IMPORT"]="f2py"
if mode=="g3-numpy":
    sys.stderr.write("G3 f2py support is not implemented, yet.\\n")
    sys.exit(1)
elif mode=="2e-numeric":
    from f2py2e import main
elif mode=="2e-numarray":
    sys.argv.append("-DNUMARRAY")
    from f2py2e import main
elif mode=="2e-numpy":
    from numpy.f2py import main
else:
    sys.stderr.write("Unknown mode: " + repr(mode) + "\\n")
    sys.exit(1)
main()
'''%(sys.executable))
            f.close()
        return target

    config.add_scripts(generate_f2py_py)

    log.info('F2PY Version %s', config.get_version())

    return config