Skip to content

Add use_version() and use_github_action(), bump to 0.2.0#3

Merged
TroyHernandez merged 6 commits intomainfrom
create-package
Apr 7, 2026
Merged

Add use_version() and use_github_action(), bump to 0.2.0#3
TroyHernandez merged 6 commits intomainfrom
create-package

Conversation

@TroyHernandez
Copy link
Copy Markdown
Contributor

@TroyHernandez TroyHernandez commented Apr 7, 2026

Summary

Lands use_version() and use_github_action() for tinypkgr 0.2.0, in prep for first CRAN submission. Originally also added create_package(), but pkgKitten already does that well — dropped in favor of pointing users at pkgKitten::kitten().

Commits

  1. Reformat R/dev.R and R/release.R via rformat — pure cosmetic pass, separated for review.
  2. Add create_package() and bump to 0.2.0 — superseded by commit 5; kept for history.
  3. Add use_version() to bump DESCRIPTION + NEWS.mdpatch/minor/major/dev bumps. Updates DESCRIPTION and prepends a matching NEWS.md section header so the two never drift apart.
  4. Add use_github_action() to write r-ci workflow — writes .github/workflows/ci.yaml from the canonical eddelbuettel/github-actions/r-ci@master template (Ubuntu + macOS).
  5. Drop create_package() and switch dev versioning — removes create_package() (defer to pkgKitten). Switches bump_version("dev") from the .9000 convention (a usethis idiom, not in base R) to incrementing a 4th digit starting at 1: 0.2.00.2.0.10.2.0.2. Tests rewritten to inline minimal scaffolds instead of depending on create_package().

Why

  • use_version() and use_github_action() aren't there for human ergonomics — they're guard rails for LLM-driven edits. Claude can get DESCRIPTION's DCF format wrong or half-remember the r-ci YAML; deterministic helpers prevent a class of automated mistakes.
  • create_package() removed because pkgKitten exists, is mature, and is the canonical tinyverse-flavored scaffold. tinypkgr stays focused on the dev/release/use_* helpers that complement it.
  • The .9000 convention is a Wickham-ism, not anything in base R or R-recommended. Switched to a simple incrementing 4th digit.

Test plan

  • tinytest::test_package("tinypkgr") — 32 tests across test_dev, test_use_version, test_use_github_action, all pass
  • tinypkgr::check() — 0 errors, 0 warnings, 1 NOTE (the pre-existing attach() in load_all())

New create_package() scaffolds a tinyverse-flavored R package:
DESCRIPTION with Authors@R (optional ORCID), NAMESPACE, .Rbuildignore,
NEWS.md, tests/tinytest.R entry point, and an optional starter hello()
function with matching tinytest test. Pure base R, no new Imports.
- Remove create_package() in favor of pkgKitten::kitten().
- Fix bump_version("dev"): increment a 4th digit starting at 1 instead
  of using the .9000 convention.
- Rewrite test_use_version and test_use_github_action to use inline
  minimal package scaffolds.
@TroyHernandez TroyHernandez changed the title Add create_package() and bump to 0.2.0 Add use_version() and use_github_action(), bump to 0.2.0 Apr 7, 2026
Copy link
Copy Markdown
Collaborator

@eddelbuettel eddelbuettel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I suspect CRAN may still yell about 'attach()'. Any way to make it work via search in a (maybe given?) namespace?

PS You could add a Suggests: on pkgKitten. Merely suggested packages do not increate the count 😉

load_all() now returns the populated environment and takes an optional
env arg so callers can supply their own target. It no longer calls
attach(), so tinypkgr's source is free of search-path side effects and
R CMD check --as-cran is clean (0/0/0 aside from the new-submission
NOTE).

Users who want the previous auto-attach behavior can do it themselves:

  attach(tinypkgr::load_all(), name = "tinypkgr:mypkg")
@TroyHernandez TroyHernandez merged commit 887de46 into main Apr 7, 2026
4 checks passed
@TroyHernandez TroyHernandez deleted the create-package branch April 7, 2026 19: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.

2 participants