Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Changelog

## Unreleased

* Add configuration via Preferences in addition to environment variables (e.g. `exe`
rather than `JULIA_PYTHONCALL_EXE`.)

Expand Down
2 changes: 0 additions & 2 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ Dates = "ade2ca70-3891-5945-98fb-dc099432e06a"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
Markdown = "d6f4376e-aef5-505a-96c1-9c027394607a"
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
Preferences = "21216c6a-2e73-6563-6e65-726566657250"
Serialization = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
Tables = "bd369af6-aec1-5ad0-b16a-f7cc5008161c"
Expand All @@ -22,7 +21,6 @@ Dates = "1"
Libdl = "1"
MacroTools = "0.5"
Markdown = "1"
Pkg = "1"
Preferences = "1"
PyCall = "1"
Serialization = "1"
Expand Down
4 changes: 1 addition & 3 deletions pysrc/juliacall/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ def int_option(name, *, accept_auto=False, **kw):
raise ValueError(f'{s}: expecting an int'+(' or auto' if accept_auto else ""))

def args_from_config(config):
argv = [config['exepath']]
argv = [config['exepath'], '--project='+config['project']]
for opt, val in config.items():
if opt.startswith('opt_'):
if val is None:
Expand Down Expand Up @@ -264,10 +264,8 @@ def jlstr(x):
script = '''
try
Base.require(Main, :CompilerSupportLibraries_jll)
import Pkg
global __PythonCall_libptr = Ptr{{Cvoid}}(UInt({}))
ENV["JULIA_PYTHONCALL_EXE"] = {}
Pkg.activate({}, io=devnull)
using PythonCall
catch err
print(stderr, "ERROR: ")
Expand Down
8 changes: 6 additions & 2 deletions src/C/C.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,14 @@ using ..Utils

using Base: @kwdef
using UnsafePointers: UnsafePtr
using CondaPkg: CondaPkg
using Pkg: Pkg
using Libdl:
dlpath, dlopen, dlopen_e, dlclose, dlsym, dlsym_e, RTLD_LAZY, RTLD_DEEPBIND, RTLD_GLOBAL
using Preferences: @load_preference

# do not load CondaPkg if the exe preference is set to something else
if @load_preference("exe", "") in ("", "@CondaPkg")
Comment thread
cjdoris marked this conversation as resolved.
Outdated
using CondaPkg: CondaPkg
end

import ..PythonCall:
python_executable_path, python_library_path, python_library_handle, python_version
Expand Down
2 changes: 0 additions & 2 deletions src/JlWrap/JlWrap.jl
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ import ..PythonCall:
PyObjectMatrix,
PyObjectArray

using Pkg: Pkg
using Base: @propagate_inbounds, allocatedinline

import ..Core: Py
Expand Down Expand Up @@ -70,7 +69,6 @@ function __init__()
jl.Core = Base.Core
jl.Base = Base
jl.Main = Main
jl.Pkg = Pkg
jl.PythonCall = PythonCall
end

Expand Down
Loading