diff --git a/.Rbuildignore b/.Rbuildignore new file mode 100644 index 0000000..91fb891 --- /dev/null +++ b/.Rbuildignore @@ -0,0 +1,6 @@ +^.*\.Rproj$ +^\.Rproj\.user$ +^_pkgdown\.yml$ +^docs$ +^pkgdown$ +^\.github$ diff --git a/.github/.gitignore b/.github/.gitignore new file mode 100644 index 0000000..2d19fc7 --- /dev/null +++ b/.github/.gitignore @@ -0,0 +1 @@ +*.html diff --git a/.github/workflows/pkgdown.yaml b/.github/workflows/pkgdown.yaml new file mode 100644 index 0000000..4bbce75 --- /dev/null +++ b/.github/workflows/pkgdown.yaml @@ -0,0 +1,50 @@ +# Workflow derived from https://github.com/r-lib/actions/tree/v2/examples +# Need help debugging build failures? Start at https://github.com/r-lib/actions#where-to-find-help +on: + push: + branches: [main, master] + pull_request: + branches: [main, master] + release: + types: [published] + workflow_dispatch: + +name: pkgdown.yaml + +permissions: read-all + +jobs: + pkgdown: + runs-on: ubuntu-latest + # Only restrict concurrency for non-PR jobs + concurrency: + group: pkgdown-${{ github.event_name != 'pull_request' || github.run_id }} + env: + GITHUB_PAT: ${{ secrets.GITHUB_TOKEN }} + permissions: + contents: write + steps: + - uses: actions/checkout@v4 + + - uses: r-lib/actions/setup-pandoc@v2 + + - uses: r-lib/actions/setup-r@v2 + with: + use-public-rspm: true + + - uses: r-lib/actions/setup-r-dependencies@v2 + with: + extra-packages: any::pkgdown, local::. + needs: website + + - name: Build site + run: pkgdown::build_site_github_pages(new_process = FALSE, install = FALSE) + shell: Rscript {0} + + - name: Deploy to GitHub pages 🚀 + if: github.event_name != 'pull_request' + uses: JamesIves/github-pages-deploy-action@v4.5.0 + with: + clean: false + branch: gh-pages + folder: docs diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..234f028 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.Rproj.user +.Rhistory +.RData +.Ruserdata +docs diff --git a/DESCRIPTION b/DESCRIPTION index f6137d2..b177161 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: jobqueue Type: Package Title: Queue and Run Asynchronous Interruptible R Tasks on Background Processes Version: 0.1.0.9000 -Date: 2024-08-29 +Date: 2024-10-04 Authors@R: c( person( "Daniel P.", "Smith", @@ -16,12 +16,15 @@ Description: Takes an R expression and returns a Job object with a '$stop' method which can be called to terminate the background job. Also provides timeouts and other mechanisms for terminating a background job before it is finished. -URL: https://cmmr.github.io/qrun/index.html -BugReports: https://github.com/cmmr/qrun/issues -License: AGPL-3 +URL: https://cmmr.github.io/jobqueue/ +BugReports: https://github.com/cmmr/jobqueue/issues +License: MIT + file LICENSE Encoding: UTF-8 -LazyData: true -StagedInstall: no +Roxygen: list(markdown = TRUE) +RoxygenNote: 7.3.1 +Config/Needs/website: rmarkdown +Config/testthat/edition: 3 +Config/testthat/parallel: true Depends: R (>= 4.2.0) Imports: @@ -36,5 +39,3 @@ Imports: rlang Suggests: testthat -RoxygenNote: 7.2.3 -Config/Needs/website: rmarkdown diff --git a/R/queue.r b/R/queue.r index 14c357e..8074814 100644 --- a/R/queue.r +++ b/R/queue.r @@ -42,6 +42,18 @@ #' returning whatever result the earlier Job returns. `copy_id` can also #' be a `function (job)` that returns the `copy_id` to assign to a given #' Job. A `copy_id` of `NULL` disables this feature. +#' +#' @param scan Should additional variables be added to `vars` based on +#' scanning `expr` for missing global variables? By default, +#' `scan = is.null(vars)`, meaning if you set `vars = list()` then no +#' scan is done. Set `scan = TRUE` to always scan, `scan = FALSE` to +#' never scan, and `scan = ` to look for +#' globals there. When scanning, the worker's environment is taken into +#' account, and globals on the worker are favored over globals locally. +#' `vars` defined by the user are always left untouched. +#' +#' @param ignore A character vector of variable names that should NOT be added +#' to `vars` by `scan`. #' #' @export #' diff --git a/_pkgdown.yml b/_pkgdown.yml new file mode 100644 index 0000000..834abde --- /dev/null +++ b/_pkgdown.yml @@ -0,0 +1,9 @@ +url: https://cmmr.github.io/jobqueue/ + +template: + bootstrap: 5 + bootswatch: darkly + theme: breeze-dark + bslib: + code-bg: "#2b2b2b" + diff --git a/jobqueue.Rproj b/jobqueue.Rproj new file mode 100644 index 0000000..5e5ae1e --- /dev/null +++ b/jobqueue.Rproj @@ -0,0 +1,19 @@ +Version: 1.0 + +RestoreWorkspace: Default +SaveWorkspace: Default +AlwaysSaveHistory: Default + +EnableCodeIndexing: Yes +UseSpacesForTab: Yes +NumSpacesForTab: 2 +Encoding: UTF-8 + +RnwWeave: Sweave +LaTeX: pdfLaTeX + +AutoAppendNewline: Yes + +BuildType: Package +PackageUseDevtools: Yes +PackageInstallArgs: --no-multiarch --with-keep.source