Beispiel #1
0
        # be packaged with the wheel
        libs = find_linked_dynamic_libraries()
        for libpath in libs:
            trgfile = os.path.join("datatable", "lib",
                                   os.path.basename(libpath))
            if os.path.exists(trgfile):
                log.info("File %s already exists, skipped" % trgfile)
            else:
                log.info("Copying %s to %s" % (libpath, trgfile))
                shutil.copy(libpath, trgfile)

    monkey_patch_compiler()

# Create the git version file
if cmd in ("build", "sdist", "bdist_wheel", "install"):
    make_git_version_file(True)

#-------------------------------------------------------------------------------
# Main setup
#-------------------------------------------------------------------------------
setuptools.setup(
    name="datatable",
    version=get_datatable_version(),
    description="Python library for fast multi-threaded data manipulation and "
    "munging.",
    long_description="""
        This is a Python package for manipulating 2-dimensional tabular data
        structures (aka data frames). It is close in spirit to pandas or SFrame;
        however we put specific emphasis on speed and big data support. As the
        name suggests, the package is closely related to R's data.table and
        attempts to mimic its core algorithms and API.
Beispiel #2
0
def main():
    import argparse
    parser = argparse.ArgumentParser(
        description='Build _datatable module',
        formatter_class=argparse.RawTextHelpFormatter)
    parser.add_argument("cmd",
                        metavar="CMD",
                        choices=[
                            "asan", "build", "coverage", "debug", "gitver",
                            "sdist", "wheel"
                        ],
                        help=textwrap.dedent("""
            Specify what this script should do:

            asan     : build _datatable with Address Sanitizer enabled
            build    : build _datatable normally, with full optimization
            coverage : build _datatable in a mode suitable for coverage
                       testing
            debug    : build _datatable in debug mode, optimized for gdb
                       on Linux and for lldb on MacOS
            gitver   : generate __git__.py file
            sdist    : create source distribution of datatable
            wheel    : create wheel distribution of datatable
            """).strip())
    parser.add_argument(
        "-v",
        dest="verbosity",
        action="count",
        default=1,
        help="Verbosity level of the output, specify the parameter up to 3\n"
        "times for maximum verbosity; the default level is 1.")
    parser.add_argument(
        "-d",
        dest="destination",
        default="dist",
        help="Destination directory for `sdist` and `wheel` commands.")
    parser.add_argument(
        "--audit",
        action="store_true",
        help="This flag can be used with cmd='wheel' only, on a Linux\n"
        "platform, which must have the 'auditwheel' external tool\n"
        "installed. If this flag is specified, then after building a\n"
        "wheel, it will be tested with the auditwheel. If the test\n"
        "succeeds, i.e. the wheel is found to be compatible with a\n"
        "manylinux* tag, then the wheel will be renamed to use the new\n"
        "tag. Otherwise, an error will be raised.")

    args = parser.parse_args()
    if args.cmd in ["sdist", "wheel"]:
        make_git_version_file(True)
    if args.audit and "linux" not in sys.platform:
        raise ValueError("Argument --audit can be used on a Linux platform "
                         "only, current platform is `%s`" % sys.platform)

    if args.cmd == "wheel":
        wheel_file = build_wheel(args.destination, {"audit": args.audit})
        assert os.path.isfile(os.path.join("dist", wheel_file))
    elif args.cmd == "sdist":
        sdist_file = build_sdist(args.destination)
        assert os.path.isfile(os.path.join("dist", sdist_file))
    elif args.cmd == "gitver":
        make_git_version_file(True)
    else:
        with open("datatable/lib/.xbuild-cmd", "wt") as out:
            out.write(args.cmd)
        build_extension(cmd=args.cmd, verbosity=args.verbosity)