R/parse_neptune_version.R

Defines functions parse_neptune_version

parse_neptune_version <-
function(version) {
  # returns unquoted string directly passable to pip, e.g 'neptune-client==0.1.*'

  if(is.null(version) || is.na(version) || version %in% c("", "release"))
    return("neptune-client")

  version <- as.character(version) # if numeric_version()

  # full path to whl.
  if (grepl("^.*\\.whl$", version))
    return(normalizePath(version))

  package <- "neptune-client"

  if(version %in% c("default", ""))
    return(package)

  if(!grepl("[><=]", version))
    version <- sprintf("==%s.*", version)

  paste0(package, version)
}

Try the neptune package in your browser

Any scripts or data that you put into this service are public.

neptune documentation built on April 13, 2022, 5:14 p.m.