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
59 changes: 44 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,28 +1,57 @@
name: Continuous Integration
name: CI

on:
push:
branches:
- develop
branches: [main, develop]
pull_request:

jobs:
run_tests:
runs-on: ubuntu-latest
test:
name: ${{ matrix.os }} / py${{ matrix.python-version }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.10", "3.11", "3.12", "3.13"]

steps:
- name: Checkout code
uses: actions/checkout@v4
- uses: actions/checkout@v4

- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Set up Rust
uses: dtolnay/rust-toolchain@stable

- name: Rust cache
uses: Swatinem/rust-cache@v2
env:
TAR: ${{ matrix.os == 'windows-latest' && 'C:\Windows\System32\tar.exe' || 'tar' }}

- name: Install uv
run: pipx install uv
uses: astral-sh/setup-uv@v5
with:
cache-dependency-glob: "pyproject.toml"

- name: Set up Python
run: uv python install ${{ matrix.python-version }}

- name: Install dependencies
run: uv pip install -e .[dev] --system
- name: Sync
run: uv sync --all-extras

- name: Check native import
run: uv run python -c "import scriber._native; print('native ok')"

- name: Rust format check
run: cargo fmt --check

- name: Rust clippy
run: cargo clippy --all-targets -- -D warnings

- name: Rust tests
run: cargo test

- name: Run tests
run: pytest
run: uv run pytest

- name: CLI smoke
run: uv run scriber . --only-tree --output -
85 changes: 71 additions & 14 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,83 @@
name: Publish to PyPI
name: Release

on:
push:
tags:
- 'v*' # Triggers on any tag starting with v, like v0.0.3
- "v*"

jobs:
build_and_publish:
build:
name: Build ${{ matrix.os }}
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v4

- name: Build wheels
uses: PyO3/maturin-action@v1
with:
command: build
args: --release --locked --out dist --compatibility pypi
manylinux: "2014"
sccache: "true"

- name: Build sdist
if: matrix.os == 'ubuntu-latest'
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist

- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Wheel smoke install
shell: bash
run: |
python -m venv test_venv
if [ "${{ matrix.os }}" = "windows-latest" ]; then
test_venv/Scripts/pip install dist/*.whl
test_venv/Scripts/python -c "import scriber._native; print('native ok')"
test_venv/Scripts/scriber . --only-tree --output -
else
test_venv/bin/pip install dist/*.whl
test_venv/bin/python -c "import scriber._native; print('native ok')"
test_venv/bin/scriber . --only-tree --output -
fi

- name: Upload artifacts
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
path: dist

publish:
name: Publish
needs: [build]
runs-on: ubuntu-latest

permissions:
id-token: write # Required for trusted publishing
contents: read # Required to read the repository content
id-token: write
contents: read

steps:
- name: Checkout code
uses: actions/checkout@v3

- name: Install uv
run: pipx install uv
- uses: actions/download-artifact@v4
with:
path: dist-artifacts
pattern: wheels-*
merge-multiple: true

- name: Build distributions
run: uv build
- name: List artifacts
run: ls -la dist-artifacts

- name: Publish to PyPI
run: uv publish
- name: Publish
uses: pypa/gh-action-pypi-publish@release/v1
with:
packages-dir: dist-artifacts
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).


## [2.0.0] - 2026-05-30

### Added
- **⚡ Native Rust Acceleration (`scriber._native`)**: Full transition of filesystem scanning, high-performance file reading/writing, and binary classification to a compiled Rust extension built using Maturin and PyO3.
- **🌳 Fast Parallel Scanner**: Re-engineered directory scanning utilizing the `WalkBuilder` from the `ignore` crate, fully respecting `.gitignore` rules with blazing fast native execution.
- **🧪 Rigorous Verification & Equivalence Testing**: Comprehensive suite of regression and equivalence tests validating 100% exact matching behavior between Rust and Python scanner modules.
- **📦 Multi-Platform Binary Wheels**: CI/CD integration using `PyO3/maturin-action` to compile and distribute native wheels across Linux, macOS, and Windows.


## [1.1.2] - 2025-09-30

### Fixed
Expand Down
19 changes: 19 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
[package]
name = "project-scriber-native"
version = "2.0.0"
edition = "2021"

[lib]
name = "_native"
crate-type = ["cdylib"]
path = "rust/scriber_native/src/lib.rs"

[dependencies]
pyo3 = { version = "0.21", features = ["extension-module", "abi3-py310"] }
ignore = "0.4"
globset = "0.4"
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
memchr = "2.7"
regex = "1.10"

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
MIT License

Copyright (c) 2025 SunneV (Wojciech Mariusz Cichoń)
Copyright (c) 2026 SunneV

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
Loading
Loading