Skip to content

Commit

Permalink
Merge pull request #7 from andyquinterom/T6
Browse files Browse the repository at this point in the history
Changes @param name in `as.list` method
  • Loading branch information
andres-ixpantia authored Nov 20, 2023
2 parents 687f32c + 6938d44 commit e4a3586
Show file tree
Hide file tree
Showing 18 changed files with 384 additions and 21 deletions.
23 changes: 21 additions & 2 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,25 @@
^src/\.cargo$
^.*\.Rproj$
^\.Rproj\.user$
^LICENSE\.md$
^README\.Rmd$
^README\.md$
^man/figures/.*$
^\.github$
^fonts$

^src/.cargo$
^src/rust/.cargo$
^src/rust/.vscode$
^src/rust/vendor$

^_pkgdown\.yml$
^docs$
^pkgdown$
^LICENSE\.md$

^cran-comments\.md$
^CRAN-SUBMISSION$
^CRAN-RELEASE$

^check$

^update_authors\.R$
50 changes: 50 additions & 0 deletions .github/workflows/check-full.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
on:
push:
branches: [main]
pull_request:
branches: [main]

name: R-CMD-check

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}

name: "${{ matrix.config.os }} (R: ${{ matrix.config.r }}, Rust: ${{ matrix.config.rust }})"

strategy:
fail-fast: false
matrix:
config:
- {os: windows-latest, r: 'release', rust: 'stable-msvc'}
- {os: windows-latest, r: 'devel', rust: 'stable-msvc'}
- {os: macOS-latest, r: 'release', rust: 'stable' }
- {os: ubuntu-latest, r: 'release', rust: 'stable' }
- {os: ubuntu-latest, r: 'devel', rust: 'stable' }
- {os: ubuntu-latest, r: 'release', rust: 'nightly' }

steps:
- uses: actions/checkout@v4

- name: Set up Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.config.rust }}

- uses: r-lib/actions/setup-r@v2
with:
r-version: ${{ matrix.config.r }}
rtools-version: ${{ matrix.config.rtools-version }}
use-public-rspm: true

- uses: r-lib/actions/setup-pandoc@v2

- uses: r-lib/actions/setup-r-dependencies@v2
with:
extra-packages: any::rcmdcheck
needs: check

- uses: r-lib/actions/check-r-package@v2

- name: debug
run: cat ./check/*.Rcheck/00install.out
7 changes: 7 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,10 @@ po/*~
# RStudio Connect folder
rsconnect/
docs

# Rust Cargo files
src/.cargo
src/rust/.cargo
src/rust/vendor/

docs
8 changes: 7 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,16 @@ Package: orbweaver
Title: Fast and Efficient Graph Data Structures
Version: 0.1.0.9000
Authors@R:
person("Andres", "Quintero", , "andres@ixpantia.com", role = c("aut", "cre"))
c(person("Andres", "Quintero", , "andres@ixpantia.com", role = c("aut", "cre")),
person(given = "The authors of the dependency Rust crates",
role = c("ctb"),
comment = "see inst/AUTHORS file for details"))
Description: Orbweaver is an R packages that optimizes the processing of graph data structures.
URL: https://github.com/ixpantia/orbweaver
BugReports: https://github.com/ixpantia/orbweaver/issues
License: MIT + file LICENSE
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.2.3
Config/rextendr/version: 0.3.1
SystemRequirements: Cargo (Rust's package manager), rustc
91 changes: 91 additions & 0 deletions LICENSE.note
Original file line number Diff line number Diff line change
@@ -0,0 +1,91 @@
This package contains the Rust source code of the dependencies in src/rust/vendor.tar.xz
The authorships and the licenses are listed below. In summary, all libraries are
distributed either under the MIT license or under MIT/Apache-2.0 dual license [1].

Note that, when Cargo (Rust’s build system and package manager) is not installed
on the machine, the pre-compiled binary will be downloaded on building this
package. The binary is compiled using the same Rust code, so the authorships and
the licenses are the same as listed here.

[1]: The unicode-indent library shows 'Unicode-DFS-2016' license because it
contains some test data generated by using the Unicode Character Database.
So, this license is not applied to the actual sources that get compiled.
Please refer to the License section of the library's README
(https://crates.io/crates/unicode-ident) for the details.

===============================

Name: either
Files: vendor/either/*
Authors: bluss
License: MIT OR Apache-2.0

------------------------------

Name: extendr-api
Files: vendor/extendr-api/*
Authors: andy-thomason, Thomas Down, Mossa Merhi Reimert, Claus O. Wilke, Hiroaki Yutani, Ilia A. Kosenkov, Michael Milton
License: MIT

------------------------------

Name: extendr-macros
Files: vendor/extendr-macros/*
Authors: andy-thomason, Thomas Down, Mossa Merhi Reimert, Claus O. Wilke, Hiroaki Yutani, Ilia A. Kosenkov
License: MIT

------------------------------

Name: itertools
Files: vendor/itertools/*
Authors: bluss
License: MIT OR Apache-2.0

------------------------------

Name: libR-sys
Files: vendor/libR-sys/*
Authors: andy-thomason, Thomas Down, Mossa Merhi Reimert, Claus O. Wilke, Ilia A. Kosenkov, Hiroaki Yutani
License: MIT

------------------------------

Name: once_cell
Files: vendor/once_cell/*
Authors: Aleksey Kladov
License: MIT OR Apache-2.0

------------------------------

Name: paste
Files: vendor/paste/*
Authors: David Tolnay
License: MIT OR Apache-2.0

------------------------------

Name: proc-macro2
Files: vendor/proc-macro2/*
Authors: David Tolnay, Alex Crichton
License: MIT OR Apache-2.0

------------------------------

Name: quote
Files: vendor/quote/*
Authors: David Tolnay
License: MIT OR Apache-2.0

------------------------------

Name: syn
Files: vendor/syn/*
Authors: David Tolnay
License: MIT OR Apache-2.0

------------------------------

Name: unicode-ident
Files: vendor/unicode-ident/*
Authors: David Tolnay
License: (MIT OR Apache-2.0) AND Unicode-DFS-2016
2 changes: 1 addition & 1 deletion R/graph.R
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ find_least_common_parents <- function(graph, nodes) {
#'
#' @description
#' Converts the graph to a list.
#' @param graph The graph to convert to a list.
#' @param x The graph to convert to a list.
#' @param ... Ignored.
#' @return A list representation of the graph.
#' @export
Expand Down
51 changes: 51 additions & 0 deletions inst/AUTHORS
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
The authors of the dependency Rust crates:

either (version 1.9.0):
bluss

extendr-api (version 0.6.0):
andy-thomason
Thomas Down
Mossa Merhi Reimert
Claus O. Wilke
Hiroaki Yutani
Ilia A. Kosenkov
Michael Milton

extendr-macros (version 0.6.0):
andy-thomason
Thomas Down
Mossa Merhi Reimert
Claus O. Wilke
Hiroaki Yutani
Ilia A. Kosenkov

itertools (version 0.11.0):
bluss

libR-sys (version 0.6.0):
andy-thomason
Thomas Down
Mossa Merhi Reimert
Claus O. Wilke
Ilia A. Kosenkov
Hiroaki Yutani

once_cell (version 1.18.0):
Aleksey Kladov

paste (version 1.0.14):
David Tolnay

proc-macro2 (version 1.0.69):
David Tolnay
Alex Crichton

quote (version 1.0.33):
David Tolnay

syn (version 2.0.39):
David Tolnay

unicode-ident (version 1.0.12):
David Tolnay
4 changes: 2 additions & 2 deletions man/as.list.AcyclicGraph.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/as_graph.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/as_graph.data.frame.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/find_roots.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion man/new_graph.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 20 additions & 5 deletions src/Makevars
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# TODO
VENDORING = yes
OFFLINE_OPTION = --offline

TARGET_DIR = ./rust/target
LIBDIR = $(TARGET_DIR)/release
STATLIB = $(LIBDIR)/liborbweaver.a
Expand All @@ -7,24 +11,35 @@ all: C_clean

$(SHLIB): $(STATLIB)

CARGOTMP = $(CURDIR)/.cargo

$(STATLIB):
# vendoring (Note: to avoid NOTE of "Found the following hidden files and
# directories", .cargo needs to be created here)
if [ "$(VENDORING)" = "yes" ]; then \
$(TAR) --extract --xz -f ./rust/vendor.tar.xz -C ./rust && \
mkdir -p ./rust/.cargo && \
cp ./config/cargo_vendor_config.toml ./rust/.cargo/config.toml; \
fi

# In some environments, ~/.cargo/bin might not be included in PATH, so we need
# to set it here to ensure cargo can be invoked. It is appended to PATH and
# therefore is only used if cargo is absent from the user's PATH.
if [ "$(NOT_CRAN)" != "true" ]; then \
export CARGO_HOME=$(CARGOTMP); \
fi && \
export PATH="$(PATH):$(HOME)/.cargo/bin" && \
cargo build --lib --release --manifest-path=./rust/Cargo.toml --target-dir $(TARGET_DIR)
cd ./rust && \
cargo build --lib --release \
$(OFFLINE_OPTION) \
--jobs 1
if [ "$(NOT_CRAN)" != "true" ]; then \
rm -Rf $(CARGOTMP) && \
rm -Rf $(LIBDIR)/build; \
fi

C_clean:
rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS)
rm -Rf $(SHLIB) $(OBJECTS) ./rust/.cargo $(STATLIB)

clean:
rm -Rf $(SHLIB) $(STATLIB) $(OBJECTS) rust/target
rm -Rf $(SHLIB) $(OBJECTS) $(STATLIB) ./rust/.cargo ./rust/vendor ./rust/target

.PHONY: all C_clean clean
Loading

0 comments on commit e4a3586

Please sign in to comment.