Skip to content

Commit

Permalink
Improve time to check project dir
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Nov 29, 2022
1 parent fb04694 commit 0ccca86
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions pysr/julia_helpers.py
Expand Up @@ -38,7 +38,11 @@ def _get_julia_project_dir():
try:
cmds = [
"julia",
"-e using Pkg; print(Pkg.project().path)",
"--compile=min",
"--startup-file=no",
"-O0",
"-g0",
"-e import Pkg: project; print(project().path)",
]
julia_project_dir_str = subprocess.run(
cmds,
Expand All @@ -56,8 +60,16 @@ def _get_julia_project_dir():
def _get_julia_env_dir():
# Have to manually get env dir:
try:
cmds = [
"julia",
"--compile=min",
"--startup-file=no",
"-O0",
"-g0",
"-e import Pkg: envdir; print(envdir())",
]
julia_env_dir_str = subprocess.run(
["julia", "-e using Pkg; print(Pkg.envdir())"],
cmds,
capture_output=True,
env=os.environ,
).stdout.decode()
Expand Down

0 comments on commit 0ccca86

Please sign in to comment.