Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should use_news_md() add a development header if it is a dev version? #1708

Closed
maelle opened this issue Dec 5, 2022 · 6 comments · Fixed by #1830
Closed

Should use_news_md() add a development header if it is a dev version? #1708

maelle opened this issue Dec 5, 2022 · 6 comments · Fixed by #1830
Labels
docs 💡 documentation, news, vignettes, website, etc feature a feature request or enhancement
Milestone

Comments

@maelle
Copy link
Contributor

maelle commented Dec 5, 2022

Currently, if using use_news_md() to create a NEWS file for a package with a development version, one gets the header "package-name package-version". I wonder whether that header should actually be "package-name (development version)"

withr::local_options(usethis.quiet = TRUE)
temp_dir <- withr::local_tempdir()
dir.create(file.path(temp_dir, "package"))
usethis::create_package(file.path(temp_dir, "package"))

withr::with_dir(file.path(temp_dir, "package"), {
  usethis::use_news_md()
  readLines("NEWS.md")
})
#> [1] "# package 0.0.0.9000"                                     
#> [2] ""                                                         
#> [3] "* Added a `NEWS.md` file to track changes to the package."

Created on 2022-12-05 with reprex v2.0.2

I'd expect the header to be "# package (development version)".

@malcolmbarrett
Copy link
Collaborator

I think we already do this; does it have to do with the ordering of when you use use_news_md() vs use_dev_version()?

@maelle
Copy link
Contributor Author

maelle commented Dec 5, 2022

This is a brand-new package so its dev version comes from the defaults/Rprofile defaults. I agree that for later development, things already work like you say.

@maelle
Copy link
Contributor Author

maelle commented Dec 5, 2022

So to clarify, my issue is only for brand-new packages with a dev version number. 🙂

@malcolmbarrett
Copy link
Collaborator

malcolmbarrett commented Dec 5, 2022

I've gotten away from putting it in until after my first release (based on the order of use_release_issue()), so it hasn't been a problem for me.

That said, it might make sense for the default template to assume it's a dev version upon adding it

@hadley hadley added feature a feature request or enhancement docs 💡 documentation, news, vignettes, website, etc labels Jan 17, 2023
@hadley
Copy link
Member

hadley commented Jan 20, 2023

I think it might be slightly better for to call use_news_md() earlier in the release process (i.e. before initial submission) and if the current version is 0.0.1, the bullet should be "Initial submission".

@DavisVaughan
Copy link
Member

We now have a bullet to call use_news_md() very early in the use_release_issue() process for both a new package release and an existing package release (if we detect there is not currently a NEWS file).

We now need to make a change where use_news_md() should insert (development version) rather than the actual version if proj_version() looks like a development version. This way use_version() can detect it and update it accordingly.

For a new package, that means it should end up looking like:

  • use_news_md() is called and inserts # pkg (development version)
  • use_version("minor") is called before release and updates that to # pkg 0.1.0

The only weird situation I can imagine here is if you don't have a NEWS file and your package version is currently sitting at something like 0.2.0, which looks like a "production" version. In this case, I imagine we should just put # pkg 0.2.0 when creating the NEWS file, which is the current behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs 💡 documentation, news, vignettes, website, etc feature a feature request or enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants