Example #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)
Example #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")),
    )
Example #3
0
def run_test(test):
    return sh(
        "{test}",
        cwd="test",
        env=ENV,
        test=test,
        interactive=test.output.name in INTERACTIVE_TESTS,
    )
Example #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,
    )
Example #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,
    )
Example #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,
    )
Example #7
0
def submodules():
    return sh("git submodule update --init --recursive")
Example #8
0
def run_tests(tests):
    return tuple(sh("{input}", input=test, cwd="test") for test in tests)
Example #9
0
def run_test(app):
    return sh("{test}", test=app, cwd="test", interactive=True)
Example #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'])
Example #11
0
def pymodule_sdist(submodules):
    return sh("python3 setup.py sdist", output="dist")