New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add reticulate support for conda #409
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some nitpicks.
Also, to sanity check -- are the Python script changes compatible with both Python 2 and Python 3? Do we still need to support both for rsconnect
?
R/bundle.R
Outdated
|
||
tryCatch({ | ||
output <- system2(command = python, args = args, stdout = TRUE, stderr = NULL, wait = TRUE) | ||
if(require('reticulate') && reticulate::py_config()$anaconda && !compatibilityMode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if(require('reticulate') && reticulate::py_config()$anaconda && !compatibilityMode) { | |
if (requireNamespace('reticulate', quietly = TRUE) && reticulate::py_config()$anaconda && !compatibilityMode) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might also want to check reticulate::py_available(initialize = FALSE)
as otherwise calling reticulate::py_config()
will force reticulate
to initialize Python.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm using 'reticulate' %in% installed.packages()
to avoid including reticulate in the namespace where it doesn't belong.
Co-Authored-By: Kevin Ushey <kevin@rstudio.com>
Co-Authored-By: Kevin Ushey <kevin@rstudio.com>
Co-Authored-By: Kevin Ushey <kevin@rstudio.com>
Co-Authored-By: Kevin Ushey <kevin@rstudio.com>
Co-Authored-By: Kevin Ushey <kevin@rstudio.com>
Added two new args to
deployApp
(and therefore everydeploy
function that usesdeployApp
and passes args) andwriteManifest
:forceGeneratePythonEnvironment
: write a python environment file even if it existsforceRequirementsTxtEnvironment
: write arequirements.txt
file even if we're in a conda environmentUpdated
environment.py
to the latest version from https://github.com/rstudio/rsconnect-python/blob/2b8c5fe249e254e4b0dfdfa21301241375fbe49b/rsconnect/environment.pyReview Notes
environment.py
doesn't need to be reviewed a second timepaste0
isn't used because it's not supported under our minimum version of R. (is there a tool we can use to give us these hints?)