!1 Init package
From: @misaka00251 Reviewed-by: @laokz Signed-off-by: @laokz
This commit is contained in:
commit
9b07d0aaba
94
0001-Skip-some-tests-on-big-endian-machines.patch
Normal file
94
0001-Skip-some-tests-on-big-endian-machines.patch
Normal file
@ -0,0 +1,94 @@
|
||||
From 6ada17c4c4c38716ece922e99493027c3d04f467 Mon Sep 17 00:00:00 2001
|
||||
From: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
Date: Sun, 25 Apr 2021 02:35:26 -0400
|
||||
Subject: [PATCH] Skip some tests on big-endian machines.
|
||||
|
||||
Signed-off-by: Elliott Sales de Andrade <quantum.analyst@gmail.com>
|
||||
---
|
||||
tests/testthat/test-assert.R | 1 +
|
||||
tests/testthat/test-cast.R | 1 +
|
||||
tests/testthat/test-partial-factor.R | 36 +++++++++++++++-------------
|
||||
3 files changed, 22 insertions(+), 16 deletions(-)
|
||||
|
||||
diff --git a/tests/testthat/test-assert.R b/tests/testthat/test-assert.R
|
||||
index 8c073931..02d02362 100644
|
||||
--- a/tests/testthat/test-assert.R
|
||||
+++ b/tests/testthat/test-assert.R
|
||||
@@ -192,6 +192,7 @@ test_that("unspecified is finalised before assertion", {
|
||||
|
||||
test_that("assertion failures are explained", {
|
||||
expect_known_output(file = test_path("test-assert-explanations.txt"), {
|
||||
+ skip_if(.Platform$endian == "big")
|
||||
local_no_stringsAsFactors()
|
||||
local_options(rlang_backtrace_on_error = "none")
|
||||
|
||||
diff --git a/tests/testthat/test-cast.R b/tests/testthat/test-cast.R
|
||||
index e4fc08ec..83d0ac06 100644
|
||||
--- a/tests/testthat/test-cast.R
|
||||
+++ b/tests/testthat/test-cast.R
|
||||
@@ -56,6 +56,7 @@ test_that("cast common preserves names", {
|
||||
|
||||
test_that("cast errors create helpful messages (#57, #225)", {
|
||||
expect_known_output(file = test_path("test-cast-error-nested.txt"), {
|
||||
+ skip_if(.Platform$endian == "big")
|
||||
# Lossy cast
|
||||
try2(vec_cast("foo", 10))
|
||||
|
||||
diff --git a/tests/testthat/test-partial-factor.R b/tests/testthat/test-partial-factor.R
|
||||
index 7bf52365..c25a4aaf 100644
|
||||
--- a/tests/testthat/test-partial-factor.R
|
||||
+++ b/tests/testthat/test-partial-factor.R
|
||||
@@ -1,16 +1,18 @@
|
||||
|
||||
test_that("has ok print method", {
|
||||
- partial <- partial_factor("x")
|
||||
- expect_known_output(
|
||||
- print(partial),
|
||||
- test_path("test-partial-factor-print-partial.txt")
|
||||
- )
|
||||
+ if (.Platform$endian == "little") {
|
||||
+ partial <- partial_factor("x")
|
||||
+ expect_known_output(
|
||||
+ print(partial),
|
||||
+ test_path("test-partial-factor-print-partial.txt")
|
||||
+ )
|
||||
|
||||
- both <- vec_ptype2(partial, factor("y"))
|
||||
- expect_known_output(
|
||||
- print(both),
|
||||
- test_path("test-partial-factor-print-both.txt")
|
||||
- )
|
||||
+ both <- vec_ptype2(partial, factor("y"))
|
||||
+ expect_known_output(
|
||||
+ print(both),
|
||||
+ test_path("test-partial-factor-print-both.txt")
|
||||
+ )
|
||||
+ }
|
||||
|
||||
empty <- partial_factor()
|
||||
expect_known_output(
|
||||
@@ -18,13 +20,15 @@ test_that("has ok print method", {
|
||||
test_path("test-partial-factor-print-empty.txt")
|
||||
)
|
||||
|
||||
- learned <- vec_ptype2(empty, factor("y"))
|
||||
- expect_known_output(
|
||||
- print(learned),
|
||||
- test_path("test-partial-factor-print-learned.txt")
|
||||
- )
|
||||
+ if (.Platform$endian == "little") {
|
||||
+ learned <- vec_ptype2(empty, factor("y"))
|
||||
+ expect_known_output(
|
||||
+ print(learned),
|
||||
+ test_path("test-partial-factor-print-learned.txt")
|
||||
+ )
|
||||
|
||||
- expect_equal(vec_ptype_abbr(partial), "prtl_fctr")
|
||||
+ expect_equal(vec_ptype_abbr(partial), "prtl_fctr")
|
||||
+ }
|
||||
})
|
||||
|
||||
test_that("order of levels comes from data", {
|
||||
--
|
||||
2.29.2
|
||||
|
||||
105
R-vctrs.spec
Normal file
105
R-vctrs.spec
Normal file
@ -0,0 +1,105 @@
|
||||
# Bootstrap
|
||||
%bcond_with check
|
||||
|
||||
%global packname vctrs
|
||||
%global packver 0.3.8
|
||||
%global rlibdir %{_libdir}/R/library
|
||||
|
||||
Name: R-%{packname}
|
||||
Version: 0.3.8
|
||||
Release: 1
|
||||
Summary: Vector Helpers
|
||||
|
||||
License: MIT
|
||||
URL: https://CRAN.R-project.org/package=%{packname}
|
||||
Source0: https://cran.r-project.org/src/contrib/%{packname}_%{packver}.tar.gz
|
||||
# https://github.com/r-lib/vctrs/issues/1353
|
||||
Patch0001: 0001-Skip-some-tests-on-big-endian-machines.patch
|
||||
|
||||
BuildRequires: R-devel
|
||||
BuildRequires: tex(latex)
|
||||
BuildRequires: R-ellipsis >= 0.2.0
|
||||
BuildRequires: R-glue
|
||||
BuildRequires: R-rlang >= 0.4.10
|
||||
%if %{with check}
|
||||
BuildRequires: R-bit64
|
||||
BuildRequires: R-crayon
|
||||
BuildRequires: R-dplyr >= 0.8.5
|
||||
BuildRequires: R-generics
|
||||
BuildRequires: R-knitr
|
||||
BuildRequires: R-pillar >= 1.4.4
|
||||
BuildRequires: R-pkgdown
|
||||
BuildRequires: R-rmarkdown
|
||||
BuildRequires: R-testthat >= 2.3.0
|
||||
BuildRequires: R-tibble
|
||||
BuildRequires: R-withr
|
||||
BuildRequires: R-xml2
|
||||
BuildRequires: R-waldo >= 0.2.0
|
||||
BuildRequires: R-zeallot
|
||||
%endif
|
||||
|
||||
%description
|
||||
Defines new notions of prototype and size that are used to provide tools for
|
||||
consistent and well-founded type-coercion and size-recycling, and are in turn
|
||||
connected to ideas of type- and size-stability useful for analysing function
|
||||
interfaces.
|
||||
|
||||
|
||||
%package devel
|
||||
Summary: Development files for %{name}
|
||||
Requires: %{name}%{?_isa} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
Development files for %{name}.
|
||||
|
||||
|
||||
%prep
|
||||
%setup -q -c -n %{packname}
|
||||
|
||||
pushd %{packname}
|
||||
sed -i 's/covr, //g' DESCRIPTION
|
||||
sed -i 's/pkgdown, //g' DESCRIPTION
|
||||
%patch0001 -p1
|
||||
popd
|
||||
|
||||
|
||||
%build
|
||||
|
||||
|
||||
%install
|
||||
mkdir -p %{buildroot}%{rlibdir}
|
||||
%{_bindir}/R CMD INSTALL -l %{buildroot}%{rlibdir} %{packname}
|
||||
test -d %{packname}/src && (cd %{packname}/src; rm -f *.o *.so)
|
||||
rm -f %{buildroot}%{rlibdir}/R.css
|
||||
|
||||
|
||||
%check
|
||||
%if %{with check}
|
||||
export LANG=C.UTF-8
|
||||
%{_bindir}/R CMD check %{packname}
|
||||
%endif
|
||||
|
||||
|
||||
%files
|
||||
%dir %{rlibdir}/%{packname}
|
||||
%doc %{rlibdir}/%{packname}/doc
|
||||
%doc %{rlibdir}/%{packname}/html
|
||||
%{rlibdir}/%{packname}/DESCRIPTION
|
||||
%doc %{rlibdir}/%{packname}/NEWS.md
|
||||
%license %{rlibdir}/%{packname}/LICENSE
|
||||
%{rlibdir}/%{packname}/INDEX
|
||||
%{rlibdir}/%{packname}/NAMESPACE
|
||||
%{rlibdir}/%{packname}/Meta
|
||||
%{rlibdir}/%{packname}/R
|
||||
%{rlibdir}/%{packname}/help
|
||||
%{rlibdir}/%{packname}/WORDLIST
|
||||
%dir %{rlibdir}/%{packname}/libs
|
||||
%{rlibdir}/%{packname}/libs/%{packname}.so
|
||||
|
||||
%files devel
|
||||
%{rlibdir}/%{packname}/include
|
||||
|
||||
|
||||
%changelog
|
||||
* Wed Jun 15 2022 misaka00251 <misaka00251@misakanet.cn> - 0.3.8-1
|
||||
- Init package (Thanks to fedora team)
|
||||
BIN
vctrs_0.3.8.tar.gz
Normal file
BIN
vctrs_0.3.8.tar.gz
Normal file
Binary file not shown.
Loading…
x
Reference in New Issue
Block a user