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

Feature/version string #963

Merged
merged 4 commits into from Apr 26, 2019

Conversation

@eddelbuettel
Copy link
Member

commented Apr 26, 2019

A simple extension to get the "API" version of the package out.

We have always have packageVersion("Rcpp") (or the earlier packageDescription("Rcpp")$Version) but as I keep increasing the 'dev version' during development, this leaks eg 1.0.1.2 right now when used by e.g. Rcpp.package.skeleton(). Which then bites potential users who would only have CRAN's 1.0.1 or older.

So I added two new #define statements for string versions in the usual config.h, plus a simple function to export to the R side -- where we turn it into package_version objects. Nothing major, but a little help.

@kevinushey This may also help for the RStudio package generator.

eddelbuettel added some commits Apr 25, 2019

@eddelbuettel eddelbuettel requested a review from kevinushey Apr 26, 2019

@codecov-io

This comment has been minimized.

Copy link

commented Apr 26, 2019

Codecov Report

Merging #963 into master will increase coverage by 0.09%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #963      +/-   ##
==========================================
+ Coverage   82.39%   82.48%   +0.09%     
==========================================
  Files          63       63              
  Lines        3158     3163       +5     
==========================================
+ Hits         2602     2609       +7     
+ Misses        556      554       -2
Impacted Files Coverage Δ
src/rcpp_init.cpp 100% <100%> (ø) ⬆️
src/api.cpp 93.1% <100%> (+0.42%) ⬆️
R/tools.R 100% <100%> (+22.22%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7f4e64d...b35f1a8. Read the comment docs.

@kevinushey
Copy link
Contributor

left a comment

LGTM other than 2 minor nitpicks.

R/tools.R Outdated
##' \code{\link{Rcpp.package.skeleton}}
##' @examples getRcppVersion()
getRcppVersion <- function(devel = FALSE) {
rcpp <- .Call("getRcppVersionStrings")[if(devel) 2 else 1]

This comment has been minimized.

Copy link
@kevinushey

kevinushey Apr 26, 2019

Contributor

nit: use .Call("getRcppVersionStrings", PACKAGE = "Rcpp") to ensure the symbol gets looked up directly in the Rcpp library?

This comment has been minimized.

Copy link
@eddelbuettel

eddelbuettel Apr 26, 2019

Author Member

Sure. Look at all the other .Call() we do -- it is not too consistent.

R/tools.R Outdated
##' @examples getRcppVersion()
getRcppVersion <- function(devel = FALSE) {
rcpp <- .Call("getRcppVersionStrings")[if(devel) 2 else 1]
.make_numeric_version(rcpp,

This comment has been minimized.

Copy link
@kevinushey

kevinushey Apr 26, 2019

Contributor

Why not just use package_version() here?

This comment has been minimized.

Copy link
@eddelbuettel

eddelbuettel Apr 26, 2019

Author Member

Good point. I think I was looking inside that function and inadvertendly copied it, rather than calling it.

eddelbuettel added some commits Apr 26, 2019

@eddelbuettel

This comment has been minimized.

Copy link
Member Author

commented Apr 26, 2019

@kevinushey All good?

@eddelbuettel eddelbuettel merged commit 3af3036 into master Apr 26, 2019

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@eddelbuettel eddelbuettel deleted the feature/version_string branch Apr 27, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.