Skip to content

Commit 293c8e7

Browse files
committed
Dont specify conda_binary
1 parent 6081fd3 commit 293c8e7

File tree

6 files changed

+36
-26
lines changed

6 files changed

+36
-26
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: rworkflows
22
Type: Package
33
Title: Test, Document, Containerise, and Deploy R Packages
4-
Version: 0.99.15
4+
Version: 1.0.0
55
Authors@R:
66
c(person(given = "Brian",
77
family = "Schilder",

NEWS.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,10 @@
1+
# rworkflows 1.0.0
2+
3+
## New features
4+
5+
* Synchronise `rworkflows` package versioning with `rworkflows` action
6+
Release versioning.
7+
18
# rworkflows 0.99.15
29

310
## New features

R/conda_export.R

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#' will be generated.
1212
#' @param preview Print the requirements file to the R console.
1313
#' @param verbose Print messages.
14+
#' @inheritParams reticulate::conda_export
1415
#' @source https://stackoverflow.com/a/55687210
1516
#' @returns Path to requirements file.
1617
#'
@@ -19,22 +20,22 @@
1920
#' \dontrun{
2021
#' conda_export()
2122
#' }
22-
conda_export <- function(name,
23+
conda_export <- function(name,
2324
save_path=tempfile(fileext = "_requirements.txt"),
2425
preview=FALSE,
25-
verbose=TRUE){
26+
verbose=TRUE,
27+
...){
2628
requireNamespace("reticulate")
2729

2830
force(name)
29-
#### Find conda executable ####
30-
conda <- conda_path()
3131
#### Get packages ####
3232
dir.create(dirname(save_path),recursive = TRUE,showWarnings = FALSE)
3333
if(grepl("requirements\\.txt$",save_path)){
34-
system(paste(conda,"list -n testenv --export >",save_path))
34+
system(paste("conda","list -n testenv --export >",save_path))
3535
} else if (grepl("\\.yml$|\\.yaml$",save_path)){
3636
reticulate::conda_export(envname = name,
37-
file = save_path)
37+
file = save_path,
38+
...)
3839
}
3940
#### Read ####
4041
txt <- readLines(save_path)

R/conda_path.R

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
conda_path <- function(){
2-
## Use sys var
3-
conda <- Sys.getenv("CONDA")
4-
if(conda!=""){
5-
options(reticulate.conda_binary = conda)
6-
return(conda)
7-
}
8-
## Use reticulate
9-
conda <- reticulate::conda_binary()
10-
if(file.exists(conda)){
11-
return(conda)
12-
} else {
13-
stop("Unable to find conda binary. Please set reticulate.conda_binary")
14-
}
15-
}
1+
# conda_path <- function(){
2+
# ## Use sys var
3+
# conda <- Sys.getenv("CONDA")
4+
# if(conda!=""){
5+
# options(reticulate.conda_binary = conda)
6+
# return(conda)
7+
# }
8+
# ## Use reticulate
9+
# conda <- reticulate::conda_binary()
10+
# if(file.exists(conda)){
11+
# return(conda)
12+
# } else {
13+
# stop("Unable to find conda binary. Please set reticulate.conda_binary")
14+
# }
15+
# }

man/conda_export.Rd

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-construct_conda_yml.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ test_that("construct_conda_yml works", {
4646
save_path = save_path)
4747
testthat::expect_true(file.exists(path2))
4848

49-
conda <- conda_path()
50-
out <- reticulate::conda_create(conda = conda,
51-
environment = path2,
49+
# conda <- conda_path()
50+
out <- reticulate::conda_create(environment = path2,
5251
envname = envname)
5352
testthat::expect_true(file.exists(out))
5453
testthat::expect_equal(basename(out),"python")

0 commit comments

Comments
 (0)