Skip to content

Commit

Permalink
use R and package version range instead
Browse files Browse the repository at this point in the history
  • Loading branch information
danlu1 committed Jul 31, 2024
1 parent b966bf9 commit 9027d02
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ Description: Provides R language bindings for Synapse RESTful web services.
Encoding: UTF-8
License: Apache License 2.0
Imports:
reticulate(>= 1.25),
reticulate(<= 1.28),
methods,
rjson,
stats,
utils
Depends:
R(>= 4.1.3)
R(>= 4.1.3),
R(<= 4.4.1)
Remotes:
[email protected]
Suggests: pack, R6, testthat, knitr, rmarkdown
Expand Down
10 changes: 6 additions & 4 deletions R/zzz.R
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
PYTHON_CLIENT_VERSION <- '4.4.0'
# reticulate::virtualenv_create('r-reticulate')
# reticulate::use_virtualenv('r-reticulate')
reticulate::py_install(c("requests<3", "pandas==2.0.3", "pysftp", "jinja2", "markupsafe","numpy==1.24.4"))
reticulate::py_install(c("pandas<=2.0.3", "jinja2", "markupsafe","numpy<=1.24.4"))
reticulate::py_install(c(paste("synapseclient==", PYTHON_CLIENT_VERSION, sep="")), pip=T)
reticulate::py_run_string("import synapseclient")
}
Expand All @@ -24,7 +24,7 @@
reticulate::py_run_string(sprintf("synapserVersion = 'synapser/%s' ", utils::packageVersion("synapser")))
reticulate::py_run_string("synapseclient.USER_AGENT['User-Agent'] = synapserVersion + ' '+ synapseclient.USER_AGENT['User-Agent']")
reticulate::py_run_string("synapseclient.core.config.single_threaded = True")
reticulate::py_run_string("syn=synapseclient.Synapse(skip_checks=True, debug=True)")
reticulate::py_run_string("syn=synapseclient.Synapse(skip_checks=True, debug=False)")
# make syn available in the global environment
syn <<- reticulate::py_eval("syn")

Expand Down Expand Up @@ -75,7 +75,9 @@
functionPrefix = "syn")
}


# TODO: This section is removed since it causes the infinite recursion
# issue when reading downloaded entity to a dataframe. Revisit this
# when deprecating PythonEmbedInR code
# .objectDefinitionHelper <- function(object) {
# if (methods::is(object, "CsvFileTable")) {
# # reading from csv
Expand Down Expand Up @@ -137,7 +139,7 @@
synBuildTable(name, parent, file)
}
)
#setGeneric("as.data.frame.cust", function(x) standardGeneric("as.data.frame.cust"))

methods::setClass("CsvFileTable")
methods::setMethod(
f = "as.data.frame",
Expand Down
2 changes: 1 addition & 1 deletion tools/installPythonClient.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@ print("*** Using Python Configuration:")
reticulate::py_config()
reticulate::py_run_string("import sys")
reticulate::py_run_string(sprintf("sys.path.append(\"%s\")", file.path(baseDir, "inst", "python")))
reticulate::py_install(c("requests<3", "pandas==2.0.3", "pysftp", "jinja2", "markupsafe","numpy==1.24.4"))
reticulate::py_install(c("pandas<=2.0.3", "jinja2", "markupsafe","numpy<=1.24.4"))
reticulate::py_install(c(paste("synapseclient==", PYTHON_CLIENT_VERSION, sep="")), pip=T)

0 comments on commit 9027d02

Please sign in to comment.