def check_extensions(): #Cythonize main modules ext_list = cythonize(["assimulo"+O.path.sep+"*.pyx"], include_path=[".","assimulo"],include_dirs=[N.get_include()],pyrex_gdb=debug) #Cythonize Euler ext_list = ext_list + cythonize(["assimulo"+O.path.sep+"solvers"+O.path.sep+"euler.pyx"], include_path=[".","assimulo"],include_dirs=[N.get_include()],pyrex_gdb=debug) for i in ext_list: i.include_dirs = [N.get_include()] #Debug if debug: i.extra_compile_args = ["-g","-fno-strict-aliasing"] i.extra_link_args = ["-g"] else: i.extra_compile_args = ["-O2", "-fno-strict-aliasing"] #If Sundials if O.path.exists(O.path.join(O.path.join(incdirs,'cvodes'), 'cvodes.h')): ext_list = ext_list + cythonize(["assimulo"+O.path.sep+"solvers"+O.path.sep+"sundials.pyx"], include_path=[".","assimulo","assimulo"+O.sep+"lib"],include_dirs=[N.get_include()],pyrex_gdb=debug) ext_list[-1].include_dirs = [N.get_include(), "assimulo","assimulo"+O.sep+"lib", incdirs] ext_list[-1].library_dirs = [libdirs] ext_list[-1].extra_link_args = ["-lsundials_cvodes", "-lsundials_nvecserial", "-lsundials_idas"] if debug: ext_list[-1].extra_compile_args = ["-g", "-fno-strict-aliasing"] else: ext_list[-1].extra_compile_args = ["-O2", "-fno-strict-aliasing"] #Sundials found if O.path.exists(O.path.join(O.path.join(incdirs,'cvodes'), 'cvodes.h')): cordir = O.path.join(O.path.join('assimulo','lib'),'sundials_core.pyx') cordir_KINSOL_wSLU = O.path.join(O.path.join('assimulo','lib'),'sundials_kinsol_core_wSLU.pyx') cordir_KINSOL = O.path.join(O.path.join('assimulo','lib'),'sundials_kinsol_core.pyx') cordir_KINSOL_jmod_wSLU = O.path.join(O.path.join('assimulo','lib'),'kinsol_jmod_wSLU.c') cordir_KINSOL_jmod = O.path.join(O.path.join('assimulo','lib'),'kinsol_jmod.c') cordir_kinpinv = O.path.join(O.path.join('assimulo','lib'),'kinpinv.c') cordir_kinslug = O.path.join(O.path.join('assimulo','lib'),'kinslug.c') cordir_reg_routines = O.path.join(O.path.join('assimulo','lib'),'reg_routines.c') wSLU = check_wSLU() if wSLU: SLUincdir = O.path.join(SLUdir,'SRC') SLUlibdir = O.path.join(SLUdir,'lib') ext_list = ext_list + [Extension('assimulo.lib.sundials_kinsol_core_wSLU', [cordir_KINSOL_wSLU,cordir_KINSOL_jmod_wSLU,cordir_kinpinv,cordir_kinslug,cordir_reg_routines], include_dirs=[incdirs, N.get_include(),SLUincdir], library_dirs=[libdirs,SLUlibdir,BLASdir], libraries=['sundials_kinsol','sundials_nvecserial','superlu_4.1',BLASname])] else: ext_list = ext_list + [Extension('assimulo.lib.sundials_kinsol_core', [cordir_KINSOL,cordir_KINSOL_jmod,cordir_kinpinv], include_dirs=[incdirs, N.get_include()], library_dirs=[libdirs], libraries=['sundials_kinsol','sundials_nvecserial'])] return ext_list
def cython(pyx_files, working_path=''): """Use Cython to convert the given files to C. Parameters ---------- pyx_files : list of str The input .pyx files. """ # Do not build cython files if target is clean if len(sys.argv) >= 2 and sys.argv[1] == 'clean': return try: from Cython.Build import cythonize except ImportError: # If cython is not found, we do nothing -- the build will make use of # the distributed .c files print("Cython not found; falling back to pre-built %s" \ % " ".join([f.replace('.pyx', '.c') for f in pyx_files])) else: for pyxfile in [os.path.join(working_path, f) for f in pyx_files]: # if the .pyx file stayed the same, we don't need to recompile if not _changed(pyxfile): continue cythonize(pyxfile)
def _setup_extensions(self): # We defer extension setup until this command to leveraage 'setup_requires' pulling in Cython before we # attempt to import anything self.extensions = [] if try_murmur3: self.extensions.append(murmur3_ext) if try_libev: self.extensions.append(libev_ext) if try_cython: try: from Cython.Build import cythonize cython_candidates = ['cluster', 'concurrent', 'connection', 'cqltypes', 'metadata', 'pool', 'protocol', 'query', 'util'] compile_args = [] if is_windows else ['-Wno-unused-function'] self.extensions.extend(cythonize( [Extension('cassandra.%s' % m, ['cassandra/%s.py' % m], extra_compile_args=compile_args) for m in cython_candidates], nthreads=build_concurrency, exclude_failures=True)) self.extensions.extend(cythonize(NoPatchExtension("*", ["cassandra/*.pyx"], extra_compile_args=compile_args), nthreads=build_concurrency)) except Exception: sys.stderr.write("Failed to cythonize one or more modules. These will not be compiled as extensions (optional).\n")
def my_cythonize(extensions, **_ignore): #newextensions = [] for extension in extensions: print(extension.sources) should_cythonize = False sources = [] for sfile in extension.sources: path, ext = os.path.splitext(sfile) if ext in ('.pyx', '.py'): should_cythonize = True if not cython_present: # if extension.language == 'c++': ext = '.cpp' #else: # ext = '.c' if sfile == 'PyDeepCL.c': ext = '.cpp' # hack for now... not sure how to fix this cleanly # yet sfile = path + ext if sfile.startswith('..'): # use mysrc instead basename = os.path.basename(sfile) sfile = 'mysrc/' + basename sources.append(sfile) #print(should_cythonize) if should_cythonize and cython_present: print('cythonizing...') cythonize(extension) extension.sources[:] = sources #newextensions.append( extension ) return extensions
def run(self): # this is already imported, but the import might have failed. If so, raise an ImportError now. from Cython.Build import cythonize # Make sure the compiled Cython files in the distribution are up-to-date cythonize(['voropy/_voro.pyx']) _sdist.run(self)
def run(self): from Cython.Build import cythonize from _ExtMaker.GlobalMaker import Maker def regenApi(api, version): stuff = Maker(glazeAbsPath, specsAbsPath, gladAbsPath, api, {api: version}, self.announce, self.extensions, self.profile, self.force_spec_dl) stuff.create() for api in self.apis: regenApi(api, self.versions.get(api)) cythonizables = [] for file in os.listdir(glazeAbsPath): file = os.path.join(glazeAbsPath, file) if os.path.splitext(file)[1] == '.pyx': cythonizables.append(file) if not os.path.isfile(file) and os.path.basename(file) != 'glad': for file2 in os.listdir(file): file2 = os.path.join(file, file2) if os.path.isfile(file2): if os.path.splitext(file2)[1] == '.pyx': cythonizables.append(file2) cythonize(cythonizables, language='c++', # compile_time_env={'LIBRARY': b'default'}, nthreads=self.jobs, ) self.announce('Done. Now you can build_ext / install / develop', log.INFO)
def compile_cython(self): global cython_sources try: from Cython.Build import cythonize cythonize(cython_sources) except ImportError: pass
def do_setup(cython=False): if 'USE_CYTHON' in os.environ: if os.environ['USE_CYTHON'] == "false": cython = False packages = ['freeze'] if cython: print("Installing with cython\n") from Cython.Build import cythonize if version > 2: ext_modules = cythonize([ "freeze/xfreeze.py", "freeze/fpprint.py", ]) else: ext_modules = cythonize([ "freeze/xfreeze.py", ]) else: print("Installing without cython\n") ext_modules = [] setup( name = "freeze", version = __version__, packages = packages, ext_modules = ext_modules, install_requires = ['six'], author = "Adfinis-SyGroup", author_email = "https://adfinis-sygroup.ch/", description = "Freeze - dump / hash / sort / compare / diff anything", long_description = """ Freeze the state of data-structures and objects for data-analysis or testing (diffing data-structures). Frozen data-structures consist of only tuples and these are comparable/sortable/hashable. The freeze() function can be used for many purposes for example implement __hash__() for your complex object very fast. dump() is intended for testing and analysis.""", keywords = "freeze state hash sort compare unittest", url = "https://github.com/adfinis-sygroup/freeze", classifiers = [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Intended Audience :: Developers", "Intended Audience :: Education", "Intended Audience :: Information Technology", "License :: OSI Approved :: " "GNU Affero General Public License v3", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Software Development :: Libraries", "Topic :: Scientific/Engineering :: Information Analysis", "Topic :: Software Development :: Testing", ] )
def cython(pyx_files, working_path=''): """Use Cython to convert the given files to C. Parameters ---------- pyx_files : list of str The input .pyx files. """ # Do not build cython files if target is clean if len(sys.argv) >= 2 and sys.argv[1] == 'clean': return try: from Cython.Build import cythonize except ImportError: raise ImportError("Cython not found.") else: for pyxfile in [os.path.join(working_path, f) for f in pyx_files]: # if the .pyx file stayed the same, we don't need to recompile if not _changed(pyxfile): continue cythonize(pyxfile)
def run(self): # Make sure the compiled Cython files in the distribution are up-to-date from Cython.Build import cythonize cythonize(['_pysndfile.pyx']) shutil.move("setup.cfg", "setup.cfg.default") shutil.copy2("setup.cfg.dist", "setup.cfg") sdist.run(self) shutil.move("setup.cfg.default", "setup.cfg")
def run(self): try: from Cython.Build import cythonize cythonize(os.path.join('pyhsmm','**','*.pyx')) except: warn('Failed to generate extension files from Cython sources') finally: _sdist.run(self)
def run(self): from Cython.Build import cythonize for ext in self.distribution.ext_modules: sources = list(s for s in ext.sources if s.endswith('.pyx')) cythonize(sources) sdist_.run(self)
def run(self): import Cython from Cython.Build import cythonize assert float(Cython.__version__) >= 0.22 cythonize(define_extensions('.pyx'))
def run(self): cythonize( ext_cython_modules, include_path=cython_include_path, force=(not self.timestamps), annotate=self.annotate, compiler_directives=self.directive )
def cythonize_extensions(self): from Cython.Build import cythonize cythonize( self.extensions, compiler_directives={'embedsignature': True, 'language_level': 3}, force=True )
def cythonize_wrapper(modules, **kwargs): """ Calls cythonize, filtering useless warnings """ if not modules: return with CythonFilter() as cython_filter: with redirect_stdout(cython_filter): cythonize(modules, **kwargs)
def run(self): cythonize(extensions) for ext in extensions: for src in ext.sources: if not os.path.exists(src): raise Exception( "Cython-generated file '{0}' not found. " "Run 'python setup.py --usage' for details.".format(src, usage)) sdist.run(self)
def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('models', parent_package, top_path) include = os.path.join(get_python_lib(), 'compmech', 'include') lib = os.path.join(get_python_lib(), 'compmech', 'lib') if os.name == 'nt': runtime_library_dirs = None if os.environ.get('CONDA_DEFAULT_ENV') is not None: #NOTE removing openmp to compile in MiniConda args_linear = ['-O0'] args_nonlinear = ['-O0'] else: args_linear = ['/openmp'] args_nonlinear = ['/openmp', '/fp:fast'] else: runtime_library_dirs = [lib] if os.environ.get('CONDA_DEFAULT_ENV') is not None: #NOTE removing openmp to compile in MiniConda args_linear = ['-O0'] args_nonlinear = ['-O0'] else: args_linear = ['-fopenmp'] args_nonlinear = ['-fopenmp', '-ffast-math'] config.add_extension('bladestiff1d_clt_donnell_bardell', ['bladestiff1d_clt_donnell_bardell.pyx'], extra_compile_args=args_linear, runtime_library_dirs=runtime_library_dirs, include_dirs=[include], libraries=['bardell_functions', 'bardell'], library_dirs=[lib]) config.add_extension('bladestiff2d_clt_donnell_bardell', ['bladestiff2d_clt_donnell_bardell.pyx'], extra_compile_args=args_linear, runtime_library_dirs=runtime_library_dirs, include_dirs=[include], libraries=['bardell_functions', 'bardell'], library_dirs=[lib]) config.add_extension('tstiff2d_clt_donnell_bardell', ['tstiff2d_clt_donnell_bardell.pyx'], extra_compile_args=args_linear, runtime_library_dirs=runtime_library_dirs, include_dirs=[include], libraries=['bardell_functions', 'bardell', 'bardell_12', 'bardell_c0c1'], library_dirs=[lib]) cythonize(config.ext_modules) config.make_config_py() return config
def run(self): from Cython.Build import cythonize self.generate_pyx() cythonize([Extension("lightfm._lightfm_fast_no_openmp", ['lightfm/_lightfm_fast_no_openmp.pyx']), Extension("lightfm._lightfm_fast_openmp", ['lightfm/_lightfm_fast_openmp.pyx'], extra_link_args=['-fopenmp'])])
def run(self): try: from Cython.Build import cythonize cythonize([ module.replace('.', '/') + '.pyx' for module in cython_modules ]) except ImportError: pass _sdist.run(self)
def compile_pyx(): ext_modules = list() cparser = cythonize('pyrox/http/parser.pyx')[0] cparser.sources.insert(0, 'include/http_el.c') ext_modules.append(cparser) ext_modules.extend(cythonize('pyrox/http/model_util.pyx')) return ext_modules
def configuration(parent_package='', top_path=None): from numpy.distutils.misc_util import Configuration config = Configuration('science_features', parent_package, top_path) cythonize(os.path.join(base_path, '_lomb_scargle.pyx')) config.add_extension('_lomb_scargle', '_lomb_scargle.c', include_dirs=[np.get_include()]) return config
def run(self): build_ext = self.reinitialize_command('build_ext') build_ext.ensure_finalized() # generate cython extensions if any exist extensions = list(cython_pyx()) if extensions: from Cython.Build import cythonize cythonize(extensions, nthreads=cpu_count()) dst_sdist.sdist.run(self)
def cythonize_cpp_wrapper(modules, nthreads): """ Calls cythonize, filtering useless warnings """ from Cython.Build import cythonize from contextlib import redirect_stdout if not modules: return with CythonFilter() as cython_filter: with redirect_stdout(cython_filter): cythonize(modules, language='c++', nthreads=nthreads)
def run(self): # only run if .git is present if not os.path.exists('.git'): return try: from Cython.Build import cythonize cythonize(extensions()) except ImportError: warnings.warn('at sdist cythonize failed') return versioneer.cmd_sdist.run(self)
def run(self): build_ext = self.reinitialize_command('build_ext') build_ext.ensure_finalized() # generate cython extensions if any exist cython = any( os.path.splitext(f)[1] == '.pyx' for e in build_ext.extensions for f in e.sources) if cython: from Cython.Build import cythonize cythonize(build_ext.extensions) dst_sdist.sdist.run(self)
def run(self): # ensure that the platform checks were performed self.run_command('config') # only regenerate cython extensions if requested or required use_cython = ( os.environ.get('USE_CYTHON', False) or any(not os.path.exists(x) for ext in self.no_cythonize() for x in ext.sources)) if use_cython: from Cython.Build import cythonize cythonize(self.extensions, nthreads=cpu_count()) self.extensions = self.no_cythonize() return dst_build_ext.build_ext.run(self)
def finalize_options(self): from Cython.Build import cythonize self.distribution.ext_modules[:] = cythonize( self.distribution.ext_modules, compiler_directives={'embedsignature': True}, ) _build_ext.finalize_options(self)
def get_extensions(): from distutils.extension import Extension common_extension_args = { 'include_dirs': get_include_dirs(), 'library_dirs': get_library_dirs(), 'libraries': get_libraries()} try: from Cython.Build import cythonize sources = [os.path.join(os.getcwd(), 'pyfftw', 'pyfftw.pyx')] have_cython = True except ImportError as e: # no cython sources = [os.path.join(os.getcwd(), 'pyfftw', 'pyfftw.c')] if not os.path.exists(sources[0]): raise ImportError( str(e) + '. ' + 'Cython is required to build the initial .c file.') have_cython = False ext_modules = [ Extension('pyfftw.pyfftw', sources=sources, **common_extension_args)] if have_cython: return cythonize(ext_modules) else: return ext_modules
extensions = [Extension("orfipy_core", ["orfipy/orfipy_core.pyx"])] setuptools.setup( name="orfipy", version=open("orfipy/version.py").readlines()[-1].split( '=')[-1].strip().replace('"', ''), author="Urminder Singh", author_email="*****@*****.**", description="orfipy", long_description=long_description, long_description_content_type="text/markdown", url="https://github.com/urmi-21/orfipy", packages=setuptools.find_packages(), include_package_data=True, package_data={"": []}, scripts=[], entry_points={'console_scripts': ['orfipy = orfipy.__main__:main']}, install_requires=[ line.rstrip() for line in open("requirements.txt", "rt") ], tests_require=["pytest"], classifiers=[ "Programming Language :: Python :: 3", "License :: OSI Approved :: MIT License", "Operating System :: Unix", ], python_requires='>=3.5', cmdclass={"build_ext": build_ext}, ext_modules=cythonize(extensions))
from distutils.core import setup from Cython.Build import cythonize import numpy setup(ext_modules=cythonize( "cppclass.pyx", language="c++", ), include_dirs=[numpy.get_include()])
long_description=LONG_DESCRIPTION, url=URL, download_url=DOWNLOAD_URL, license=LICENSE, classifiers=CLASSIFIERS, author=AUTHOR, author_email=AUTHOR_EMAIL, platforms=PLATFORMS, version=VERSION, packages=PACKAGES, install_requires=REQUIRES, requires=REQUIRES, scripts=SCRIPTS) extensions = [ Extension('scilpy.tractanalysis.uncompress', ['scilpy/tractanalysis/uncompress.pyx'], include_dirs=[numpy.get_include()]), Extension('scilpy.tractanalysis.quick_tools', ['scilpy/tractanalysis/quick_tools.pyx'], include_dirs=[numpy.get_include()]), Extension('scilpy.tractanalysis.streamlines_metrics', ['scilpy/tractanalysis/streamlines_metrics.pyx'], include_dirs=[numpy.get_include()]) ] opts['ext_modules'] = cythonize(extensions) if __name__ == '__main__': setup(**opts)
setup( name=PROJECT_NAME, version=VERSION, url='https://github.com/Drakkar-Software/OctoBot-Backtesting', license='LGPL-3.0', author='Drakkar-Software', author_email='*****@*****.**', description='OctoBot project backtesting engine', packages=PACKAGES, include_package_data=True, # long_description=DESCRIPTION, cmdclass={'build_ext': build_ext}, tests_require=["pytest"], test_suite="tests", zip_safe=False, data_files=[], setup_requires=REQUIRED if not CYTHON_DEBUG else [], install_requires=REQUIRED, ext_modules=cythonize(ext_modules, gdb_debug=CYTHON_DEBUG), python_requires=REQUIRES_PYTHON, classifiers=[ 'Development Status :: 4 - Beta', 'Operating System :: OS Independent', 'Operating System :: MacOS :: MacOS X', 'Operating System :: Microsoft :: Windows', 'Operating System :: POSIX', 'Programming Language :: Python :: 3.7', 'Programming Language :: Cython', ], )
compilation_includes = [".", numpy.get_include()] setup_path = path.dirname(path.abspath(__file__)) # build extension list extensions = [] for root, dirs, files in os.walk(setup_path): for file in files: if path.splitext(file)[1] == ".pyx": pyx_file = path.relpath(path.join(root, file), setup_path) module = path.splitext(pyx_file)[0].replace("/", ".") extensions.append( Extension(module, [pyx_file], include_dirs=compilation_includes), ) if profile: directives = {"profile": True} else: directives = {} setup(name="cherab-aug", version="1.0.0", license="EUPL 1.1", namespace_packages=['cherab'], packages=find_packages(), include_package_data=True, ext_modules=cythonize(extensions, nthreads=threads, force=force, compiler_directives=directives))
from distutils.core import setup from distutils.extension import Extension from Cython.Distutils import build_ext from Cython.Build import cythonize import numpy as np ''' To compile the cython plugin, run this command: python compile.py build_ext --inplace ''' ext_modules = [ Extension('*', ['typySim/core/cy/*.pyx'], include_dirs=[np.get_include()], extra_compile_args=['-fopenmp'], extra_link_args=['-fopenmp']), Extension('*', ['typySim/compute/cy/*.pyx'], include_dirs=[np.get_include()], extra_compile_args=['-fopenmp', '-Wno-maybe-uninitialized'], extra_link_args=['-fopenmp', '-Wno-maybe-uninitialized']), Extension('*', ['typySim/potential/cy/*.pyx'], include_dirs=[np.get_include()], extra_compile_args=['-fopenmp'], extra_link_args=['-fopenmp']), ] setup(cmdclass={'build_ext': build_ext}, ext_modules=cythonize(ext_modules, language='c++'), script_name='compile.py', script_args=['build_ext', '--inplace']) # sed -i 's/# # cython/# cython/g' */cy/{*pyx,*pxd}
def pyrobufize_builtins(self): from jinja2 import Environment, PackageLoader from Cython.Build import cythonize env = Environment( loader=PackageLoader('pyrobuf.protobuf', 'templates')) templ_pyx = env.get_template('pyrobuf_list_pyx.tmpl') templ_pxd = env.get_template('pyrobuf_list_pxd.tmpl') listdict = { 'DoubleList': 'double', 'FloatList': 'float', 'IntList': 'int', 'Int32List': 'int32_t', 'Uint32List': 'uint32_t', 'Int64List': 'int64_t', 'Uint64List': 'uint64_t', 'CharList': 'char' } format_map = { 'double': 'd', 'float': 'f', 'int': 'i', 'int32_t': 'i', 'uint32_t': 'I', 'int64_t': 'L', 'uint64_t': 'K', 'char': 'c', } # Even if PYROBUF_LIST_PYX and PYROBUF_LIST_PXD already exist they should be re-built because # we don't know whether they were built using *this* version of Python. path = os.path.join(HERE, 'pyrobuf', 'src', PYROBUF_LIST_PYX) if not self.dry_run: with open(path, 'w') as fp: fp.write( templ_pyx.render({ 'def': listdict, 'version_major': sys.version_info.major, 'format_map': format_map })) if self.verbose >= 1: log.info("rendering '%s' from '%s'" % (PYROBUF_LIST_PYX, templ_pyx.filename)) path = os.path.join(HERE, 'pyrobuf', 'src', PYROBUF_LIST_PXD) if not self.dry_run: with open(path, 'w') as fp: fp.write( templ_pxd.render({ 'def': listdict, 'version_major': sys.version_info.major, 'format_map': format_map })) if self.verbose >= 1: log.info("rendering '%s' from '%s'" % (PYROBUF_LIST_PXD, templ_pxd.filename)) # Cython doesn't always supply the UNAME_SYSNAME definition, so we'll roll our own path = os.path.join(HERE, 'pyrobuf', 'src', PYROBUF_DEFS_PXI) with open(path, 'w') as defs: uname = zip( ('SYSNAME', 'NODENAME', 'RELEASE', 'VERSION', 'MACHINE'), platform.uname()) defs.write("# Generated by pyrobuf/setup.py. DO NOT EDIT!\n\n") defs.write('\n'.join('DEF PYROBUF_UNAME_%s = "%s"' % (k, v) for k, v in uname)) defs.write('\n') return cythonize(['pyrobuf/src/*.pyx'], include_path=['pyrobuf/src'])
from distutils.core import setup, Extension from Cython.Build import cythonize import numpy setup(ext_modules = cythonize(Extension( "log_uniform", # the extension name sources=["log_uniform.pyx", "Log_Uniform_Sampler.cpp"], # the Cython source and additional C++ source files language="c++", # generate and compile C++ code include_dirs=[numpy.get_include()], extra_compile_args=["-std=c++11"] )))
"docopt", "h5py >= 2.6.0", "matplotlib", "mpi4py >= 2.0.0", "numpy", "scipy >= 0.13.0" ] # Grab long_description from README with open('README.md') as f: long_description = f.read() # Cython directives compiler_directives = {} compiler_directives['language_level'] = 3 if bool_env('CYTHON_PROFILE', unset=False): compiler_directives['profile'] = True setup( name='dedalus', version='2.1905', author='Keaton J. Burns', author_email='*****@*****.**', description= "A flexible framework for solving differential equations using spectral methods.", long_description=long_description, long_description_content_type='text/markdown', url='http://dedalus-project.org', classifiers=['Programming Language :: Python :: 3'], install_requires=install_requires, license='GPL3', packages=setuptools.find_packages(), package_data={'': ['dedalus.cfg']}, ext_modules=cythonize(extensions, compiler_directives=compiler_directives))
from distutils.core import setup from Cython.Build import cythonize import numpy import sys setup(ext_modules=cythonize('typedcython.pyx'), include_dirs=[numpy.get_include()])
#!/usr/bin/python3 from distutils.core import setup from Cython.Build import cythonize setup(name='TSP', ext_modules=cythonize("tsp.pyx"))
# setup.py from distutils.core import setup, Extension from Cython.Build import cythonize import numpy setup(ext_modules = cythonize(Extension( 'detect_face_c', sources=['detect_face_c.pyx'], language='c', include_dirs=[numpy.get_include()], library_dirs=[], libraries=[], extra_compile_args=[], extra_link_args=[] )))
ext = Extension(name='.'.join(pyxfile.split('/'))[:-4], sources=[pyxfile], define_macros=define_macros) extensions.append(ext) return extensions setup( name=NAME, version=VERSION, description=DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, url=URL, packages=find_packages(), include_package_data=True, py_modules=['PyFin.__init__', 'PyFin.tests.testSuite'], install_requires=io.open(requirements, encoding='utf8').read(), classifiers=[], cmdclass={ "test": test, "version_build": version_build }, ext_modules=cythonize(generate_extensions(ext_modules, line_trace), compiler_directives={ 'embedsignature': True, 'linetrace': line_trace }), include_dirs=[np.get_include()], )
""" In order to build the cythoned version of a function the following command can be used: python3 setup_cython_functions.py build_ext --inplace This command should create a file: sum_cy.cpython-36m-darwin.so """ from distutils.core import setup from Cython.Build import cythonize setup(ext_modules = cythonize("./cython_code/cy_func.pyx",annotate=True)) setup(ext_modules = cythonize("./cython_code/cy_func2.pyx",annotate=True)) # extra_compile_args=['-fopenmp', '-march=native','-msse', '-msse2', '-mfpmath=sse' ])
sources=["turtlpy/turtle_core.pyx"], libraries=["turtl_core"], library_dirs=["./turtlpy"], include_dirs=[] ) install_requires = [x.strip() for x in all_reqs if 'git+' not in x] dependency_links = [x.strip() for x in all_reqs if x.startswith('git+')] setup( name='turtlpy', version_format='{tag}.dev{commitcount}+{gitsha}', setup_requires=['setuptools-git-version','pytest-runner','cython'], description='Python client for the Turtl Note App System. This is basically a wrapper around the turtl-core. Useful for backing up or building interfaces to other note taking apps.', long_description=long_description, classifiers=[ 'Development Status :: 3 - Alpha', 'Intended Audience :: Developers', 'Programming Language :: Python :: 3', ], entry_points={'console_scripts': []}, keywords='', ext_modules=cythonize([turtlpy_core_ext]), packages=find_packages(exclude=['docs', 'tests*']), include_package_data=True, author='Tobias Schoch', install_requires=install_requires, tests_require=['pytest'], dependency_links=dependency_links, author_email='*****@*****.**' )
description=('A cross-platform point of sales payment manager tool with Telium Manager ' 'Support every device with Telium Manager like Ingenico terminals.'), license='MIT', packages=['telium'], test_suite='test', url='https://github.com/Ousret/pyTeliumManager', download_url='https://github.com/Ousret/pyTeliumManager/archive/2.2.1.tar.gz', install_requires=['pyserial>=3.3', 'pycountry>=17.0', 'payment_card_identifier>=0.1.1'], tests_require=['Faker'], keywords=['ingenico', 'telium manager', 'telium', 'payment', 'credit card', 'debit card', 'visa', 'mastercard', 'merchant', 'pos'], classifiers=[ 'Development Status :: 5 - Production/Stable', 'Environment :: Win32 (MS Windows)', 'Environment :: X11 Applications', 'Environment :: MacOS X', 'Intended Audience :: Developers', 'License :: OSI Approved :: BSD License', 'Operating System :: OS Independent', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.1', 'Programming Language :: Python :: 3.2', 'Programming Language :: Python :: 3.3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', ], ext_modules=cythonize(extensions) if CYTHONIZE_EQUIPPED else None )
ext_modules.append(posix_ext) if sys.platform == 'linux': ext_modules.append(linux_ext) elif sys.platform.startswith('freebsd'): ext_modules.append(freebsd_ext) elif sys.platform == 'darwin': ext_modules.append(darwin_ext) # sometimes there's no need to cythonize # this breaks chained commands like 'clean sdist' cythonizing = len(sys.argv) > 1 and sys.argv[1] not in ('clean', 'egg_info', '--help-commands', '--version') \ and '--help' not in sys.argv[1:] if cythonize and cythonizing: # compile .pyx extensions to .c in parallel cythonize([posix_ext, linux_ext, freebsd_ext, darwin_ext], nthreads=cpu_threads+1) ext_modules = cythonize(ext_modules, nthreads=cpu_threads+1) setup( name='borgbackup', use_scm_version={ 'write_to': 'src/borg/_version.py', }, author='The Borg Collective (see AUTHORS file)', author_email='*****@*****.**', url='https://borgbackup.readthedocs.io/', description='Deduplicated, encrypted, authenticated and compressed backups', long_description=long_description, license='BSD', platforms=['Linux', 'MacOS X', 'FreeBSD', 'OpenBSD', 'NetBSD', ], classifiers=[
from setuptools import Extension, setup from Cython.Build import cythonize import numpy as np import os os.system("apt-get install libblas-dev liblapack-dev") setup( ext_modules=cythonize( Extension(name="midasml2", sources=[ 'pyx/midasml2.pyx', 'src/wrapper1.cpp', 'src/wrapper2.cpp', 'src/fit_sgl.cpp', 'src/ld_estim.cpp' ], language='c++', extra_compile_args=['-w'], libraries=['blas', 'lapack'])), language='c++', include_dirs=[np.get_include(), 'include/'], )
cython_directives = { "embedsignature": True, "language_level": 3, } # enable coverage for cython if int(os.getenv("CYTHON_LINETRACE", "0")): cython_directives["linetrace"] = True cython_compile_args.append("-DCYTHON_TRACE") # define compiled extensions exts = [ Extension( "sbank.overlap_cpu", ["sbank/overlap_cpu.pyx"], include_dirs=[numpy.get_include()], language="c", libraries=["lal"], extra_compile_args=cython_compile_args, extra_link_args=[], ), ] # -- build the thing # this function only manually specifies things that aren't # supported by setup.cfg (as of setuptools-30.3.0) setup( version=find_version(Path("sbank") / "__init__.py"), ext_modules=cythonize(exts, compiler_directives=cython_directives), )
DESCRIPTION = "Implements Demixed Principal Components Analysis" LONG_DESCRIPTION = DESCRIPTION NAME = "dPCA" AUTHOR = "Machens Lab" AUTHOR_EMAIL = "*****@*****.**" MAINTAINER = "Alex Williams" MAINTAINER_EMAIL = "*****@*****.**" DOWNLOAD_URL = 'https://github.com/ahwillia/dPCA' LICENSE = 'MIT' VERSION = '0.1' setup(name=NAME, version=VERSION, description=DESCRIPTION, long_description=LONG_DESCRIPTION, author=AUTHOR, author_email=AUTHOR_EMAIL, maintainer=MAINTAINER, maintainer_email=MAINTAINER_EMAIL, url=DOWNLOAD_URL, download_url=DOWNLOAD_URL, license=LICENSE, packages=['dPCA'], package_data={}) from Cython.Build import cythonize setup(ext_modules=cythonize("dPCA/nan_shuffle.pyx"), include_dirs=[numpy.get_include()])
'Operating System :: Unix', 'Operating System :: POSIX', 'Operating System :: Microsoft :: Windows', 'Programming Language :: Python', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', 'Topic :: Utilities', ], project_urls={ 'Documentation': 'https://pyrosm.github.io/', 'Issue Tracker': 'https://github.com/htenkanen/pyrosm/issues', }, keywords=[ 'OpenStreetMap', 'Geopandas', 'GeoDataFrame', 'parser', 'protobuf', 'PBF' ], python_requires='>=3.6', install_requires=requirements, setup_requires=requirements, pyrobuf_modules="proto", ext_modules=cythonize( os.path.join("pyrosm", "*.pyx"), annotate=False, compiler_directives={ 'language_level': "3", #'linetrace': True }))
from distutils.core import setup from Cython.Build import cythonize setup(ext_modules=cythonize( "/Users/gillian/Desktop/marshall/MGDrivE/MGDrivE/src/MGDrivE-DistanceFunctions.cpp" ))
author=PACKAGE_AUTHOR, author_email=PACKAGE_EMAIL, packages=setuptools.find_packages(), package_data={ 'apache_beam': [ '*/*.pyx', '*/*/*.pyx', '*/*.pxd', '*/*/*.pxd', 'testing/data/*.yaml', 'portability/api/*.yaml' ] }, ext_modules=cythonize([ 'apache_beam/**/*.pyx', 'apache_beam/coders/coder_impl.py', 'apache_beam/metrics/cells.py', 'apache_beam/metrics/execution.py', 'apache_beam/runners/common.py', 'apache_beam/runners/worker/logger.py', 'apache_beam/runners/worker/opcounters.py', 'apache_beam/runners/worker/operations.py', 'apache_beam/transforms/cy_combiners.py', 'apache_beam/utils/counters.py', 'apache_beam/utils/windowed_value.py', ]), install_requires=REQUIRED_PACKAGES, python_requires=python_requires, test_suite='nose.collector', # BEAM-8840: Do NOT use tests_require or setup_requires. extras_require={ 'docs': ['Sphinx>=1.5.2,<2.0'], 'test': REQUIRED_TEST_PACKAGES, 'gcp': GCP_REQUIREMENTS, 'interactive': INTERACTIVE_BEAM,
def __init__(self): self.debug = DEBUG self.verbose = VERBOSE self.module_name = 'cechomesh' self.library_name = '%s.so' % self.module_name pyx_files = ['cechomesh.pyx'] libraries = ['echomesh', 'pthread', 'glog'] extra_compile_args = ( '-I. -fmessage-length=0 -std=c++11 ' ' -IJuceLibraryCode -Ibuild/include -Wno-unused-function ') if DEBUG: extra_args = {'cython_gdb': True, 'pyrex_gdb': True} extra_compile_args += '-O0 -g -D_DEBUG=1 -DDEBUG=1 ' extra_link_args = '-g ' else: extra_args = {} extra_compile_args += '-O2 ' extra_link_args = '-flto ' if Platform.PLATFORM == Platform.MAC: extra_link_args += ( '-framework Cocoa -framework WebKit -framework CoreMidi ') extra_compile_args += '-stdlib=libc++ -x c++ -arch x86_64 ' if DEBUG: echomesh_lib = 'Builds/MacOSX/build/Debug' else: echomesh_lib = 'Builds/MacOSX/build/Release' elif Platform.PLATFORM == Platform.UBUNTU: extra_link_args += ( '-lc++ -L/usr/X11R6/lib/ -lX11 -lXext -lXinerama -lasound ' '-ldl -lfreetype -lrt -lechomesh') extra_compile_args += '-stdlib=libc++ -arch x86_64 -x c++ ' if DEBUG: echomesh_lib = 'Builds/Linux/build/Debug' else: echomesh_lib = 'Builds/Linux/build' elif Platform.PLATFORM == Platform.RASPBERRY_PI: extra_link_args += ( '-L/usr/X11R6/lib/ -lX11 -lXext -lXinerama -lasound ' '-ldl -lfreetype -lrt -lechomesh') echomesh_lib = 'Builds/Linux/build' else: raise Exception("Don't understand platform %s" % Platform.PLATFORM) extra_compile_args = extra_compile_args.split() extra_link_args = extra_link_args.split() self.bin_dir = Path.LIBRARY_PATH lib_dirs = ['build/lib', echomesh_lib] ext = extension.Extension(self.module_name, pyx_files, library_dirs=lib_dirs, libraries=libraries, extra_compile_args=extra_compile_args, extra_link_args=extra_link_args, **extra_args) self.modules = cythonize([ext], **extra_args) self.c_library = os.path.join(echomesh_lib, 'libechomesh.a')
include_dirs=[numpy.get_include()] ) ] else : ext_modules=[ Extension(default+"darkflow.cython_utils.nms", sources=[default+"darkflow/cython_utils/nms.pyx"], libraries=["m"] # Unix-like specific ), Extension(default+"darkflow.cython_utils.cy_yolo2_findboxes", sources=[default+"darkflow/cython_utils/cy_yolo2_findboxes.pyx"], libraries=["m"] # Unix-like specific ), Extension(default+"darkflow.cython_utils.cy_yolo_findboxes", sources=[default+"darkflow/cython_utils/cy_yolo_findboxes.pyx"], libraries=["m"] # Unix-like specific ) ] setup( version=VERSION, name='darkflow', description='Darkflow', license='GPLv3', url='https://github.com/thtrieu/darkflow', packages = find_packages(), scripts = ['flow'], ext_modules = cythonize(ext_modules) )
#!/usr/bin/env python from setuptools import setup from Cython.Build import cythonize setup( ext_modules=cythonize('matching.pyx') )
data_files = [ *files, os.path.join('fastchem_src', 'chem_input', 'chemical_elements.dat') ] version = "1.0.0-dev0" with open("README.md", "r") as fh: long_description = fh.read() pos = long_description.find('# TauREx') long_description = long_description[pos:] ext = cythonize([clib], language_level="3") setup( name='taurex_fastchem', author="Ahmed Faris Al-Refaie", author_email="*****@*****.**", license="BSD", description='Python Wrapper for FastChem chemical scheme', packages=packages, ext_modules=ext, entry_points=entry_points, provides=provides, requires=requires, version=version, keywords=[ 'exoplanet', 'chemistry' 'taurex', 'plugin', 'taurex3', 'atmosphere', 'atmospheric'
) return pkg_info, ExtConfig(package_dir, packages, package_data, ext_modules, {}) if __name__ == '__main__': from Cython.Build import cythonize lib = get_libinfo() root_dir = os.path.realpath(os.path.dirname(__file__)) pkg_info, cfg = get_setup_config(root_dir, lib) # Cythonize ext_modules = cythonize(cfg.ext_modules, compiler_directives={ "embedsignature": True, "c_string_type": 'str', "c_string_encoding": "ascii" }) # Setup setup(entry_points={ "console_scripts": ["nnabla_cli=nnabla.utils.cli.cli:main"] }, setup_requires=setup_requires, install_requires=install_requires, ext_modules=ext_modules, package_dir=cfg.package_dir, packages=cfg.packages, package_data=cfg.package_data, **pkg_info)
def cythonize(*args, **kwargs): from Cython.Build import cythonize return cythonize(*args, **kwargs)
# removes the "default" compiler flags that would # otherwise get passed on to nvc++, i.e., # distutils.sysconfig.get_var("CFLAGS"). nvc++ # does not support all of those "default" flags compile_args = "-fPIC -stdpar -gpu=nordc -std=c++17" link_args = "-shared -stdpar" self.compiler.set_executable("compiler_so", NVCPP_EXE + " " + compile_args) self.compiler.set_executable("compiler_cxx", NVCPP_EXE) self.compiler.set_executable("linker_so", NVCPP_EXE + " " + link_args) build_ext.build_extensions(self) ext = cythonize([ Extension('*', sources=['*.pyx'], libraries=libraries, include_dirs=include_dirs, library_dirs=library_dirs, runtime_library_dirs=library_dirs, extra_compile_args=["-std=c++17"]) ]) setup(name='cppsort', author='Ashwin Srinath', version='0.1', ext_modules=ext, zip_safe=False, cmdclass={'build_ext': custom_build_ext})
def configuration(parent_package='',top_path=None): from numpy.distutils.misc_util import Configuration if os.name == 'nt': if os.environ.get('CONDA_DEFAULT_ENV') is not None: #NOTE removing openmp to compile in MiniConda compile_args = [] else: compile_args = ['/openmp'] else: if os.environ.get('CONDA_DEFAULT_ENV') is not None: #NOTE removing openmp to compile in MiniConda compile_args = [] else: compile_args = ['-fopenmp'] config = Configuration('imperfections', parent_package, top_path) config.add_extension('mgi', sources=['mgi.pyx'], ) cythonize(config.ext_modules) config.make_config_py() return config