ThinkR-open / attachment

Tools to deal with dependencies in scripts, Rmd and packages
https://thinkr-open.github.io/attachment/
Other
108 stars 13 forks source link

att_amend_desc() removes bioc:: in Remotes #100

Closed abichat closed 2 months ago

abichat commented 1 year ago

When I run attachment::att_amend_desc() , it now removes the lines corresponding to Bioconductor packages in the Remotes field.

Before running it:

Remotes:
    bioc::frma,
    bioc::gcrma,
    bioc::genefilter,
    bioc::limma,
    github::mycompany/internalpkg

After running it:

Remotes:
    github::mycompany/internalpkg

Although this as no effect on GitHub Actions ({pak} correctly deals with bioconductor packages), this is not the case for remotes::install_github("mycompany/internalpkg"):

ERROR: dependencies ‘gcrma’, ‘limma’, ‘vsn’ are not available for package ‘internalpkg’

This is a new behavior from attachment. I made a reprex package here to see what works and what doesn't when dealing with Bioconductor packages.

Thanks!

abichat commented 1 year ago

Description for Bioconductor package

> dput(packageDescription("limma"))
structure(list(Package = "limma", Version = "3.56.2", Date = "2023-06-03", 
    Title = "Linear Models for Microarray Data", Description = "Data analysis, linear models and differential expression for microarray data.", 
    Author = "Gordon Smyth [cre,aut], Yifang Hu [ctb], Matthew Ritchie [ctb], Jeremy Silver [ctb], James Wettenhall [ctb], Davis McCarthy [ctb], Di Wu [ctb], Wei Shi [ctb], Belinda Phipson [ctb], Aaron Lun [ctb], Natalie Thorne [ctb], Alicia Oshlack [ctb], Carolyn de Graaf [ctb], Yunshun Chen [ctb], Mette Langaas [ctb], Egil Ferkingstad [ctb], Marcus Davy [ctb], Francois Pepin [ctb], Dongseok Choi [ctb]", 
    Maintainer = "Gordon Smyth <smyth@wehi.edu.au>", License = "GPL (>=2)", 
    Depends = "R (>= 3.6.0)", Imports = "grDevices, graphics, stats, utils, methods", 
    Suggests = "affy, AnnotationDbi, BiasedUrn, Biobase, ellipse, GO.db,\ngplots, illuminaio, locfit, MASS, org.Hs.eg.db, splines,\nstatmod (>= 1.2.2), vsn", 
    URL = "https://bioinf.wehi.edu.au/limma/", biocViews = "ExonArray, GeneExpression, Transcription,\nAlternativeSplicing, DifferentialExpression,\nDifferentialSplicing, GeneSetEnrichment, DataImport, Bayesian,\nClustering, Regression, TimeCourse, Microarray, MicroRNAArray,\nmRNAMicroarray, OneChannel, ProprietaryPlatforms, TwoChannel,\nSequencing, RNASeq, BatchEffect, MultipleComparison,\nNormalization, Preprocessing, QualityControl,\nBiomedicalInformatics, CellBiology, Cheminformatics,\nEpigenetics, FunctionalGenomics, Genetics, ImmunoOncology,\nMetabolomics, Proteomics, SystemsBiology, Transcriptomics", 
    RemoteType = "bioc_git2r", RemoteMirror = "https://git.bioconductor.org/packages", 
    RemoteRepo = "limma", RemoteRelease = "release", RemoteSha = "e19b8e7bde4ff62cdbbe5041fc67cfe00f53cce0", 
    RemoteBranch = "RELEASE_3_17", NeedsCompilation = "yes", 
    Packaged = "2023-07-17 12:01:48 UTC; YYY", Built = "R 4.2.1; x86_64-pc-linux-gnu; 2023-07-17 12:01:50 UTC; unix"), class = "packageDescription", file = "/XXX/R/IMG_R_4.1/4.2.1/limma/Meta/package.rds")

Description for GitHub package

> dput(packageDescription("internalpkg"))
structure(list(Package = "internalpkg", Title = "Utility functions", 
    Version = "0.1.3", `Authors@R` = "c(\n    person(\"Antoine\", \"BICHAT\", , , role = c(\"aut\", \"cre\"),\n           comment = c(ORCID = \"0000-0001-6599-7081\")),\n    person(\"BBC Team\", role = c(\"cph\", \"ctb\")),\n    person(\"mycompany\", role = c(\"cph\", \"fnd\"))\n  )", 
    Description = "Provides helper and miscellaneous functions.", 
    License = "file LICENSE", URL = "https://github.com/mycompany/internalpkg,\nhttps://crispy-invention-2c4bc08a.pages.github.io", 
    BugReports = "https://github.com/mycompany/internalpkg/issues", 
    Imports = "dplyr, glue, knitr, magrittr, rlang, stats, stringr, tibble,\ntidyr, tidyselect, utils", 
    Suggests = "testthat (>= 3.0.0)", `Config/testthat/edition` = "3", 
    Encoding = "UTF-8", Roxygen = "list(markdown = TRUE)", RoxygenNote = "7.2.3", 
    RemoteType = "github", RemoteHost = "api.github.com", RemoteRepo = "internalpkg", 
    RemoteUsername = "mycompany", RemoteRef = "HEAD", RemoteSha = "273e583c2169b6ce563dc5d57609d5ebab6732e9", 
    GithubRepo = "internalpkg", GithubUsername = "mycompany", 
    GithubRef = "HEAD", GithubSHA1 = "273e583c2169b6ce563dc5d57609d5ebab6732e9", 
    NeedsCompilation = "no", Packaged = "2023-08-18 13:38:59 UTC; XXX", 
    Author = "Antoine BICHAT [aut, cre] (<https://orcid.org/0000-0001-6599-7081>),\n  BBC Team [cph, ctb],\n  mycompany [cph, fnd]", 
    Maintainer = "Antoine BICHAT", 
    Built = "R 4.2.1; ; 2023-08-18 13:39:00 UTC; unix"), class = "packageDescription", file = "/home/XXX/R/IMG_R_4.1/4.2.1/internalpkg/Meta/package.rds")

Description for local package

> dput(packageDescription("internalpkg"))
structure(list(Package = "internalpkg", Title = "Useful Datasets", 
    Version = "0.0.3.9000", `Authors@R` = "c(\n    person(\"Antoine\", \"BICHAT\", , , role = c(\"aut\", \"cre\"),\n           comment = c(ORCID = \"0000-0001-6599-7081\")),\n    person(\"BBC Team\", role = c(\"cph\", \"ctb\")),\n    person(\"mycompany\", role = c(\"cph\", \"fnd\"))\n  )", 
    Description = "Provide useful data for demonstrating and testing BBC\n    packages.", 
    License = "file LICENSE", URL = "https://github.com/mycompany/internalpkg,\nhttps://reimagined-potato-df4b2725.pages.github.io", 
    BugReports = "https://github.com/mycompany/internalpkg/issues", 
    Depends = "R (>= 3.5.0)", Imports = "affy, Biobase, limma, tibble, utils", 
    Suggests = "testthat (>= 3.0.0)", `Config/testthat/edition` = "3", 
    Encoding = "UTF-8", LazyData = "false", Roxygen = "list(markdown = TRUE)", 
    RoxygenNote = "7.2.3", NeedsCompilation = "no", Packaged = "2023-03-14 10:43:05 UTC; XXX", 
    Author = "Antoine BICHAT [aut, cre] (<https://orcid.org/0000-0001-6599-7081>),\n  BBC Team [cph, ctb],\n  mycompany [cph, fnd]", 
    Maintainer = "Antoine BICHAT", 
    Built = "R 4.2.1; ; 2023-03-14 10:43:16 UTC; unix"), class = "packageDescription", file = "/home/XXX/R/IMG_R_4.1/4.2.1/internalpkg/Meta/package.rds")
MurielleDelmotte commented 2 months ago

Hello @abichat

I'm dusting off the issues a bit 🧹

With attachment version 0.4.2 available, I can't reproduce the problem on your reprex. Is it still there? Thanks

abichat commented 2 months ago

Thanks for checking it. It works for me now, even with 0.4.1 :)