Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
72 changes: 67 additions & 5 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,56 @@ env:
UV_PYTHON_DOWNLOADS: 0

jobs:
test-rust-stable:
if: github.event.pull_request.draft == false

name: "Rust Stable (Python 3.14)"
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false

- uses: dtolnay/rust-toolchain@nightly

- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
if: github.event_name == 'pull_request' && github.run_attempt == 1
with:
lookup-only: false
shared-key: "3.14"

- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
python-version: 3.14

- name: "Install uv"
uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
enable-cache: false

- name: "Create and activate .venv"
run: |
uv venv .venv --python 3.14
echo ".venv/bin" >> "$GITHUB_PATH"
echo "PYO3_PYTHON=.venv/bin/python3" >> "$GITHUB_ENV"

- name: "Install dependencies"
run: uv sync --group dev

- name: "Run maturin"
run: maturin develop

- name: "Run pytest"
run: pytest -v -n auto
env:
HYPOTHESIS_PROFILE: slow

test-python:
if: github.event.pull_request.draft == false

name: ${{ matrix.python-version }}
runs-on: ubuntu-latest
continue-on-error: ${{ endsWith(matrix.python-version, 't') }}
strategy:
fail-fast: false
matrix:
Expand All @@ -45,7 +89,7 @@ jobs:
with:
persist-credentials: false

- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@nightly

- uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2
if: github.event_name == 'pull_request' && github.run_attempt == 1
Expand Down Expand Up @@ -73,13 +117,22 @@ jobs:
run: uv sync --group dev

- name: "Run maturin"
run: maturin develop
run: maturin develop --features nightly

- name: "Run pytest"
run: pytest -v -n auto
env:
HYPOTHESIS_PROFILE: slow

# Recompile and test the package without nightly feature
- name: "Run maturin (without nightly feature)"
run: maturin develop --features nightly

- name: "Run pytest (without nightly feature)"
run: pytest -v -n auto
env:
HYPOTHESIS_PROFILE: slow

test-os:
if: github.event.pull_request.draft == false

Expand All @@ -95,7 +148,7 @@ jobs:
with:
persist-credentials: false

- uses: dtolnay/rust-toolchain@stable
- uses: dtolnay/rust-toolchain@nightly

- uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with:
Expand Down Expand Up @@ -123,9 +176,18 @@ jobs:
run: uv pip install --group dev

- name: "Run maturin"
run: maturin develop
run: maturin develop --features nightly

- name: "Run pytest"
run: pytest -v -n auto
env:
HYPOTHESIS_PROFILE: slow

# Recompile and test the package without nightly feature
- name: "Run maturin (without nightly feature)"
run: maturin develop --features nightly

- name: "Run pytest (without nightly feature)"
run: pytest -v -n auto
env:
HYPOTHESIS_PROFILE: slow
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ You'll need the following prerequisites:
- uv
- git - For version control
- make - For running development commands (or use nmake on Windows)
- Rust - Both stable and nightly (nightly is used for formatting)
- Rust - Nightly version

Fork the repository on GitHub and clone your fork locally.

Expand Down
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,18 +25,18 @@ rebuild-lockfiles: .uv
.PHONY: build-dev ## Build the development version of the package
build-dev:
@rm -f rapidquery/*.so
$(uv-run-no-sync) maturin develop --uv
$(uv-run-no-sync) maturin develop --uv --features nightly

.PHONY: build-prod ## Build the production version of the package
build-prod:
@rm -f rapidquery/*.so
$(uv-run-no-sync) maturin develop --uv --release
$(uv-run-no-sync) maturin develop --uv --release --features nightly

.PHONY: format ## Auto-format rust and python source files
format:
uv run ruff check --fix .
uv run ruff format .
cargo +nightly fmt --all
cargo fmt --all

.PHONY: lint-python ## Lint python source files
lint-python:
Expand All @@ -46,8 +46,8 @@ lint-python:

.PHONY: lint-rust ## Lint rust source files
lint-rust:
cargo +nightly fmt --version
cargo +nightly fmt --all -- --check
cargo fmt --version
cargo fmt --all -- --check
cargo clippy --version
cargo clippy --tests -- -D warnings

Expand All @@ -56,7 +56,7 @@ lint: lint-python lint-rust

.PHONY: test-rust ## Run Rust tests
test-rust:
cargo test --workspace --no-default-features --features auto-initialize --all-targets
cargo test --workspace --no-default-features --features auto-initialize,nightly --all-targets

.PHONY: test-python ## Run Python tests
test-python:
Expand Down
2 changes: 0 additions & 2 deletions rust-toolchain.toml

This file was deleted.

2 changes: 2 additions & 0 deletions src/dialect/base.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#![allow(clippy::redundant_field_names)]

use crate::internal::template;

#[rapidquery_macros::pyclass("rapidquery.dialect.LikeConfig", from_py_object, eq, hash)]
Expand Down
Loading