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
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

- [ ] Ran `tox` checks to avoid unnecessary CI fails:
```console
uvx tox -e all-checks,pytest
uvx tox
Copy link
Collaborator

@unnawut unnawut Oct 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @tcoratger this command ends with serving the docs server, can you help exclude mkdocs serve somehow?

```
- [ ] Considered adding appropriate tests for the changes.
- [ ] Considered updating the online docs in the [./docs/](/leanEthereum/leanSpec/tree/main/docs/) directory.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
python-version: "3.14"

- name: Sync dependencies
run: uv sync --all-packages --no-progress
run: uv sync --no-progress

- name: Fill test fixtures
run: uv run fill --fork=Devnet --clean
2 changes: 1 addition & 1 deletion CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ subspecifications that the Lean Ethereum protocol relies on.

### Running Tests
```bash
uv sync --all-packages # Install dependencies
uv sync # Install dependencies
uv run pytest # Run unit tests
uv run fill --fork=devnet --clean # Generate test vectors
# Note: execution layer support is planned for future, infrastructure is ready
Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Quick Start

1. Fork and clone the repository
2. Install dependencies: `uv sync --all-packages`
2. Install dependencies: `uv sync`
3. Make your changes
4. Run checks: `uvx tox -e all-checks`
5. Run tests: `uvx tox -e pytest`
Expand Down
25 changes: 12 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -175,19 +175,18 @@ def test_withdrawal_amount_above_uint64_max():

## Common Commands Reference

| Task | Command |
|-----------------------------------------------|-----------------------------------------------|
| Install and sync project and dev dependencies | `uv sync --all-packages` |
| Run tests | `uv run pytest ...` |
| Format code | `uv run ruff format src tests packages` |
| Lint code | `uv run ruff check src tests packages` |
| Fix lint errors | `uv run ruff check --fix src tests packages` |
| Type check | `uv run mypy src tests packages` |
| Build docs | `uv run mkdocs build` |
| Serve docs | `uv run mkdocs serve` |
| Run everything (checks + tests + docs) | `uvx tox` |
| Run all quality checks (no tests/docs) | `uvx tox -e all-checks` |

| Task | Command |
|-----------------------------------------------|----------------------------------------------|
| Install and sync project and dev dependencies | `uv sync` |
| Run tests | `uv run pytest ...` |
| Format code | `uv run ruff format src tests packages` |
| Lint code | `uv run ruff check src tests packages` |
| Fix lint errors | `uv run ruff check --fix src tests packages` |
| Type check | `uv run mypy src tests packages` |
| Build docs | `uv run mkdocs build` |
| Serve docs | `uv run mkdocs serve` |
| Run everything (checks + tests + docs) | `uvx tox` |
| Run all quality checks (no tests/docs) | `uvx tox -e all-checks` |

## Contributing

Expand Down
4 changes: 2 additions & 2 deletions packages/testing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ This package provides tools for generating consensus test fixtures, including:
## Installation

This package is part of the lean-spec workspace and is automatically installed when you
sync the parent project with `--all-packages`.
sync the parent project.

```bash
# from `leanSpec/` (root of workspace)
uv sync --all-packages
uv sync
```

## Usage
Expand Down
4 changes: 0 additions & 4 deletions packages/testing/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,6 @@ dependencies = [

license = {text = "MIT"}

[project.optional-dependencies]
test = ["pytest-cov>=6.0.0,<7"]
lint = ["ruff>=0.11.8,<1", "mypy>=1.15.0,<1.16"]

[project.urls]
Homepage = "https://github.com/leanEthereum/lean-spec"
Source = "https://github.com/leanEthereum/lean-spec"
Expand Down
13 changes: 11 additions & 2 deletions packages/testing/src/framework/cli/fill.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,13 +62,22 @@ def fill(
# Default layer is consensus
fill tests/spec_tests/devnet --fork=Devnet --clean -v
"""
# Look for pytest-fill.ini in current directory (project root)
config_path = Path.cwd() / "pytest-fill.ini"
config_path = Path(__file__).parent / "pytest_ini_files" / "pytest-fill.ini"
# Find project root by looking for pyproject.toml with [tool.uv.workspace]
project_root = Path.cwd()
while project_root != project_root.parent:
if (project_root / "pyproject.toml").exists():
# Check if this is the workspace root
pyproject = project_root / "pyproject.toml"
if "[tool.uv.workspace]" in pyproject.read_text():
break
project_root = project_root.parent

# Build pytest arguments
args = [
"-c",
str(config_path),
f"--rootdir={project_root}",
f"--output={output}",
f"--fork={fork}",
f"--layer={layer}",
Expand Down
File renamed without changes.
38 changes: 19 additions & 19 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -117,31 +117,31 @@ members = ["packages/*"]
lean-ethereum-testing = { workspace = true }

[dependency-groups]
dev = [
# debugging / convenience
"ipython>=8.31.0,<9",
"ipdb>=0.13",
"tomli-w>=1.0.0",
# packaging
"build>=1.2.0,<2",
"twine>=5.1.0,<6",
# test dependencies
test = [
"pytest>=8.3.3,<9",
"pytest-cov>=6.0.0,<7",
"pytest-xdist>=3.6.1,<4",
"hypothesis>=6.138.14",
# docs
"lean-ethereum-testing",
]
lint = [
"mypy>=1.17.0,<2",
"ruff>=0.13.2,<1",
"codespell>=2.4.1,<3",
]
docs = [
"mkdocs>=1.6.1,<2",
"mkdocs-material>=9.5.45,<10",
"mkdocstrings[python]>=0.27.0,<1",
"pyspelling>=2.8.2,<3",
"mdformat-gfm-alerts==2.0.0",
"mdformat-gfm==0.4.1",
"mdformat-ruff==0.1.3",
"mdformat-toc==0.3.0",
"mdformat==0.7.22",
# dev
"ruff>=0.11.8,<1",
"mypy>=1.15.0,<1.16",
"codespell>=2.4.1,<3",
]
dev = [
{include-group = "test"},
{include-group = "lint"},
{include-group = "docs"},
"ipython>=8.31.0,<9",
"ipdb>=0.13",
"tomli-w>=1.0.0",
"build>=1.2.0,<2",
"twine>=5.1.0,<6",
]
4 changes: 2 additions & 2 deletions tests/lean_spec/subspecs/ssz/test_hash.py
Original file line number Diff line number Diff line change
Expand Up @@ -620,8 +620,8 @@ class Var(Container):


# Set the ELEMENT_TYPE now that the classes are defined
FixedVector4.ELEMENT_TYPE = Fixed # type: ignore[has-type]
VarVector2.ELEMENT_TYPE = Var # type: ignore[has-type]
FixedVector4.ELEMENT_TYPE = Fixed # type: ignore[assignment]
VarVector2.ELEMENT_TYPE = Var # type: ignore[assignment]


class Complex(Container):
Expand Down
16 changes: 7 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,15 @@ requires =
tox >=4.32.0,<5
tox-uv >=1.29
env_list =
# defines what runs when `uvx tox` is executed with no `-e` argument
all-checks
pytest
docs
skip_missing_interpreters = true
runner = uv-venv-lock-runner
docs-build

[testenv]
basepython = python3.14
uv_python = >=3.12
dependency_groups = dev
package = editable
runner = uv-venv-lock-runner

[testenv:all-checks]
description = Run all quality checks (lint, typecheck, spellcheck, mdformat)
Expand Down Expand Up @@ -57,10 +55,10 @@ commands = pytest {posargs} tests -n auto --maxprocesses=10 --durations=10 --dis
description = Run tests with coverage (pytest)
commands = pytest --cov --cov-report=html --cov-report=term {posargs}

[testenv:docs]
description = Serve documentation locally (mkdocs)
commands = mkdocs serve {posargs}

[testenv:docs-build]
description = Build documentation (mkdocs)
commands = mkdocs build {posargs}

[testenv:docs-serve]
description = Serve documentation locally (mkdocs)
commands = mkdocs serve {posargs}
Loading
Loading