Skip to content

Commit 1b30c6f

Browse files
committed
fix conda
revert changes fix cng fix python version
1 parent cf48508 commit 1b30c6f

File tree

5 files changed

+14
-12
lines changed

5 files changed

+14
-12
lines changed

.github/workflows/aot.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ jobs:
1616
os:
1717
- ubuntu-latest
1818
architecture: [x64]
19-
python-version: ['3.x']
19+
python-version: ['3.9']
2020
julia-version:
2121
- '1.6'
2222
- '1'

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ VersionParsing = "81def892-9a0e-5fdd-b105-ffc91e053289"
1515

1616
[compat]
1717
Conda = "1"
18-
VersionParsing = "1"
1918
MacroTools = "0.4, 0.5"
19+
VersionParsing = "1"
2020
julia = "1.6"
2121

2222
[extras]

PyPreferences.jl/src/core.jl

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
using ..PyPreferences: PyPreferences
2-
using .PythonUtils: find_libpython, python_version_of, pythonhome_of
2+
using .PythonUtils: find_libpython, python_version_of, pythonhome_of, conda_python_fullpath
33

44
using Preferences: @set_preferences!, @load_preference, @delete_preferences!
55

@@ -23,7 +23,7 @@ function set(prefs::PythonPreferences)
2323
if prefs.python === nothing
2424
@delete_preferences!("python")
2525
else
26-
@set_preferences!("python" => get_python_fullpath(prefs.python))
26+
@set_preferences!("python" => prefs.python)
2727
end
2828
if prefs.inprocess
2929
@set_preferences!("inprocess" => prefs.inprocess)
@@ -53,13 +53,12 @@ function _load_python_preferences()
5353
#isempty(rawprefs) && return nothing
5454

5555
# default value
56-
if !_inprocess && !_conda && _python === nothing
57-
_python = get_python_fullpath(get_default_python())
58-
@info "Setting default Python interpreter to $(_python)"
59-
return set(python=_python)
60-
else
61-
return PythonPreferences(_python, _inprocess, _conda)
62-
end
56+
# if !_inprocess && !_conda && _python === nothing
57+
# _python = get_python_fullpath(get_default_python())
58+
# @info "Setting default Python interpreter to $(_python)"
59+
# return set(python=_python)
60+
# end
61+
return PythonPreferences(_python, _inprocess, _conda)
6362
end
6463

6564
function load_pypreferences_code()

PyPreferences.jl/src/python_utils.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ using Libdl: Libdl
22
using VersionParsing: vparse
33
using Conda: Conda
44

5+
conda_python_fullpath() =
6+
abspath(Conda.PYTHONDIR, "python" * (Sys.iswindows() ? ".exe" : ""))
7+
58
# Fix the environment for running `python`, and setts IO encoding to UTF-8.
69
# If cmd is the Conda python, then additionally removes all PYTHON* and
710
# CONDA* environment variables.

src/pyinit.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ function python_cmd(args::Cmd = ``;
9898
end
9999

100100
function find_libpython(python::AbstractString)
101-
script = joinpath(@__DIR__, "..", "deps", "find_libpython.py")
101+
script = joinpath(@__DIR__, "..", "PyPreferences.jl", "src", "find_libpython.py")
102102
cmd = python_cmd(`$script`; python = python)
103103
try
104104
return read(cmd, String)

0 commit comments

Comments
 (0)