Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
0dc2d91
Update DESIGN.md for Rust migration
jelmer Aug 3, 2025
076f635
Add Rust project configuration and dependencies
jelmer Aug 3, 2025
bfbd9e1
Add core Rust types for replacements and AST handling
jelmer Aug 3, 2025
dfef5d1
Implement deprecated function collection using Ruff parser
jelmer Aug 3, 2025
86619a4
Add Rust migration engine with AST transformation
jelmer Aug 3, 2025
9926d77
Add type introspection via Pyright and MyPy integration
jelmer Aug 3, 2025
5879535
Add Rust CLI binary with migrate, check, cleanup, and info commands
jelmer Aug 3, 2025
159bdb7
Add file scanning, validation, and removal utilities
jelmer Aug 3, 2025
69774b3
Add comprehensive Rust test suite
jelmer Aug 3, 2025
aa5820b
Update Python package to provide decorator functionality only
jelmer Aug 3, 2025
95f8049
Remove Python CLI and migration code (moved to Rust)
jelmer Aug 3, 2025
f9c8029
Remove Python tests for migrated functionality
jelmer Aug 3, 2025
0e9fa7a
Update documentation and CI for Rust migration
jelmer Aug 3, 2025
244e306
Update Python packaging configuration
jelmer Aug 3, 2025
ac1624b
Optimize Rust code for better performance and idioms
jelmer Aug 3, 2025
adc2fb3
Integrate Rust binary into Python package and migrate README
jelmer Aug 3, 2025
b066152
Fix test compilation errors from String to &Path parameter changes
jelmer Aug 3, 2025
4439a28
Optimize Rust code performance and idioms
jelmer Aug 3, 2025
00d1f91
Simplify Python/Rust packaging with wrapper approach
jelmer Aug 3, 2025
c7c6b8e
Fix failing test and rename crate references
jelmer Aug 3, 2025
d0b39b7
Improve test coverage
jelmer Aug 3, 2025
7736cb0
Fix formatting
jelmer Aug 3, 2025
57cdaa2
Fix typing
jelmer Aug 4, 2025
ae41f35
Fix test configuration and typing issues
jelmer Aug 4, 2025
0980d7f
Drop clippy tests for now
jelmer Aug 4, 2025
989b97d
Install pyright
jelmer Aug 4, 2025
83231a5
Disable rust cli for Windows
jelmer Aug 4, 2025
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
45 changes: 41 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,50 @@
---
name: Python tests
name: Tests

"on":
- push
- pull_request

env:
CARGO_TERM_COLOR: always
RUST_BACKTRACE: 1

jobs:
pythontests:
rust-tests:
name: Rust Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
rust: [stable]
fail-fast: false

steps:
- uses: actions/checkout@v3
- name: Install Rust
uses: dtolnay/rust-toolchain@master
with:
toolchain: ${{ matrix.rust }}
components: rustfmt
- name: Install Python (for PyO3)
uses: actions/setup-python@v4
with:
python-version: '3.11'
- name: Install python dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pyright
- name: Check Rust formatting
run: cargo fmt --all -- --check
- name: Build
run: cargo build --verbose
- name: Run Rust tests
run: cargo test --verbose
env:
RUST_TEST_THREADS: 2

pythontests:
name: Python Tests
runs-on: ${{ matrix.os }}
strategy:
matrix:
Expand All @@ -16,9 +53,9 @@ jobs:
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
Expand Down
18 changes: 18 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,22 @@ __pycache__
.tox
*~
*.swp
*.swo
*.un~
build/
.venv/
.pytest_cache/
mutants.out/
mutants.out.*/
.mypy_cache/
.coverage
htmlcov/
*.pyc
*.pyo
*.pyd
.DS_Store


# Added by cargo

/target
133 changes: 93 additions & 40 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,69 +2,122 @@

Thank you for your interest in contributing to Dissolve! This document provides guidelines for contributing to the project.

## Development Setup
## 🛠️ Development Setup

1. Clone the repository and install dependencies:
### Prerequisites
- **Rust toolchain** (1.70+): Install via [rustup.rs](https://rustup.rs/)
- **Python** (3.8+): For the decorator package and testing
- **Git**: For version control

### Initial Setup
1. **Clone and build**:
```bash
git clone https://github.com/jelmer/dissolve
cd dissolve

# Build Rust components
cargo build

# Install Python package in development mode
pip install -e .
```

2. **Install development dependencies**:
```bash
# Python tools
pip install -e .[dev]

# Rust tools (if not already installed)
rustup component add clippy rustfmt
```

2. Install pre-commit hooks (optional but recommended):
3. **Optional: Pre-commit hooks**:
```bash
pre-commit install
```

## Code Quality
## 🧪 Testing & Code Quality

We maintain high code quality standards using several tools:

### Linting and Formatting
- **Ruff**: Used for linting and code formatting
```bash
ruff check .
ruff format .
```

### Type Checking
- **MyPy**: Used for static type checking
```bash
mypy dissolve/
```

### Testing
- **Pytest**: Used for running tests
```bash
pytest
```
### Rust Development
```bash
# Run all tests
cargo test

**All new code should include comprehensive unit tests.** Tests should cover:
- Normal operation and expected behavior
- Edge cases and error conditions
- Different input combinations and scenarios
# Run with specific thread limit (recommended for CI)
RUST_TEST_THREADS=4 cargo test

Place tests in the `tests/` directory following the naming convention `test_<module_name>.py`.
# Check code style
cargo clippy

## Before Submitting a Pull Request
# Format code
cargo fmt

Please ensure your code passes all quality checks:
# Run clippy with fixes
cargo clippy --fix
```

### Python Development
```bash
ruff check .
# Format Python code
ruff format .

# Check Python code style
ruff check .

# Fix Python issues
ruff check --fix .

# Type checking
mypy dissolve/
pytest

# Run Python tests
PYTHONPATH=. pytest dissolve/tests/
```

## Design Guidelines
### 🚨 Important: Test Parallelism
The test suite creates many **Pyright LSP instances** which can be resource-intensive:

- **Default**: Tests auto-limit to 4 threads to prevent timeouts
- **CI/Limited Resources**: Use `RUST_TEST_THREADS=2 cargo test`
- **Powerful Machines**: You can try `RUST_TEST_THREADS=8 cargo test` but may hit timeouts

Please read [DESIGN.md](DESIGN.md) to understand the project's architecture and design principles before making significant changes.
### Test Guidelines
**All new code must include comprehensive tests** covering:
- ✅ Normal operation and expected behavior
- ✅ Edge cases and error conditions
- ✅ Different input combinations
- ✅ Integration with existing components

## Submitting Changes
**Test Organization**:
- **Rust tests**: Place in `src/tests/test_<feature>.rs`
- **Python tests**: Place in `dissolve/tests/test_<module>.py`
- **Integration tests**: Use existing `src/tests/test_*_comprehensive.rs` patterns

1. Fork the repository
2. Create a feature branch
3. Make your changes
4. Ensure all tests pass and code quality checks succeed
5. Submit a pull request with a clear description of your changes
## 📋 Contribution Workflow

### Before You Start
1. **Read [DESIGN.md](DESIGN.md)** to understand the architecture and design principles
2. **Check existing issues** on [GitHub](https://github.com/jelmer/dissolve/issues)
3. **Fork the repository** and create a feature branch

### Development Process
1. **Write code** following the established patterns
2. **Add tests** that cover your changes comprehensively
3. **Run the full test suite**:
```bash
# Rust components
cargo test
cargo clippy
cargo fmt --check

# Python components
ruff check .
ruff format --check .
mypy dissolve/
```
4. **Update documentation** if needed
5. **Submit a pull request** with a clear description of your changes

Thank you for contributing!
Thank you for contributing to Dissolve! 🙏
Loading
Loading