Skip to content

Commit

Permalink
Merge branch 'main' into ci-debug
Browse files Browse the repository at this point in the history
  • Loading branch information
eitsupi authored Mar 11, 2024
2 parents ec59c7c + 9350f84 commit 42f78b5
Show file tree
Hide file tree
Showing 172 changed files with 3,555 additions and 2,162 deletions.
4 changes: 4 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,7 @@
^\.editorconfig$
^rustfmt\.toml$
^\.lintr\.R$
^\.mega-linter\.yml$
^\.lycheeignore$
^\.yamllint\.yml$
^\.ecrc$
21 changes: 21 additions & 0 deletions .ecrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"Verbose": false,
"Debug": false,
"IgnoreDefaults": false,
"SpacesAftertabs": false,
"NoColor": false,
"Exclude": [
"LICENSE\\.note$",
"tests/testthat/_snaps/"
],
"AllowedContentTypes": [],
"PassedFiles": [],
"Disable": {
"EndOfLine": false,
"Indentation": false,
"IndentSize": false,
"InsertFinalNewline": false,
"TrimTrailingWhitespace": false,
"MaxLineLength": false
}
}
5 changes: 2 additions & 3 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,9 @@ root = true
[*]
insert_final_newline = true
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true

[*.md]
indent_style = space
indent_size = 2

[NEWS.md]
indent_size = 4
2 changes: 1 addition & 1 deletion .github/actions/setup/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ inputs:
description: Set up Rust nightly toolchain?
required: false
target:
description: Rust target triple to use
description: Rust target triple to use. If empty, the default target is used.
required: true
token:
description: GitHub token
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ defaults:
run:
shell: bash

permissions: read-all

jobs:
R-CMD-check:
runs-on: ${{ matrix.config.os }}
Expand Down Expand Up @@ -74,16 +76,16 @@ jobs:
id: rust-target
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
echo "TARGET=x86_64-pc-windows-gnu" >>$GITHUB_OUTPUT
echo "TARGET=x86_64-pc-windows-gnu" >>"$GITHUB_OUTPUT"
else
echo "TARGET=$(rustc -vV | grep host | cut -d' ' -f2)" >>$GITHUB_OUTPUT
echo "TARGET=$(rustc -vV | grep host | cut -d' ' -f2)" >>"$GITHUB_OUTPUT"
fi
- name: Set env vars for build option
if: matrix.config.full-features
run: |
echo "LIBR_POLARS_FEATURES=full_features" >>$GITHUB_ENV
echo "LIBR_POLARS_PROFILE=release" >>$GITHUB_ENV
echo "LIBR_POLARS_FEATURES=full_features" >>"$GITHUB_ENV"
echo "LIBR_POLARS_PROFILE=release" >>"$GITHUB_ENV"
- uses: ./.github/actions/setup
with:
Expand Down Expand Up @@ -111,7 +113,7 @@ jobs:
NOT_CRAN: "true"
run: |
Rscript -e 'pkgbuild::compile_dll()'
echo "LIBR_POLARS_PATH=$(pwd)/src/rust/target/${{ steps.rust-target.outputs.TARGET }}/release/libr_polars.a" >>$GITHUB_ENV
echo "LIBR_POLARS_PATH=$(pwd)/src/rust/target/${{ steps.rust-target.outputs.TARGET }}/release/libr_polars.a" >>"$GITHUB_ENV"
- uses: r-lib/actions/check-r-package@v2
env:
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@ env:
LIBR_POLARS_BUILD: "true"
LIBR_POLARS_PROFILE: release

permissions: read-all

jobs:
documentation:
runs-on: ubuntu-latest
Expand All @@ -63,9 +65,9 @@ jobs:
id: rust-target
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
echo "TARGET=x86_64-pc-windows-gnu" >>$GITHUB_OUTPUT
echo "TARGET=x86_64-pc-windows-gnu" >>"$GITHUB_OUTPUT"
else
echo "TARGET=$(rustc -vV | grep host | cut -d' ' -f2)" >>$GITHUB_OUTPUT
echo "TARGET=$(rustc -vV | grep host | cut -d' ' -f2)" >>"$GITHUB_OUTPUT"
fi
- uses: ./.github/actions/setup
Expand Down
84 changes: 84 additions & 0 deletions .github/workflows/mega-linter.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
---
# MegaLinter GitHub Action configuration file
# More info at https://megalinter.io
name: MegaLinter

on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:

concurrency:
group: ${{ github.ref }}-${{ github.workflow }}
cancel-in-progress: true

permissions: read-all

jobs:
megalinter:
name: MegaLinter
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout Code
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0

- name: MegaLinter
id: ml
# You can override MegaLinter flavor used to have faster performances
# More info at https://megalinter.io/flavors/
uses: oxsecurity/megalinter/flavors/[email protected]
env:
# All available variables are described in documentation
# https://megalinter.io/configuration/
VALIDATE_ALL_CODEBASE: ${{ github.event_name != 'pull_request' }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# ADD YOUR CUSTOM ENV VARIABLES HERE OR DEFINE THEM IN A FILE .mega-linter.yml AT THE ROOT OF YOUR REPOSITORY
# DISABLE: COPYPASTE,SPELL # Uncomment to disable copy-paste and spell checks

# Upload MegaLinter artifacts
- name: Archive production artifacts
if: success() || failure()
uses: actions/upload-artifact@v4
with:
name: MegaLinter reports
path: |
megalinter-reports
mega-linter.log
# Create pull request if applicable (for now works only on PR from same repository, not from forks)
- name: Create Pull Request with applied fixes
id: cpr
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
uses: peter-evans/create-pull-request@v6
with:
token: ${{ secrets.PAT || secrets.GITHUB_TOKEN }}
commit-message: "[MegaLinter] Apply linters automatic fixes"
title: "[MegaLinter] Apply linters automatic fixes"
labels: bot
- name: Create PR output
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'pull_request' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
run: |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}"
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}"
# Push new commit if applicable (for now works only on PR from same repository, not from forks)
- name: Prepare commit
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
run: sudo chown -Rc $UID .git/
- name: Commit and push applied linter fixes
if: steps.ml.outputs.has_updated_sources == 1 && (env.APPLY_FIXES_EVENT == 'all' || env.APPLY_FIXES_EVENT == github.event_name) && env.APPLY_FIXES_MODE == 'commit' && github.ref != 'refs/heads/main' && (github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository) && !contains(github.event.head_commit.message, 'skip fix')
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }}
commit_message: "[MegaLinter] Apply linters fixes"
commit_user_name: megalinter-bot
commit_user_email: [email protected]
8 changes: 5 additions & 3 deletions .github/workflows/release-lib.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ env:
LIBR_POLARS_FEATURES: "full_features"
LIBR_POLARS_PROFILE: release-optimized

permissions: read-all

jobs:
build:
runs-on: ${{ matrix.os }}
Expand Down Expand Up @@ -208,11 +210,11 @@ jobs:
- name: create checksums
working-directory: libs
run: |
sha256sum * >"../sha256sums.txt"
md5sum * >"../md5sums.txt"
sha256sum -- * >"../sha256sums.txt"
md5sum -- * >"../md5sums.txt"
- name: create release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
with:
prerelease: true
files: |
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ env:
LIBR_POLARS_PROFILE: release-optimized
NOT_CRAN: "true"

permissions: read-all

jobs:
build:
runs-on: ${{ matrix.config.os }}
Expand All @@ -52,6 +54,7 @@ jobs:
- uses: ./.github/actions/setup
with:
rust-nightly: true
target: ''
token: "${{ secrets.GITHUB_TOKEN }}"

- uses: r-lib/actions/setup-pandoc@v2
Expand All @@ -68,18 +71,16 @@ jobs:
needs: dev

- name: Build lib
if: matrix.config.target == ''
run: |
if [ "${{ runner.os }}" == "Windows" ]; then
TARGET=x86_64-pc-windows-gnu
else
TARGET="$(rustc -vV | grep host | cut -d' ' -f2)"
fi
Rscript -e 'pkgbuild::compile_dll()'
echo "LIBR_POLARS_PATH=$(pwd)/src/rust/target/${TARGET}/${{ env.LIBR_POLARS_PROFILE }}/libr_polars.a" >>$GITHUB_ENV
echo "LIBR_POLARS_PATH=$(pwd)/src/rust/target/${TARGET}/${{ env.LIBR_POLARS_PROFILE }}/libr_polars.a" >>"$GITHUB_ENV"
- name: make binary R package + test on host arch
if: matrix.config.target == ''
run: |
devtools::install(quick = TRUE)
devtools::test(stop_on_failure = TRUE)
Expand All @@ -105,7 +106,7 @@ jobs:
polars.zip
- name: Upload produced R packages (source or binary) to release
uses: softprops/action-gh-release@v1
uses: softprops/action-gh-release@v2
if: startsWith(github.ref, 'refs/tags/') && github.event_name != 'pull_request'
with:
files: |
Expand Down
5 changes: 5 additions & 0 deletions .lycheeignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
https://megalinter.io/configuration/
https://r-lib.github.io/p/pak/stable/%s/%s/%s
https://megalinter.io/flavors/
https://rpolars.github.io/vignettes
https://rpolars.github.io/man
11 changes: 11 additions & 0 deletions .mega-linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
APPLY_FIXES: all
DISABLE:
- RUST
- R
DISABLE_LINTERS:
- C_CPPLINT
- CSS_STYLELINT
- REPOSITORY_KICS
- SPELL_CSPELL
DISABLE_ERRORS_LINTERS:
- COPYPASTE_JSCPD
13 changes: 13 additions & 0 deletions .yamllint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
extends: default

rules:
braces:
max-spaces-inside: 1
comments-indentation: disable
document-start: disable
empty-lines:
level: warning
line-length:
max: 120
level: warning
truthy: disable
7 changes: 4 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: polars
Title: Lightning-Fast 'DataFrame' Library
Version: 0.14.1.9000
Version: 0.15.1.9000
Depends: R (>= 4.2)
Imports: utils, codetools, methods
Authors@R:
Expand Down Expand Up @@ -109,12 +109,13 @@ Collate:
'polars_options.R'
'rbackground.R'
'rust_result.R'
's3_methods.R'
's3-methods.R'
's3-methods-operator.R'
'series__series.R'
'sql.R'
'vctrs.R'
'zzz.R'
Config/rextendr/version: 0.3.1
VignetteBuilder: knitr
Config/polars/LibVersion: 0.38.0
Config/polars/LibVersion: 0.38.1
Config/polars/RustToolchainVersion: nightly-2024-02-23
12 changes: 6 additions & 6 deletions DEVELOPMENT.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,10 +91,10 @@ When updating the Rust Polars crate that the R package depends on,
the following steps are required:

1. Since the version of the Polars crate is specified by the Git revision,
update the `rev` of all `polars-*` crates in the `src/rust/Cargo.toml` file.
update the `rev` of all `polars-*` crates in the `src/rust/Cargo.toml` file.
2. Update the `Config/polars/RustToolchainVersion` field in the `DESCRIPTION`
file to the version of the Rust toolchain specified in the `toolchain.channel`
field of the `rust-toolchain.toml` file in the Polars crate Git repository.
file to the version of the Rust toolchain specified in the `toolchain.channel`
field of the `rust-toolchain.toml` file in the Polars crate Git repository.
3. Update the toolchain to the version specified in the `DESCRIPTION` file.
4. Repeat the build, test, and bug fixes of the R package.

Expand Down Expand Up @@ -127,7 +127,7 @@ Rscript dev/generate-lib-sums.R
The R package releases are done on GitHub pull requests.

1. Create a local branch for the release, push it to the remote repository (main
repository), then open a pull request to the `main` branch.
repository), then open a pull request to the `main` branch.
2. Bump the R package version with the `usethis` package.

```r
Expand All @@ -137,9 +137,9 @@ usethis::use_version()

3. Check the CI status of the pull request.
4. Push a tag named starting with `v` (e.g. `v0.10.0`). It triggers the GitHub
action to build the website and create a GitHub release.
action to build the website and create a GitHub release.
5. Bump the R package version to "dev version" with the `usethis` package
before merging the pull request.
before merging the pull request.

```r
usethis::use_dev_version()
Expand Down
4 changes: 4 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,11 @@ S3method("$<-",RPolarsDataFrame)
S3method("$<-",RPolarsRField)
S3method("%%",RPolarsChainedThen)
S3method("%%",RPolarsExpr)
S3method("%%",RPolarsSeries)
S3method("%%",RPolarsThen)
S3method("%/%",RPolarsChainedThen)
S3method("%/%",RPolarsExpr)
S3method("%/%",RPolarsSeries)
S3method("%/%",RPolarsThen)
S3method("&",RPolarsChainedThen)
S3method("&",RPolarsExpr)
Expand Down Expand Up @@ -117,6 +119,7 @@ S3method("[[",RPolarsVecDataFrame)
S3method("[[",RPolarsWhen)
S3method("^",RPolarsChainedThen)
S3method("^",RPolarsExpr)
S3method("^",RPolarsSeries)
S3method("^",RPolarsThen)
S3method("|",RPolarsChainedThen)
S3method("|",RPolarsExpr)
Expand Down Expand Up @@ -158,6 +161,7 @@ S3method(as_polars_df,RPolarsRollingGroupBy)
S3method(as_polars_df,RPolarsSeries)
S3method(as_polars_df,data.frame)
S3method(as_polars_df,default)
S3method(as_polars_df,nanoarrow_array)
S3method(as_polars_df,nanoarrow_array_stream)
S3method(as_polars_lf,RPolarsLazyFrame)
S3method(as_polars_lf,RPolarsLazyGroupBy)
Expand Down
Loading

0 comments on commit 42f78b5

Please sign in to comment.