`usethis::use_pkgdown_github_pages()` creates an empty `gh-pages`

Hi!

I've created a pkgdown website for my package (cbib/Seurat-Integrate). It is perfectly rendered locally in the docs/ folder with pkgdown::build_site().

However, for a reason I cannot understand, the usethis::use_pkgdown_github_pages() creates an empty gh-pages branch.

The use_pkgdown_github_pages() command runs without error:

> usethis::use_pkgdown_github_pages()
! Overwrite pre-existing file _pkgdown.yml?

1: No
2: Negative
3: Yup

Selection: 2   # the answer doesn't seem to change the fact that the branch is empty
ℹ Leaving _pkgdown.yml unchanged.
☐ Modify _pkgdown.yml.
✔ GitHub Pages is publishing from:
• URL: "https://cbib.github.io/Seurat-Integrate/"
• Branch: "gh-pages"
• Path: "/"
✔ Saving "r-lib/actions/examples/pkgdown.yaml@v2" to .github/workflows/pkgdown.yaml.
☐ Learn more at <https://github.com/r-lib/actions/blob/v2/examples/README.md>.
✔ Recording <https://cbib.github.io/Seurat-Integrate/> as site's url in _pkgdown.yml.
☐ Run devtools::document() to update package-level documentation.

Then, a github action is initialized. It runs without errors, but given the elapsed time (17s for the build job), it probably doesn't do much.
And a gh-pages branch is created but it doesn't contain any file.

I don't know what could be the source of the problem. Here are some other remarks:

  • I have decided to put _pkgdown.yml in pkgdown/ because it worked fine with pkgdown::build_site() and some other packages with a functional pkgdown website did the same (e.g. tibble from the tidyverse) Locally, I copied it to the root of the package because usethis::use_pkgdown_github_pages() doesn't seem to look for it in pkgdown/ and replaced ~ with the correct url (see below).
_pkgdown.yml
url: https://cbib.github.io/Seurat-Integrate/
template:
  bootstrap: 5
  bslib:
    font-size-root: 1rem
navbar:
  structure:
    left:
    - intro
    - reference
    - articles
    - memos
    - tutorials
    - news
    right:
    - search
    - github
    - lightswitch
  components:
    articles:
      text: Articles
      menu:
      - text: 'Integration example: pbmcsca data'
        href: articles/introduction.html
      - text: Advice about conda and future
        href: articles/setup_and_tips.html
    memos:
      icon: fa-sticky-note
      aria-label: Aide-mémoires
      menu:
      - text: Integration methods
        href: articles/memo_integration.html
      - text: Scoring metrics
        href: articles/memo_score.html
reference:
- title: Conda environment management
- subtitle: Modification interface
  desc: |
    Set, update, remove conda environments
  contents:
  - UpdateEnvCache
  - resetCache
  - saveToCache
- subtitle: Access interface
  desc: |
    Show the current state of environments or the location of cache on disk
  contents:
  - starts_with("getCache")
  - reloadCache
- subtitle: Class constructors
  contents:
  - CondaEnv
  - CondaManager
- subtitle: Checkers
  desc: |
    Check usability of conda environments
  contents:
  - isValid
  - starts_with("checkConda")
- title: Data integration
- subtitle: Main interface
  desc: |
    Integrate the layers of a Seurat object with one or more methods
  contents: DoIntegrate
- subtitle: Methods included in SeuratIntegrate
  contents: ends_with("Integration")
- subtitle: Compatible methods from other packages
  contents:
  - Seurat::RPCAIntegration()
  - Seurat::CCAIntegration()
  - SeuratWrappers::FastMNNIntegration()
- title: Scoring
- subtitle: Preprocessing
  desc: |
    Useful functions to preprocess outputs before scoring
  contents:
  - FindOptimalClusters
  - CellCycleScoringPerBatch
- subtitle: Scoring
  desc: |
    Functions to score integrations
  contents: starts_with("AddScore")
- subtitle: Postprocessing
  desc: |
    Once `AddScore[..]` functions have been run, scores are to be scaled then plotted
  contents:
  - ScaleScores
  - PlotScores
- subtitle: General getters and setters of score table
  desc: |
    Get, set, modify scores in a more flexible way
  contents:
  - IntegrationScores
  - contains("Misc")
- title: Graph-based utilities
- subtitle: Graph manipulation
  desc: |
    Handy functions to manipulate and modify graphs
  contents:
  - SymmetrizeKnn
  - CutKnn
  - ExpandNeighbours
  - GetConnectivities
- subtitle: Connectivity between batches
  desc: |
    Handy functions to overview inter- and intra-batches connections in a knn graph
  contents: matches("^GetPropInt..Batch")
- title: Utility functions for matrices
  desc: |
    Functions designed for smaller-scale, auxiliary tasks on matrices.
- subtitle: Matrix normalisation
  contents: NormaliseL2
- subtitle: Matrix sorting
  contents:
  - colSort
  - rowSort
  - colSorted
  - rowSorted
- subtitle: Sparse matrix symmetry
  contents: matches("^symmetrize.pm...sparse")
- subtitle: Matrix sorting
  contents:
  - colSort
  - rowSort
  - colSorted
  - rowSorted
- subtitle: Conversion of matrix indices
  contents:
  - idx2col
  - idx2row
  - rowcol2idx
  • I don't want pkgdown to use the README as the index, so I created a index.md in pkgdown/
  • I had docs/ in .gitignore. I removed it locally and it didn't change anything. It is still in the GitHub repo however
  • In the GitHub repository, I have checked Settings > Pages, and it seems to be properly set
  • In the GitHub repository, I have set Settings > Actions > General > Workflow permissions to Read and write permissions just in case.
  • I have a .git/hooks/ folder with only .sample files
  • My .github/workflows/pkgdown.yaml is identical to the default one.

Any help to make my usethis::use_pkgdown_github_pages() workflow functional would be greatly appreciated.

Thanks!

You forgot to add this file to your repository?

Hi!

Yes, that fixed the issue thank you very much!

However, I didn't manage to publish the website with usethis::use_pkgdown_github_pages(), I used pkgdown::deploy_to_branch() instead.

I added the missing Remotes field in the DESCRIPTION file. But the step r-lib/actions/setup-r-dependencies@v2 failed: the package SeuratData fails to build on the GHA because the package vctrs is missing.

Is there a way to circumvent this problem? Since the vctrs package is part of my Imports, one way to fix this might be to force SeuratData to install after vctrs but I don't know how to do that.

GHA output: setup r dependencies
Run r-lib/actions/setup-r-dependencies@v2
Run # Set site library path
Set site library path
Run # Install pak
Install pak
Run # Dependency resolution
Dependency resolution
Show Lockfile
Run actions/cache@v4
Cache not found for input keys: Ubuntu 24.04.1 LTS-R version 4.4.2 (2024-10-31)-1-db335b1cb95eb988127eb6c87aec25cbc1933f4e2cae893b3dd9d1fe053f20ef, Ubuntu 24.04.1 LTS-R version 4.4.2 (2024-10-31)-1-
Run # Install/Update packages
Install/update packages
  ℹ Installing lockfile '.github/pkg.lock'
   
  → Will install 222 packages.
  → Will download 222 packages with unknown size.
  + abind                  1.4-8      [dl]
  + annotate               1.84.0     [bld][dl]
  + AnnotationDbi          1.68.0     [bld][dl]
  + askpass                1.2.1      [dl]
  + assorthead             1.0.1      [bld][dl]
  + backports              1.5.0      [dl]
  + base64enc              0.1-3      [dl]
  + batchelor              1.22.0     [bld][cmp][dl]
  + beachmat               2.22.0     [bld][cmp][dl]
  + BH                     1.87.0-1   [dl]
  + Biobase                2.66.0     [bld][cmp][dl]
  + BiocGenerics           0.52.0     [bld][dl]
  + BiocNeighbors          2.0.1      [bld][cmp][dl]
  + BiocParallel           1.40.0     [bld][cmp][dl]
  + BiocSingular           1.22.0     [bld][cmp][dl]
  + Biostrings             2.74.1     [bld][cmp][dl]
  + bit                    4.5.0.1    [dl]
  + bit64                  4.5.2      [dl]
  + bitops                 1.0-9      [dl]
  + blob                   1.2.4      [dl]
  + brio                   1.1.5      [dl]
  + broom                  1.0.7      [dl]
  + bslib                  0.8.0      [dl]
  + cachem                 1.1.0      [dl]
  + callr                  3.7.6      [dl]
  + caTools                1.18.3     [dl]
  + cli                    3.6.3      [dl]
  + colorspace             2.1-1      [dl]
  + commonmark             1.9.2      [dl]
  + cowplot                1.1.3      [dl]
  + cpp11                  0.5.1      [dl]
  + crayon                 1.5.3      [dl]
  + crosstalk              1.2.1      [dl]
  + curl                   6.1.0      [dl] + libcurl4-openssl-dev, libssl-dev
  + data.table             1.16.4     [dl]
  + DBI                    1.2.3      [dl]
  + DelayedArray           0.32.0     [bld][cmp][dl]
  + DelayedMatrixStats     1.28.1     [bld][dl]
  + deldir                 2.0-4      [dl]
  + desc                   1.4.3      [dl]
  + digest                 0.6.37     [dl]
  + distances              0.1.11     [dl]
  + dotCall64              1.2        [dl]
  + downlit                0.4.4      [dl]
  + dplyr                  1.1.4      [dl]
  + edgeR                  4.4.1      [bld][cmp][dl]
  ✔ Installed Rtsne 0.17  (1s)
  ✔ Installed sass 0.4.9  (1s)
  ✔ Installed scales 1.3.0  (1s)
  ✔ Installed scattermore 1.2  (1s)
  ✔ Installed sctransform 0.4.1  (1s)
  ✔ Installed Seurat 5.2.0  (1s)
  ✔ Installed SeuratObject 5.0.2  (1s)
  ✔ Installed shiny 1.10.0  (1.1s)
  ✔ Installed snow 0.4-4  (1s)
  ℹ Building BiocParallel 1.40.0
  ✔ Built BiocParallel 1.40.0 (9.5s)
  ✔ Installed sourcetools 0.1.7-1  (1s)
  ✔ Installed sp 2.1-4  (1s)
  ✔ Installed spam 2.11-0  (1s)
  ℹ Packaging SeuratData 0.2.2.9001
  ✔ Packaged SeuratData 0.2.2.9001 (529ms)
  ℹ Building SeuratData 0.2.2.9001
  ✖ Failed to build SeuratData 0.2.2.9001 (2.6s)
  Error: 
  ! error in pak subprocess
  Caused by error in `stop_task_build(state, worker)`:
  ! Failed to build source package SeuratData.
  Full installation output:
  * installing *source* package ‘SeuratData’ ...
  staged installation is only possible with locking
  ** using non-staged installation
  ** R
  ** exec
  ** inst
  ** byte-compile and prepare package for lazy loading
  Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
    there is no package called ‘vctrs’
  Calls: <Anonymous> ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
  Execution halted
  ERROR: lazy loading failed for package ‘SeuratData’
  * removing ‘/tmp/RtmpLBMwfs/pkg-lib15173b31e057/SeuratData’
  ---
  Backtrace:
  1. pak::lockfile_install(".github/pkg.lock")
  2. pak:::remote(function(...) { …
  3. err$throw(res$error)
  ---
  Subprocess backtrace:
   1. base::withCallingHandlers(cli_message = function(msg) { …
   2. get("lockfile_install_internal", asNamespace("pak"))(...)
   3. plan$install()
   4. pkgdepends::install_package_plan(plan, lib = private$library, num_workers = nw, …
   5. base::withCallingHandlers({ …
   6. pkgdepends:::handle_events(state, events)
   7. pkgdepends:::handle_event(state, i)
   8. pkgdepends:::stop_task(state, worker)
   9. pkgdepends:::stop_task_build(state, worker)
  10. base::throw(pkg_error("Failed to build source package {.pkg {pkg}}.", …
  11. | base::signalCondition(cond)
  12. global (function (e) …
  Execution halted
  Error: Process completed with exit code 1.

PS: If I should post another Topic for that or open an issue somewhere please let me know.

Seems like SeuratData needs vctrs, but you failed to declare it as a dependency:

❯ pak::pkg_deps_tree("satijalab/seurat-data")
satijalab/seurat-data 0.2.2.9001 ✨👷‍♂️🔧
├─cli 3.6.3 ✨ ⬇ (1.39 MB)
├─crayon 1.5.3 ✨ ⬇ (164.41 kB)
├─rappdirs 0.3.3 ✨ ⬇ (47.90 kB)
└─SeuratObject 5.0.2 ✨ ⬇ (2.53 MB)
  ├─future 1.34.0 ✨ ⬇ (666.98 kB)
  │ ├─digest 0.6.37 ✨ ⬇ (356.05 kB)
  │ ├─globals 0.16.3 ✨ ⬇ (108.48 kB)
  │ │ └─codetools 0.2-20
  │ ├─listenv 0.9.1 ✨ ⬇ (106.97 kB)
  │ └─parallelly 1.41.0 ✨ ⬇ (515.56 kB)
  ├─future.apply 1.11.3 ✨ ⬇ (154.46 kB)
  │ ├─future
  │ └─globals
  ├─generics 0.1.3 ✨ ⬇ (81.91 kB)
  ├─lifecycle 1.0.4 ✨ ⬇ (124.78 kB)
  │ ├─cli
  │ ├─glue 1.8.0 ✨ ⬇ (173.70 kB)
  │ └─rlang 1.1.4 ✨ ⬇ (1.90 MB)
  ├─Matrix 1.7-1
  │ └─lattice 0.22-6
  ├─progressr 0.15.1 ✨ ⬇ (393.33 kB)
  │ └─digest
  ├─Rcpp 1.0.14 ✨ ⬇ (3.36 MB)
  ├─rlang
  ├─sp 2.1-4 ✨ ⬇ (2.12 MB)
  │ └─lattice
  └─spam 2.11-0 ✨ ⬇ (3.10 MB)
    ├─dotCall64 1.2 ✨ ⬇ (44.95 kB)
    └─Rcpp

It is not my package, is there anything I can do ?

Report a bug to them. The installation of the package fails on a fresh R system. I think it would be enough for them to depend on Seurat.

Until it is fixed, you can add another step to your workflow, that installs Seurat manually, either via setup-r-dependencies, or just by calling pak::pkg_install("Seurat").

Hi,

Alright, thank you very much for you precious advice. I'll report a bug to them then.