-
-
Notifications
You must be signed in to change notification settings - Fork 8
Add dev container setup for R development environment #265
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
Conversation
- Add devcontainer.json with rocker/verse R 4.3.3 image - Configure automatic installation of essential R packages - Set up persistent R package storage via volume mount - Add setup script for system dependencies and R packages - Configure .Rprofile for optimal dev container experience - Add VS Code extensions and settings for R development - Update .gitignore to handle dev container artifacts This setup ensures R and all necessary packages persist between container rebuilds, providing a consistent development environment for the teal.code package.
averissimo
left a comment
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.
What's the need for this PR?
Is this a trial to see if it should be implemented across all packages after?
| # Try to install teal.data if available | ||
| tryCatch({ | ||
| install.packages('teal.data') | ||
| }, error = function(e) { | ||
| message('teal.data package not available from CRAN, will need to install from GitHub') | ||
| }) |
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.
why install teal.data with teal.code?
| install.packages(c( | ||
| 'devtools', | ||
| 'testthat', | ||
| 'roxygen2', | ||
| 'pkgdown', | ||
| 'remotes', | ||
| 'renv', | ||
| 'usethis', | ||
| 'dplyr', | ||
| 'random.cdisc.data', | ||
| 'nestcolor' | ||
| ), dependencies = TRUE) |
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.
Is nestcolor and random.cdisc.data really necessary?
| @@ -0,0 +1,37 @@ | |||
| # R Configuration for teal.code development | |||
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 think this enforces too many decisions on the developers and we shouldn't include .Rprofile on the repos.
This is unprecedented on the organization and tidyverse.
In pharmaverse it appears on stdm.oak, but otherwise it's not used anywhere.
| if (Sys.getenv("RSTUDIO") == "1" || file.exists("/.dockerenv")) { | ||
| # In dev container - use mounted volume for persistence | ||
| user_lib <- "/usr/local/lib/R/site-library" | ||
| } else { | ||
| # Local development - use user library | ||
| user_lib <- "~/R/library" | ||
| } |
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.
Is this compatible with Windows and Mac OSX?
|
Hey @averissimo thanks for the review, but this is only POC PR that I made through copilot development environment that I showed yesterday on Slack. Probably there are too many files here anyway. The goal is to setup .devcontainers, so that, when you open copilot development environment you would have most of the dependencies preinstalled to test the current package from this repository |
|
this was just a garbage POC PR. clsoing it |
Overview
This PR adds a comprehensive development container setup for the teal.code R package development environment.
Changes
Dev Container Configuration
R Environment Setup
VS Code Integration
Git Configuration
Benefits
Usage
Testing
The setup has been tested to ensure:
This addresses the need for a consistent development environment and should make it much easier for contributors to get started with teal.code development.