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

allow the crate to be build as rust library #1135

Merged
merged 1 commit into from
Jun 7, 2024

Conversation

ju6ge
Copy link
Contributor

@ju6ge ju6ge commented Jun 6, 2024

this enables git import of r-polars in other rust based R libraries

Cargo.toml

[package]
name = "test-import"
version = "0.1.0"
edition = "2021"

[lib]
crate-type = ["rlib", "staticlib"]

[dependencies]
r-polars = { git = "https://github.com/ju6ge/r-polars", branch = "feature/enable-rust-git-import" }
extendr-api = { git = "https://github.com/extendr/extendr", rev = "1895bfc8ee22347665900caa0e48da4f0b13232f" }

lib.rs

use r_polars::rdataframe::RPolarsDataFrame;
use extendr_api::prelude::*;

#[extendr]
/// @export
pub fn export_dataframe() -> RPolarsDataFrame {
    RPolarsDataFrame::default()
}

extendr_module! {
    mod polars_export;
    fn export_dataframe;
}

this enables git import of `r-polars` in other rust based R libraries
@etiennebacher
Copy link
Collaborator

Thanks @ju6ge, that looks good to me and the change is very simple. I don't see why this would be a problem but I'm no expert on this, so I'll let @eitsupi validate and merge if it's ok

@eitsupi eitsupi merged commit 0dbb723 into pola-rs:main Jun 7, 2024
33 of 35 checks passed
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.

3 participants