Skip to content
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

Fix lang r #295

Merged
merged 12 commits into from
Oct 7, 2021
Merged

Fix lang r #295

merged 12 commits into from
Oct 7, 2021

Conversation

lorenzwalthert
Copy link
Owner

No description provided.

@lorenzwalthert
Copy link
Owner Author

lorenzwalthert commented Oct 5, 2021

  • On CRAN, we can't install pre-commit, virtual envs etc.
  • For testing, we should use current revision.

Also installing hooks in tests seems to give error, so we should disable it:

── Error (test-conda.R:135:5): can install pre-commit with remote config ───────
Error: Error: Problems during initialization:
stderr: ERROR conda.cli.main_run:execute(33): Subprocess for 'conda run ['/Users/runner/Library/r-miniconda/envs/r-precommit/bin/pre-commit', 'install', '--install-hooks']' command failed.  (See above for error)

stdout: pre-commit installed at .git/hooks/pre-commit
[INFO] Installing environment for https://github.com/lorenzwalthert/precommit.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
An unexpected error has occurred: CalledProcessError: command: ('/Users/runner/work/precommit/precommit/check/precommit.Rcheck/R_check_bin/Rscript', '--vanilla', '-e', '            prefix_dir <- \'/Users/runner/.cache/pre-commit/repoltr75km8\'\n            options(\n                repos = c(CRAN = "https://cran.rstudio.com"),\n                renv.consent = TRUE\n            )\n            source("renv/activate.R")\n            renv::restore()\n            activate_statement <- paste0(\n              \'suppressWarnings({\',\n              \'old <- setwd("\', getwd(), \'"); \',\n              \'source("renv/activate.R"); \',\n              \'setwd(old); \',\n              \'renv::load("\', getwd(), \'");})\'\n            )\n            writeLines(activate_statement, \'activate.R\')\n            is_package <- tryCatch(\n              {\n                  path_desc <- file.path(prefix_dir, \'DESCRIPTION\')\n                  suppressWarnings(desc <- read.dcf(path_desc))\n                  "Package" %in% colnames(desc)\n              },\n              error = function(...) FALSE\n            )\n            if (is_package) {\n                renv::install(prefix_dir)\n            }\n            ')
return code: 1
expected return code: 0
stdout:
    [Errno 8] Exec format error: '/Users/runner/work/precommit/precommit/check/precommit.Rcheck/R_check_bin/Rscript'
    
stderr: (none)
Check the log at /Users/runner/.cache/pre-commit/pre-commit.log

@lorenzwalthert lorenzwalthert merged commit 072debe into master Oct 7, 2021
@lorenzwalthert lorenzwalthert deleted the fix-lang-r branch November 27, 2021 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant