Open jmcphers opened 3 years ago
@mmarchetti do you have any thoughts on what we need to do here?
In environment.py
, we could capture the index_url
and extra_index_url
configuration into the requirements.txt file with Python code analogous to:
URL=$(python -m pip config get global.index_url) && echo "--index-url $URL" >> requirements.txt
URL=$(python -m pip config get global.extra_index_url) && echo "--extra-index-url $URL" >> requirements.txt
@mmarchetti would you mind doing a PR to that end?
Notes from our Python team meeting:
@mmarchetti BTW deployApp()
currently has forceGeneratePythonEnvironment = FALSE
; if you set it to TRUE
it will overwrite an existing requirements.txt
.
If Python content uses a specific PyPI repository in order to get access to packages not available in default repositories, it is unlikely to work when published since that repository is not recorded in the manifest generated by rsconnect. You must instead manually ensure that the PyPI repository used by RStudio Connect has the packages your Python content requires.
This is about to become a much more prevalent issue now that RStudio Package Manager allows you to create snapshots, which get their own repository URLs.
https://solo.rstudiopm.com/client/#/repos/32/overview
https://docs.rstudio.com/rspm/admin/python/
Recording these PyPI repository URLs when publishing content is essential to making it possible to use them to install Python package dependencies when the content runs on RStudio Connect.