Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_add_pycall(juliainfo):
if juliainfo.version_info < (0, 7):
pytest.skip("Julia >= 0.7 required")
# Try to remove PyCall
subprocess.call(
[juliainfo.julia, "--startup-file=no", "-e", """using Pkg; Pkg.rm("PyCall")"""]
)
# julia.install() should add PyCall:
install(julia=juliainfo.julia)
"--startup-file=no",
"-e",
"""using Pkg; Pkg.develop("PyCall")""",
]
)
# Remove ~/.julia/dev/PyCall/deps/deps.jl
depsjl = os.path.join(
os.path.expanduser("~"), ".julia", "dev", "PyCall", "deps", "deps.jl"
)
if os.path.exists(depsjl):
print("Removing", depsjl)
os.remove(depsjl)
# julia.install() should fix it:
install(julia=juliainfo.julia)
assert os.path.exists(depsjl)
def test_noop(juliainfo):
install(julia=juliainfo.julia)
import os
import sys
sys.path.insert(
0, os.path.join(os.path.dirname(os.path.realpath(__file__)), os.path.pardir, "src")
)
import julia # isort:skip
julia.install(color=True)