Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Find julia installation #100

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from all 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
26 changes: 26 additions & 0 deletions jill/install.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,32 @@
import subprocess


def _get_relative_bin_path():
system = current_system()
if system == "winnt":
return os.path.join("bin", "julia.exe")
elif system == "mac":
return os.path.join("Contents", "Resources", "julia", "bin", "julia")
elif system == "linux" or system == "freebsd":
return os.path.join("bin", "julia")
else:
raise ValueError(f"Unsupported system {system}")


def get_installed_bin_paths():
"""
Return a dict whose keys are Julia version strings and whose values are
absolute paths to the corresponding Julia exectuable. Only jill.py's
default directory for Julia installations is searched.
The version strings either equal to `latest` or have the form `major.minor`.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If my memory serves well, there can be a third case julia-dev if you install the dev version Julia via jill install 1.8.0+848d273.

"""
julias_root = default_install_dir()
if not os.path.isdir(julias_root):
return None
rel_bin_path = _get_relative_bin_path()
return {x.split("-")[1] : os.path.join(julias_root, x, rel_bin_path) for x in os.listdir(julias_root ) if x.startswith("julia")}


def is_installed(version, check_symlinks=True):
"""
check if the required version is already installed.
Expand Down