Exemplo n.º 1
0
def pybind11_tests(submodules):
    return Recipe([
        sh("mkdir -p {output}", output="pybind11-test-build"),
        sh("cmake ../pybind11", cwd=Path("pybind11-test-build")),
        sh("make check -j 4",
           cwd=Path("pybind11-test-build"),
           interactive=True),
    ],
                  synchronous=True,
                  setup=submodules)
Exemplo n.º 2
0
def link_pybind11_module(pybind11_module_objects):
    return sh(
        "{CC} -O3 -shared -Wall -std=c++2a -fPIC {input} -o {output}",
        env=RELEASE_ENV,
        input=pybind11_module_objects,
        output=Path("jotdown%s" % check("python3-config --extension-suffix")),
    )
Exemplo n.º 3
0
def run_test(test):
    return sh(
        "{test}",
        cwd="test",
        env=ENV,
        test=test,
        interactive=test.output.name in INTERACTIVE_TESTS,
    )
Exemplo n.º 4
0
def compile_test(src, headers):
    return sh(
        "{CC} {CFLAGS} {src} {LDFLAGS} -o {output}",
        env=ENV,
        src=src,
        output=Path(src).with_suffix(""),
        requires=headers,
    )
Exemplo n.º 5
0
def compile_app(src, headers, env):
    return sh(
        "{CC} {CFLAGS} {src} {LDFLAGS} -o {output}",
        env=env,
        src=src,
        output=Path(src).with_suffix(""),
        includes=headers,
    )
Exemplo n.º 6
0
def compile_pybind11_module_object(src, headers, tests):
    return sh(
        "{CC} -O3 -shared -Wall -std=c++2a -fPIC {flags} {src} -o {output}",
        env=RELEASE_ENV,
        src=src,
        tests=tests,
        output=Path(src).with_suffix(".o"),
        flags=INCLUDES + shlex.split(check("python-config --includes")),
        requires=headers,
    )
Exemplo n.º 7
0
def submodules():
    return sh("git submodule update --init --recursive")
Exemplo n.º 8
0
def run_tests(tests):
    return tuple(sh("{input}", input=test, cwd="test") for test in tests)
Exemplo n.º 9
0
def run_test(app):
    return sh("{test}", test=app, cwd="test", interactive=True)
Exemplo n.º 10
0
def upload_to_pypi(latest_tarball, pypi_password):
    return sh("twine upload -u {PYPI_USERNAME} -p {password} {input}",
              PYPI_USERNAME=PYPI_USERNAME,
              password=pypi_password,
              input=latest_tarball,
              redacted=['password'])
Exemplo n.º 11
0
def pymodule_sdist(submodules):
    return sh("python3 setup.py sdist", output="dist")