attachment 1.1.1
Bug fixes
-
att_from_rscript()(and thereforeatt_amend_desc()) no longer reports a variable name as a package name.requireNamespace(),loadNamespace()and thensargument ofgetFromNamespace()take a character string, so a bare symbol there can only be a variable holding the name, never the name itself; the same goes forlibrary()andrequire()when the call passescharacter.only = TRUE. A guard such asfor (pkg in c("callr", "jsonlite")) requireNamespace(pkg, quietly = TRUE)used to add a package literally calledpkgtoDESCRIPTION, which then stopped everyrenv/pakinstall on a package that cannot exist. A symbol is still read as the package name forlibrary(),require()anduse(), which compute on the unevaluated argument (#143). - Named arguments of a dependency-introducing call are now matched the way R matches them, by exact name first and then by a prefix unambiguous among the formals, instead of by string equality. An abbreviated but perfectly legal spelling of the flag,
library(pkgvar, char = TRUE), went unrecognised and added a package named after the variable; and an abbreviated package argument,library(pack = "jsonlite"), was missed altogether. The formals are read from the running R rather than written down here, and a formal placed after...is matched by its exact name only, which is R’s own rule (#143). -
att_amend_desc()no longer lets anEnhancesversion constraint override theImportsone for the same package. The rule that picks a version when a package is pinned under two types ordered the type as text, and"Enhances"sorts before"Imports", soEnhances: pkg (>= 9.9.9)replacedImports: pkg (>= 2.0.0)and wrote a bound nobody had set for that type, which can make a package uninstallable. The precedence is now named explicitly, strongest first: Imports, Depends, LinkingTo, Suggests, Enhances. -
att_amend_desc()no longer counts a removal twice, nor names the package twice, when DESCRIPTION lists it under two dependency types. The list read by the comparison holds one row per (type, package) pair, so a package pinned under bothImportsandSuggestsproduced[-] 2 package(s) removed: pkgA, pkgAfor a single removal.
New features
-
att_amend_desc()now says when a removed package took a version constraint with it. The[-] N package(s) removedline names the package but not the constraint, so a deliberatepkgA (>= 1.2.0)used to leave inside a list of ordinary removals and go unnoticed until the built image lacked the bound. A[!]diagnostic now lists those packages with their constraint and points atdir.rfor sources the default scan does not reach (#139).
Maintenance
- The test suite reads lockfiles with
renv::lockfile_read()instead of reaching into renv withgetFromNamespace("lockfile", "renv"), which stopped working when renv 1.2.4 changed that internal.renvmoves fromSuggests: renv (>= 0.8.4)torenv (>= 1.0.0), the version that introduced the public lockfile functions.
attachment 1.1.0
CRAN release: 2026-08-20
New features
-
att_amend_desc()now accepts several directories indir.r, for exampleatt_amend_desc(dir.r = c("R", "inst")). This lets you declare dependencies used only outside the standard package directories, such as a deployment entry point underinst/, which the default scan does not reach. Passing a vector previously raisedthe condition has length > 1(#139).
Bug fixes
-
att_amend_desc()no longer drops a version constraint set by hand in DESCRIPTION when the same package is listed under two types (a pinnedImportsand a bareSuggests, for instance). Previously the version that survived depended on the order of the rows in DESCRIPTION; the hand-set constraint is now kept, and when both anImportsand aSuggestsrow carry a version theImportsone wins (#140). -
att_from_examples()(and thereforeatt_amend_desc()) no longer chokes on inline R inside roxygen2 markdown tags such as@param x \r helper(“x”)`whenhelper()is a package-local function. Previously,att_from_examples()delegated toroxygen2::parse_file(), which evaluated inline R againstbaseenv()(roxygen2's fallback when no package env is registered) — base R is reachable, but package-local helpers are not, so each affected tag emittedcould not find function “helper”`. Example detection now uses a focused regex over the source instead of the full roxygen2 tokenizer (#135).
attachment 1.0.0
CRAN release: 2026-04-25
Detection — new foundation
-
att_from_rscript()now walks the R syntax tree instead of matching the source text with regexes. Dependency detection no longer produces false positives on::inside string literals or comments (e.g. xpathfollowing-sibling::td, CSSlabel::after,sprintf('%s::plot()', ...)) (#120, #132). - The AST walker safely handles “empty” call arguments (
x[, 1],x[1, ], emptyswitchalternatives, missingelsebranches). Earlier development drafts of the walker crashed withargument "el" is missing, with no defaulton any script containing these patterns, which would have silently degraded every real-world script to the legacy regex fallback.
Detection — new patterns recognised
-
att_from_rscript()also recognisesuse("pkg", ...)(R >= 4.4) (#128),getFromNamespace("fn", "pkg"),loadNamespace(), and named-argument forms such aslibrary(package = "pkg")orrequireNamespace("pkg", lib.loc = "..."). - Fully-qualified dependency-introducing calls such as
base::library(pkg),base::requireNamespace("pkg"), andmethods::getFromNamespace(fn, "pkg")are now honoured; the inner package is added to the dependency list. - Introspection helpers (
packageVersion(),getNamespace(),asNamespace(),attachNamespace()) are intentionally not treated as dependency introducers to avoid silently wideningImportson code that only uses them for feature detection.
Detection — robustness
-
att_from_rscript()gains anencodingargument (defaultgetOption("encoding")) so scripts saved in Latin-1 / Windows-1252 are read with the system locale instead of being forced to UTF-8. -
att_from_rscript()now warns when a file fails to parse as valid R code and the legacy regex-based detector is used as a fallback, so broken scripts are no longer silently degraded. - The legacy regex-based fallback detector now accepts underscores in package names (e.g.
my_pkg::fn). Previously an underscore truncated the detected name to the portion after the underscore, so a single syntax error upstream could corrupt detection across the whole file.
Vignettes & Rmd / Quarto
-
att_from_rmds()infers the vignette engine from the files actually present:quartois added when.qmdfiles are found,rmarkdownwhen.Rmdfiles are found, both when the directory mixes the two. Previouslyrmarkdownwas forced in for.qmd-only projects (#131). -
att_from_rmd()/att_from_rmds():inside_rmdnow defaults toNULLand is auto-detected viaknitr::opts_knit$get("out.format"), so users no longer have to think about it (#106).
Maintenance
- Dropped the fusen development workflow;
R/amend_with_config.R,R/create_dependencies_file.R,R/dependencies_file_text.Rand their tests are now hand-maintained. - Fixed
create_renv_for_dev()by removing'renv'fromfolder_to_include. - Added a manual detection edge-case harness at
dev/manual_detection_edge_cases.Rcovering ~170 scripted cases (true positives, false positives, known limitations) to make future regressions of the detector obvious.
attachment 0.4.5
CRAN release: 2025-03-14
Bug fixes
-
att_from_examples()Removed escape characters (\) from Roxygen examples.
attachment 0.4.4
CRAN release: 2025-02-08
Patch
-
att_from_examples()Fixed the selection of.Rfiles in the source directory. (#124)
attachment 0.4.3
CRAN release: 2025-01-31
New features
- Add
att_from_examples()to get all packages called in examples from R files - Add
att_from_data()to look for functions called in data loading code -
att_amend_descamend package DESCRIPTION file (Suggests) with the list of dependencies extracted from examples in R files. -
set_remotes_to_desc()takes into account the branch
Patch
- Adding an example using suggest packages to the dummypackage
-
att_from_rmds()andatt_from_rscriptdoesn’t search in ‘renv’ folder anymore
attachment 0.4.1
CRAN release: 2024-01-22
Bug fixes
- Modification of unit tests following {roxygen2} changes.
att_amend_descandatt_from_namespacereturn messages instead of warnings. (@MurielleDelmotte)
attachment 0.4.0
CRAN release: 2023-05-31
Breaking changes
When using
att_amend_desc()without the default parameters, likepkg_ignore = "x"will now requireatt_amend_desc(pkg_ignore = "x", update.config = TRUE), otherwise, it will fail. This allows for the use of parameters stored in the config file when runningatt_amend_desc()directly in the console. Recommendation: Runatt_amend_desc(pkg_ignore = "x", update.config = TRUE)if you have to update your config, runatt_amend_desc()daily as you’ll want to use what is stored in the config file.create_dependencies_file()gets parameterinstall_only_if_missing = FALSEby default to complete the installation instructions packages only if missing. (@MurielleDelmotte)
New features
-
att_amend_desc()can run with the last set of parameters stored in a configuration file, without having to call them all each time. See vignettes and documentation of parametersupdate.config = FALSE,use.config = FALSEandpath.c = "dev/config_attachment.yaml". (@dagousket) -
create_dependencies_file()now takes other sources into account (git, gitlab, github, bioc, local). (@MurielleDelmotte) - Use
create_dependencies_file(to = NULL)to only get the output as character and do not create a file
Bug fixes
-
att_amend_desc()does not modify useroptions("warn")level anymore (#94) -
att_amend_desc()allows “Remotes” field to contain@ref(#67)
attachment 0.3.1
CRAN release: 2023-01-27
New features
-
find_remotes()now informs when using “r-universe” repositories.
Minor changes
- a new parameters
check_if_suggests_is_installedinatt_amend_desc()allow not to check if suggested package is installed. (thanks to @yogat3ch) -
create_renv_for_prod()don’t look anymore for suggested packages - Clean a maximum of temp directories after examples and unit tests
attachment 0.3.0
CRAN release: 2022-09-19
New features
-
find_remotes()andset_remotes_to_desc()now detects github, gitlab, git, bitbucket, local installations to add to the “Remotes:” part of the DESCRIPTION file (@MurielleDelmotte) - Quarto documents can be parsed with
att_from_qmds()as an alias ofatt_from_rmds().
Bug fixes
- Allow to use dependencies after
att_amend_desc()#52 - Fix HTML5 issues with update to {roxygen2}
attachment 0.2.5
CRAN release: 2022-05-15
Major changes
- add
create_renv_for_dev()andcreate_renv_for_prod()function to createrenv.lockfile based on development project (@VincentGuyader and @statnmap). - Quarto documents can be parsed with
att_from_rmds(). - Documentation for bookdown and quarto dependencies extraction updated
Minor changes
-
att_amend_desc()now saves file before processing - Newline escape code
\nwill not interfere with package discovery
attachment 0.2.4
CRAN release: 2021-11-16
Breaking changes
- (broken in 0.2.3) -
att_to_desc_from_is()can now run withmust.exist = FALSEto be used to fill DESCRIPTION file during bookdown CI process. CI YAML files must be updated with this parameter.
attachment 0.2.3
CRAN release: 2021-11-10
Major changes
- Allow to add Remotes field to DESCRIPTION with
set_remotes_to_desc()
Minor changes
- Check for packages names misspelled before filling DESCRIPTION.
- Allow vector of R files in
att_from_rscripts() - Move default git branch from master to main
Bug fixes
- Add NAMESPACE if missing with
att_amend_desc(document = TRUE) - Add DESCRIPTION with empty skeleton if missing with
att_amend_desc() - Default to remove NAMESPACE before updating to get rid of corrupted ones in
att_from_namespace() - Fix detection of multiple render outputs in Rmd YAML with
att_from_rmd()
attachment 0.2.0
CRAN release: 2021-01-19
Breaking changes * att_to_description() deprecated in favor of att_amend_desc() to be first in autocompletion list, as this is the most used function of this package. * att_from_rmd() gets parameter inline = TRUE by default to explore calls for packages in inline R code. * att_from_rmd() and att_from_rmds() are not anymore executed in separate R session by default. You must set inside_rmd = TRUE to do so.
Minor * Add find_remotes() to help fill Remotes field in DESCRIPTION * att_to_desc_from_is() add parameter normalize to avoid problem with {desc}. (See https://github.com/r-lib/desc/issues/80)
attachment 0.1.0
CRAN release: 2020-03-15
-
att_amend_desc()is an alias foratt_to_description() -
att_desc_from_is()amends DESCRIPTION file from imports/suggests vector of packages -
att_to_desc_from_pkg()is an alias foratt_to_description() - Removed dependency to {devtools}, replace by {roxygen}
-
att_to_description()shows packages added/removed from DESCRIPTION -
att_to_description()deals with dependencies in tests/ directory -
att_from_rmds()allows user defined regex to detect Rmd files
attachment 0.0.9
CRAN release: 2019-05-05
-
att_from_rmdadds a temporary encoding parameter asknitr::purlwill only deal with UTF-8 in the future. Parameter not added inatt_from_rmds. -
att_to_descriptionif {covr} is needed, should be added in parameterextra.suggests -
att_to_descriptionhas a parameter ‘dir.t’ to extract suggests dependencies from test directory Available by default
attachment 0.0.8
-
att_to_descriptionallows for ‘LinkingTo’ field in DESCRIPTION with a message -
att_from_rmdnow reads yaml header -
att_from_rmdusepurlto extract R code in an other R session usingsystem("Rscript -e ''") -
att_from_rmd: addwarnoption to allow hide messages frompurl()
attachment 0.0.7
-
att_to_descriptionaccept parameterpathfor package not being the current project -
att_to_descriptionno error if NAMESPACE is empty -
create_dependencies_filefilters base packages that cannot be installed
attachment 0.0.5
-
att_to_descriptiondeals with Remote dependencies -
att_to_descriptiondeals with Depends dependencies -
att_to_descriptionkeeps versions of packages previously added -
att_to_descriptionremoves option for automatic pkg version -
create_dependencies_filedeals with github Remotes -
att_from_rmdsnow accept a vector of Rmd filenames
attachment 0.0.3
-
att_to_description(add_version = TRUE)adds version of package in DESCRIPTION -
att_to_description(pkg_ignore)adds possibility to ignore some packages
attachment 0.0.2
- New function
install_from_descriptionto install all missing packages listed in the description file - Add an hex by @statnmap !
- Allow for absence of vignette folder in
att_to_description - Add
create_dependencies_fileto create a file listing all packages dependencies to dinstall before your package - Allow for
pkg::funcalls in R scripts withatt_from_functions - Add option to run
devtools::document()beforeatt_from_description
