LearnToDiscover / sandpaper

L2D's fork of {sandpaper}
https://learntodiscover.github.io/sandpaper/
Other
0 stars 1 forks source link

`sandpaper::update_cache()` should not clear contents of `requirements.txt` #68

Closed milanmlft closed 3 months ago

milanmlft commented 6 months ago

When running sandpaper::update_cache(), the contents for requirements.txt get unintentionally removed if the Python packages are not yet installed locally on the system.

Reprex

# Add a non-installed package to requirements.txt
writeLines("imnotinstalled", "requirements.txt")

req <- readLines("requirements.txt")
"imnotinstalled" %in% req
#> [1] TRUE

sandpaper::update_cache()

req <- readLines("requirements.txt")
"imnotinstalled" %in% req
#> [1] FALSE