Skip to content

Commit

Permalink
Merge branch 'Rdatatable:master' into Spanish-translations
Browse files Browse the repository at this point in the history
  • Loading branch information
rikivillalba authored Aug 5, 2024
2 parents 77c447a + 846b512 commit 4309309
Show file tree
Hide file tree
Showing 17 changed files with 228 additions and 132 deletions.
3 changes: 3 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,6 @@
^lib$
^library$
^devwd$

# only the inst/po compressed files are needed, not raw .pot/.po
^po$
13 changes: 13 additions & 0 deletions .ci/linters/c/omp_set_num_threads_linter.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@

# Ensure no calls to omp_set_num_threads() [to avoid affecting other packages and base R]
# Only comments referring to it should be in openmp-utils.c
omp_set_num_threads_linter = function(c_file) {
# strip comments, we only care if the function appears in actual code.
processed_lines = system2("gcc", c("-fpreprocessed", "-E", c_file), stdout=TRUE, stderr=FALSE)
idx = grep("omp_set_num_threads", processed_lines, fixed = TRUE)
if (!length(idx)) return()
stop(sprintf(
"In %s, found omp_set_num_threads() usage, which could affect other packages and base R:\n%s",
c_file, paste0(" ", format(idx), ":", processed_lines[idx], collapse = "\n")
))
}
2 changes: 1 addition & 1 deletion .ci/publish.R
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ r.ver <- function(x) {
v = tmp[3L]
if (identical(v, "rel")) "r-release"
else if (identical(v, "dev")) "r-devel"
else if (identical(v, "old")) "r-oldrel"
else if (identical(v, "old") || identical(v, "ancient")) "r-oldrel"
else {
if (grepl("\\D", v)) stop("third word in test job name must be rel/dev/old or numbers of R version")
paste0("r-", paste(strsplit(v, "")[[1L]], collapse="."))
Expand Down
3 changes: 0 additions & 3 deletions .dev/CRAN_Release.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -54,9 +54,6 @@ grep -RI --exclude-dir=".git" --exclude="*.md" --exclude="*~" --color='auto' -P
# Unicode is now ok. This unicode in tests.Rraw is passing on CRAN.
grep -RI --exclude-dir=".git" --exclude="*.md" --exclude="*~" --color='auto' -n "[\]u[0-9]" ./

# Ensure no calls to omp_set_num_threads() [to avoid affecting other packages and base R]
# Only comments referring to it should be in openmp-utils.c
grep omp_set_num_threads ./src/*

# Ensure no calls to omp_set_nested() as i) it's hard to fully honor OMP_THREAD_LIMIT as required by CRAN, and
# ii) a simpler non-nested approach is always preferable if possible, as has been the case so far
Expand Down
2 changes: 1 addition & 1 deletion .github/CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ and then the `commit` and `push` shown above would push to the branch in the mai

#### Translations

`data.table` offers some translations so that our users can get feedback (errors, warnings, verbose messages) in their native language. Currently we only support Mandarin Chinese.
`data.table` offers some translations so that our users can get feedback (errors, warnings, verbose messages) in their native language. There is a [translation team](https://github.com/orgs/Rdatatable/teams/translators/teams) for each currently supported translation.

The data for these translations lives in the `po` folder. You do not need to make any changes here for your PR -- translations are updated in a batch before each CRAN release.

Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/code-quality.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,10 @@ jobs:
- uses: r-lib/actions/setup-r@v2
- name: Lint
run: |
for (f in list.files('.ci/linters/c', full.names=TRUE)) source(f)
for (f in list.files('src', pattern='[.]c$', full.names=TRUE)) {
alloc_linter(f)
linter_env = new.env()
for (f in list.files('.ci/linters/c', full.names=TRUE)) sys.source(f, linter_env)
for (f in list.files('src', pattern='[.][ch]$', full.names=TRUE)) {
for (linter in ls(linter_env)) linter_env[[linter]](f)
# TODO(#6272): Incorporate more checks from CRAN_Release
}
shell: Rscript {0}
59 changes: 59 additions & 0 deletions .github/workflows/rchk.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
# adapted from a similar check run by {arrow}
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
on:
push:
branches:
- master
pull_request:

name: 'rchk'

jobs:
rchk:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: r-lib/actions/setup-r@v2
with:
r-version: 'devel'
- name: Build
run: |
ls -l | cat
R CMD build --no-build-vignettes .
mkdir packages
mv data.table_*.tar.gz packages
- name: Run rchk
run: |
docker run -v `pwd`/packages:/rchk/packages kalibera/rchk:latest /rchk/packages/data.table_*.tar.gz |& tee rchk.out
- name: Confirm that rchk has no errors
# Suspicious call, [UP], and [PB] are all of the error types currently at
# https://github.com/kalibera/cran-checks/tree/HEAD/rchk/results
# though this might not be exhaustive, there does not appear to be a way to have rchk return an error code
# CRAN also will remove some of the outputs (especially those related to Rcpp and strptime, e.g.
# ERROR: too many states (abstraction error?))
# https://github.com/kalibera/rchk
run: |
cat rchk.out
if [ $(grep -Fc "Suspicious call" rchk.out) -gt 0 ] || [ $(grep -F "[UP]" rchk.out | grep -Fvc "results will be incomplete") -gt 0 ] || [ $(grep -Fc "[PB]" rchk.out) -gt 0 ]; then
echo "Found rchk errors"
exit 1
fi
if: always()
- name: Dump rchk output logs
run: cat rchk.out
if: always()
7 changes: 3 additions & 4 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -203,10 +203,9 @@ test-lin-dev-clang-cran:
- >-
Rscript -e 'l=tail(readLines("data.table.Rcheck/00check.log"), 1L); notes<-"Status: 3 NOTEs"; if (!identical(l, notes)) stop("Last line of ", shQuote("00check.log"), " is not ", shQuote(notes), " (size of tarball, installed package size, non-API calls) but ", shQuote(l)) else q("no")'
## R 3.1.0
# stated dependency on R
test-lin-310-cran:
image: registry.gitlab.com/jangorecki/dockerfiles/r-3.1.0
test-lin-ancient-cran:
image: registry.gitlab.com/jangorecki/dockerfiles/r-3.3.0
<<: *test-lin
script:
- *install-deps
Expand Down Expand Up @@ -301,7 +300,7 @@ integration:
- saas-linux-medium-amd64
only:
- master
needs: ["mirror-packages","build","test-lin-rel","test-lin-rel-cran","test-lin-dev-gcc-strict-cran","test-lin-dev-clang-cran","test-lin-rel-vanilla","test-lin-310-cran","test-win-rel","test-win-dev" ,"test-win-old"]
needs: ["mirror-packages","build","test-lin-rel","test-lin-rel-cran","test-lin-dev-gcc-strict-cran","test-lin-dev-clang-cran","test-lin-rel-vanilla","test-lin-ancient-cran","test-win-rel","test-win-dev" ,"test-win-old"]
script:
- R --version
- *install-deps ## markdown pkg not present in r-pkgdown image
Expand Down
4 changes: 3 additions & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -86,5 +86,7 @@ Authors@R: c(
person("Dmitry", "Shemetov", role="ctb"),
person("Nitish", "Jha", role="ctb"),
person("Joshua", "Wu", role="ctb"),
person("Iago", "Giné-Vázquez", role="ctb")
person("Iago", "Giné-Vázquez", role="ctb"),
person("Anirban", "Chetia", role="ctb"),
person("Doris", "Amoakohene", role="ctb")
)
Loading

0 comments on commit 4309309

Please sign in to comment.