Skip to content

Commit

Permalink
New way of setting the development COMMIT into install.R
Browse files Browse the repository at this point in the history
  • Loading branch information
rikardn committed Aug 28, 2024
1 parent ad06a50 commit b51cc78
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 4 additions & 2 deletions .github/actions/check-pharmr/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 1 addition & 3 deletions R/install.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
"d94f63dc63417b6824267680ba6216c1d8e6551c"
PHARMPY_COMMIT <- .Last.value

#' @title
#' Install Pharmpy
#'
Expand Down Expand Up @@ -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') {
Expand Down

0 comments on commit b51cc78

Please sign in to comment.