How to use the julia.core._enviorn function in julia

To help you get started, we’ve selected a few julia examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JuliaPy / pyjulia / test / test_juliainfo.py View on Github external
"""

    runtime = os.getenv("PYJULIA_TEST_RUNTIME", "julia")

    env_var = subprocess.check_output(
        [runtime, "--startup-file=no", "-e", """
        if VERSION < v"0.7-"
            println("JULIA_PKGDIR")
            print(ARGS[1])
        else
            paths = [ARGS[1], DEPOT_PATH[2:end]...]
            println("JULIA_DEPOT_PATH")
            print(join(paths, Sys.iswindows() ? ';' : ':'))
        end
        """, str(tmpdir)],
        env=_enviorn,
        universal_newlines=True)
    name, val = env_var.split("\n", 1)

    jlinfo = JuliaInfo.load(
        runtime,
        env=dict(_enviorn, **{name: val}))

    check_core_juliainfo(jlinfo)
    assert jlinfo.python is None
    assert jlinfo.libpython_path is None
github JuliaPy / pyjulia / test / test_juliainfo.py View on Github external
if VERSION < v"0.7-"
            println("JULIA_PKGDIR")
            print(ARGS[1])
        else
            paths = [ARGS[1], DEPOT_PATH[2:end]...]
            println("JULIA_DEPOT_PATH")
            print(join(paths, Sys.iswindows() ? ';' : ':'))
        end
        """, str(tmpdir)],
        env=_enviorn,
        universal_newlines=True)
    name, val = env_var.split("\n", 1)

    jlinfo = JuliaInfo.load(
        runtime,
        env=dict(_enviorn, **{name: val}))

    check_core_juliainfo(jlinfo)
    assert jlinfo.python is None
    assert jlinfo.libpython_path is None
github JuliaPy / pyjulia / test / test_compatible_exe.py View on Github external
def runcode(python, code, check=False, **kwargs):
    """Run `code` in `python`."""
    proc = run(
        [python],
        input=textwrap.dedent(code),
        stdout=subprocess.PIPE,
        stderr=subprocess.PIPE,
        universal_newlines=True,
        env=dict(
            _enviorn,
            # Make PyJulia importable:
            PYTHONPATH=os.path.join(
                os.path.dirname(os.path.dirname(os.path.realpath(__file__))), "src"
            ),
        ),
        **kwargs
    )
    print_completed_proc(proc)
    if check:
        assert proc.returncode == 0
    return proc