diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 5e9b6cd..b2e6aba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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: @@ -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 @@ -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 @@ -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: @@ -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 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a77863a..170b9a3 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. diff --git a/Makefile b/Makefile index adb68e6..bfa9410 100644 --- a/Makefile +++ b/Makefile @@ -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: @@ -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 @@ -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: diff --git a/rust-toolchain.toml b/rust-toolchain.toml deleted file mode 100644 index 292fe49..0000000 --- a/rust-toolchain.toml +++ /dev/null @@ -1,2 +0,0 @@ -[toolchain] -channel = "stable" diff --git a/src/dialect/base.rs b/src/dialect/base.rs index 0c47245..0d42fa4 100644 --- a/src/dialect/base.rs +++ b/src/dialect/base.rs @@ -1,3 +1,5 @@ +#![allow(clippy::redundant_field_names)] + use crate::internal::template; #[rapidquery_macros::pyclass("rapidquery.dialect.LikeConfig", from_py_object, eq, hash)]