Beispiel #1
0
def build_module(name, pyxfilename, pyxbuild_dir=None, inplace=False, language_level=None):
    assert os.path.exists(pyxfilename), (
        "Path does not exist: %s" % pyxfilename)
    handle_dependencies(pyxfilename)

    extension_mod,setup_args = get_distutils_extension(name, pyxfilename, language_level)
    build_in_temp=pyxargs.build_in_temp
    sargs=pyxargs.setup_args.copy()
    sargs.update(setup_args)
    build_in_temp=sargs.pop('build_in_temp',build_in_temp)

    import pyxbuild
    so_path = pyxbuild.pyx_to_dll(pyxfilename, extension_mod,
                                  build_in_temp=build_in_temp,
                                  pyxbuild_dir=pyxbuild_dir,
                                  setup_args=sargs,
                                  inplace=inplace,
                                  reload_support=pyxargs.reload_support)
    assert os.path.exists(so_path), "Cannot find: %s" % so_path
    
    junkpath = os.path.join(os.path.dirname(so_path), name+"_*") #very dangerous with --inplace ?
    junkstuff = glob.glob(junkpath)
    for path in junkstuff:
        if path!=so_path:
            try:
                os.remove(path)
            except IOError:
                _info("Couldn't remove %s", path)

    return so_path
Beispiel #2
0
def build_module(name, pyxfilename, pyxbuild_dir=None):
    assert os.path.exists(pyxfilename), "Path does not exist: %s" % pyxfilename
    handle_dependencies(pyxfilename)

    extension_mod, setup_args = get_distutils_extension(name, pyxfilename)
    build_in_temp = pyxargs.build_in_temp
    sargs = pyxargs.setup_args.copy()
    sargs.update(setup_args)
    build_in_temp = sargs.pop("build_in_temp", build_in_temp)

    import pyxbuild

    so_path = pyxbuild.pyx_to_dll(
        pyxfilename,
        extension_mod,
        build_in_temp=build_in_temp,
        pyxbuild_dir=pyxbuild_dir,
        setup_args=sargs,
        reload_support=pyxargs.reload_support,
    )
    assert os.path.exists(so_path), "Cannot find: %s" % so_path

    junkpath = os.path.join(os.path.dirname(so_path), name + "_*")  # very dangerous with --inplace ?
    junkstuff = glob.glob(junkpath)
    for path in junkstuff:
        if path != so_path:
            try:
                os.remove(path)
            except IOError:
                _info("Couldn't remove %s", path)

    return so_path
Beispiel #3
0
def build_module(name, pyxfilename):
    assert os.path.exists(pyxfilename), (
		"Path does not exist: %s" % pyxfilename)
    handle_dependencies(pyxfilename)

    extension_mod = get_distutils_extension(name, pyxfilename)

    so_path = pyxbuild.pyx_to_dll(pyxfilename, extension_mod)
    assert os.path.exists(so_path), "Cannot find: %s" % so_path

    junkpath = os.path.join(os.path.dirname(so_path), name+"_*")
    junkstuff = glob.glob(junkpath)
    for path in junkstuff:
	if path!=so_path:
	    try:
		os.remove(path)
	    except IOError:
		print "Couldn't remove ", path

    return so_path