Skip to content

Commit 2d07eac

Browse files
committed
move conda install to import and on test
delete build
1 parent 7652ec2 commit 2d07eac

File tree

3 files changed

+39
-17
lines changed

3 files changed

+39
-17
lines changed

deps/build.jl

Lines changed: 0 additions & 16 deletions
This file was deleted.

src/ReactionMechanismSimulator.jl

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module ReactionMechanismSimulator
22
using PythonCall
33
using CondaPkg
4-
packages = keys(CondaPkg.current_packages())
4+
using Logging
55
const Chem = PythonCall.pynew()
66
const Desc = PythonCall.pynew()
77
const molecule = PythonCall.pynew()
@@ -16,6 +16,25 @@ const chebyshev = PythonCall.pynew()
1616
const solvation = PythonCall.pynew()
1717
const fragment = PythonCall.pynew()
1818
const pydot = PythonCall.pynew()
19+
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")
32+
33+
Pkgc = Base.require(Base.PkgId(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "Pkg"))
34+
Pkgc.build("PythonCall")
35+
end
36+
37+
1938
function __init__()
2039
PythonCall.pycopy!(Chem, pyimport("rdkit.Chem"))
2140
PythonCall.pycopy!(Desc, pyimport("rdkit.Chem.Descriptors"))

src/rmstest.jl

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,29 @@ import Logging
22
Logging.disable_logging(Logging.Warn)
33

44
using PythonCall
5+
using CondaPkg
56
const Chem = PythonCall.pynew()
67
const molecule = PythonCall.pynew()
78
const fragment = PythonCall.pynew()
89
const pydot = PythonCall.pynew()
10+
11+
packages = keys(CondaPkg.current_packages())
12+
13+
if !("rmg" in packages) && !("rmgmolecule" in packages)
14+
@info "missing rmg and rmgmolecule installing rmgmolecule..."
15+
if !(v"3.7" <= PythonCall.C.python_version() && PythonCall.C.python_version() <= v"3.9")
16+
@info "python version was not in 3.7-3.9 changing python version"
17+
CondaPkg.add("python"; version="3.9")
18+
end
19+
CondaPkg.add("rmgmolecule"; version=">=0.3.0", channel="mjohnson541")
20+
CondaPkg.add("matplotlib", channel="conda-forge")
21+
CondaPkg.add("rdkit", channel="conda-forge")
22+
CondaPkg.add("pydot", channel="conda-forge")
23+
24+
Pkgc = Base.require(Base.PkgId(Base.UUID("44cfe95a-1eb2-52ea-b672-e2afdf69b78f"), "Pkg"))
25+
Pkgc.build("PythonCall")
26+
end
27+
928
PythonCall.pycopy!(Chem, pyimport("rdkit.Chem"))
1029
try
1130
PythonCall.pycopy!(molecule, pyimport("rmgpy.molecule"))

0 commit comments

Comments
 (0)