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

Add use_dev_extendr option #251

Merged

Conversation

Ilia-Kosenkov
Copy link
Member

@Ilia-Kosenkov Ilia-Kosenkov commented Mar 7, 2023

Add new flag use_dev_extendr to rust_source() function. If extendr_deps is NULL (i.e. not specified by the user), populates extendr_deps from options, using rextendr.extendr_deps if use_dev_extendr is not TRUE, otherwise, uses rextendr.extendr_dev_deps.

In turn, rextnedr.extendr_dev_deps by default is set to list(`extendr-api` = list(git = "https://github.com/extendr/extendr")).

This allows testing short code snippets against dev extendr with just one extra arg, e.g.

rust_function("fn new_awesome_features_test() {}", use_dev_extendr = TRUE)

or, while either is not available on crates.io,

rust_function(
  "fn uses_either() -> either::Either<Rint, Rfloat> { either::Either::Left(Rint::default()) }",
  use_dev_extendr = TRUE, 
  features = "either",
  dependencies = list(either = "*")
)

Closes #250

@Ilia-Kosenkov Ilia-Kosenkov marked this pull request as ready for review March 7, 2023 19:31
Copy link
Member

@CGMossa CGMossa left a comment

Choose a reason for hiding this comment

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

LGTM

@Ilia-Kosenkov Ilia-Kosenkov merged commit 0a0b764 into extendr:main Mar 7, 2023
@Ilia-Kosenkov Ilia-Kosenkov deleted the 250-Add-use_dev_extendr-option branch September 24, 2023 16:53
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.

Allow easy access to development version of extendr from rust_source() methods
2 participants