diff --git a/.github/actions/check-pharmr/action.yml b/.github/actions/check-pharmr/action.yml index 3f1e7f6..ace60ba 100644 --- a/.github/actions/check-pharmr/action.yml +++ b/.github/actions/check-pharmr/action.yml @@ -44,10 +44,12 @@ runs: commit = subprocess.getoutput("git -C ../pharmpy_repo rev-parse HEAD") with open("R/install.R", "r") as fp: lines = fp.readlines() - lines[0] = f'"{commit}"\n' with open("R/install.R", "w") as fp: for line in lines: - fp.write(line) + if line.lstrip().startswith("PHARMPY_COMMIT"): + fp.write(f' PHARMPY_COMMIT <- "{commit}"\n)' + else: + fp.write(line) shell: python - name: Build source package diff --git a/R/install.R b/R/install.R index 63f8797..6ab605f 100644 --- a/R/install.R +++ b/R/install.R @@ -1,6 +1,3 @@ -"d94f63dc63417b6824267680ba6216c1d8e6551c" -PHARMPY_COMMIT <- .Last.value - #' @title #' Install Pharmpy #' @@ -31,6 +28,7 @@ install_pharmpy_devel <- function(envname='r-reticulate', method='auto', version if (version == 'latest') { pharmpy_to_install <- 'pharmpy-core' } else if (version == 'devel') { + PHARMPY_COMMIT <- "d94f63dc63417b6824267680ba6216c1d8e6551c" pharmpy_to_install <- paste0('git+https://github.com/pharmpy/pharmpy.git@', PHARMPY_COMMIT) } else { if (version == 'same') {