-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix page_size float/int issue + auto-select and configure python libr…
…ary from @datawookie and @daattali (#13) * install domino_data python module on install and select a python interpreter on package load; thanks to @datawookie * dont run configure script on CI * try installing the correct version of the python module * Change python install to latest version of dominodatalab-data * rstudio: remove trailing whitespace and auto append new lines (#10) * Update version in DESCRIPTION (#12) * Force page_size to integer * Add optional version of domino_data to install * Remove spaces * Add stuff * Generate docs * Update DESCRIPTION * Don't use v --------- Co-authored-by: Dean Attali <[email protected]> Co-authored-by: Dean Attali <[email protected]>
- Loading branch information
1 parent
e34d765
commit a0dabb8
Showing
9 changed files
with
91 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,14 @@ | ||
Package: DominoDataR | ||
Title: Domino Data R API | ||
Version: 0.2.0 | ||
Version: 0.2.1 | ||
Authors@R: | ||
person("Gabriel", "Haim", , "[email protected]", role = c("aut", "cre")) | ||
Description: Domino Data API for interacting with Data features (Data Sources). | ||
License: Apache License (>= 2) | ||
URL: https://github.com/dominodatalab/r-domino-data | ||
Encoding: UTF-8 | ||
Roxygen: list(markdown = TRUE) | ||
RoxygenNote: 7.2.1 | ||
RoxygenNote: 7.2.3 | ||
Imports: | ||
arrow, | ||
ConfigParser, | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
py_select_interpreter <- function() { | ||
# Tell {reticulate} to use the Conda version of Python available on Domino Data Lab. | ||
# | ||
# Provide other options in case the package is being used for local development. | ||
# | ||
PYTHON_PATH <- c( | ||
"/opt/conda/bin/python", | ||
path.expand("~/.virtualenvs/r-reticulate/bin/python"), | ||
"/usr/bin/python" | ||
) | ||
# | ||
for (path in PYTHON_PATH) { | ||
if (file.exists(path)) { | ||
reticulate::use_python(path) | ||
break | ||
} | ||
} | ||
# | ||
# If no Python is present (or not in the expected place), then install MiniConda. | ||
# | ||
if (!reticulate::py_available(initialize = TRUE)) { | ||
try(reticulate::install_miniconda()) | ||
} | ||
} | ||
|
||
#' Install domino_data Python package | ||
#' @return `TRUE` if installation was successful, `FALSE` otherwise. | ||
#' @param version Version of the domino_data package to install. | ||
#' @export | ||
py_domino_data_install <- function(version) { | ||
py_select_interpreter() | ||
|
||
# Install the (Python) domino_data package. | ||
# | ||
if (!reticulate::py_module_available("domino_data")) { | ||
if (missing(version)) { | ||
package <- "dominodatalab-data" | ||
} else { | ||
package <- paste0("dominodatalab-data==", version) | ||
} | ||
result <- tryCatch({ | ||
reticulate::py_install(package, pip = TRUE, method = "virtualenv") | ||
TRUE | ||
}, error = function(e) { | ||
FALSE | ||
}) | ||
result | ||
} else { | ||
TRUE | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.onLoad <- function(libname, pkgname) { | ||
py_select_interpreter() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#!/bin/sh | ||
|
||
set -x | ||
set -e | ||
|
||
${R_HOME}/bin/Rscript inst/scripts/python-setup.R |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
if (!nzchar(Sys.getenv('CI'))) { | ||
source("R/python.R") | ||
|
||
py_domino_data_install() | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.