Skip to content

Commit

Permalink
Fixes message and parents
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed May 14, 2024
1 parent 8a942a3 commit 3e98c3f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 10 deletions.
4 changes: 3 additions & 1 deletion komodoenv/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,9 @@ def main(args=None):
texts = {
"beta": blue(
"Komodoenv is still in beta. Be aware that issues might occur and "
"recreating environments once in a while is necessary.\n\n"
"recreating environments once in a while is necessary.\n"
"If you encounter issues with the Jupyter environment, try "
"running 'komodoenv-update' or sourcing komodoenv again.\n\n"
"For progress on stabilising komodoenv, see: "
"https://github.com/equinor/komodoenv/milestone/1\n"
),
Expand Down
14 changes: 5 additions & 9 deletions komodoenv/update.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,9 +171,7 @@ def distro_versions():


def read_config() -> dict:
with open(
Path(__file__).parent / ".." / ".." / "komodoenv.conf", encoding="utf-8"
) as f:
with open(Path(__file__).parents[2] / "komodoenv.conf", encoding="utf-8") as f:
lines = f.readlines()
config = {}
for line in lines:
Expand Down Expand Up @@ -230,7 +228,7 @@ def copy_jupyter_dirs(config: dict) -> None:
srcpath = Path(config["komodo-root"]) / config["current-release"] / "root"
if not srcpath.is_dir():
srcpath = Path(str(srcpath) + rhel_version_suffix()) / "root"
dstpath = (Path(__file__).parent / "..").resolve()
dstpath = Path(__file__).resolve().parents[1]
notebook_version = get_pkg_version(config, srcpath, "notebook")
if not (notebook_version and int(notebook_version[0]) >= 7):
return
Expand Down Expand Up @@ -295,9 +293,7 @@ def can_update(config: dict) -> bool:


def write_config(config: dict):
with open(
Path(__file__).parent / ".." / ".." / "komodoenv.conf", "w", encoding="utf-8"
) as f:
with open(Path(__file__).parents[2] / "komodoenv.conf", "w", encoding="utf-8") as f:
for key, val in config.items():
f.write(f"{key} = {val}\n")

Expand Down Expand Up @@ -342,7 +338,7 @@ def update_enable_script(komodo_prefix: Path, komodoenv_prefix: Path):

def rewrite_executable(path: Path, python: str, text: bytes):
path = path.resolve()
root = (path / ".." / "..").resolve()
root = path.parents[1]
libs = os.pathsep.join([str(root / "lib"), str(root / "lib64")])

newline_pos = text.find(b"\n")
Expand Down Expand Up @@ -466,7 +462,7 @@ def main(args: List[str] = None):
if not (srcpath / "root").is_dir():
srcpath = Path(str(srcpath) + rhel_version_suffix())

dstpath = (Path(__file__).parent / ".." / "..").resolve()
dstpath = Path(__file__).resolve().parents[2] # komodoenv/root/bin/update.py
update_bins(srcpath, dstpath)
update_enable_script(srcpath, dstpath)
create_pth(config, srcpath, dstpath)
Expand Down

0 comments on commit 3e98c3f

Please sign in to comment.