Skip to content

Commit 8642a59

Browse files
committed
move conda installs into __init__
1 parent aeba457 commit 8642a59

File tree

1 file changed

+15
-16
lines changed

1 file changed

+15
-16
lines changed

src/ReactionMechanismSimulator.jl

Lines changed: 15 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,25 +17,24 @@ const solvation = PythonCall.pynew()
1717
const fragment = PythonCall.pynew()
1818
const pydot = PythonCall.pynew()
1919

20-
packages = keys(CondaPkg.current_packages())
21-
22-
if !("rmg" in packages) && !("rmgmolecule" in packages)
23-
@info "missing rmg and rmgmolecule installing rmgmolecule..."
24-
if !(v"3.7" <= PythonCall.C.python_version() && PythonCall.C.python_version() <= v"3.9")
25-
@info "python version was not in 3.7-3.9 changing python version"
26-
CondaPkg.add("python"; version="3.9")
27-
end
28-
CondaPkg.add("rmgmolecule"; version=">=0.3.0", channel="mjohnson541")
29-
CondaPkg.add("matplotlib", channel="conda-forge")
30-
CondaPkg.add("rdkit", channel="conda-forge")
31-
CondaPkg.add("pydot", channel="conda-forge")
20+
function __init__()
21+
packages = keys(CondaPkg.current_packages())
3222

33-
Pkgc = Base.require(Base.PkgId(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "Pkg"))
34-
Pkgc.build("PythonCall")
35-
end
23+
if !("rmg" in packages) && !("rmgmolecule" in packages)
24+
@info "missing rmg and rmgmolecule installing rmgmolecule..."
25+
if !(v"3.7" <= PythonCall.C.python_version() && PythonCall.C.python_version() <= v"3.9")
26+
@info "python version was not in 3.7-3.9 changing python version"
27+
CondaPkg.add("python"; version="3.9")
28+
end
29+
CondaPkg.add("rmgmolecule"; version=">=0.3.0", channel="mjohnson541")
30+
CondaPkg.add("matplotlib", channel="conda-forge")
31+
CondaPkg.add("rdkit", channel="conda-forge")
32+
CondaPkg.add("pydot", channel="conda-forge")
3633

34+
Pkgc = Base.require(Base.PkgId(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "Pkg"))
35+
Pkgc.build("PythonCall")
36+
end
3737

38-
function __init__()
3938
PythonCall.pycopy!(Chem, pyimport("rdkit.Chem"))
4039
PythonCall.pycopy!(Desc, pyimport("rdkit.Chem.Descriptors"))
4140
try

0 commit comments

Comments
 (0)