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
63 changes: 63 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
name: Test

on:
push:
branches: [main]
pull_request:

jobs:
test:
name: Test on ${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]

steps:
- uses: actions/checkout@v4

- name: Install uv
uses: astral-sh/setup-uv@v5
with:
enable-cache: true

- name: Set up Python
run: uv python install 3.11

- name: Install LibreOffice (Ubuntu)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libreoffice

- name: Install LibreOffice (macOS)
if: runner.os == 'macOS'
run: brew install --cask libreoffice

- name: Install LibreOffice (Windows)
if: runner.os == 'Windows'
run: choco install libreoffice-still -y --no-progress

- name: Add LibreOffice to PATH (Windows)
if: runner.os == 'Windows'
shell: pwsh
run: echo "C:\Program Files\LibreOffice\program" | Out-File -FilePath $env:GITHUB_PATH -Encoding utf8 -Append

- name: Confirm soffice is available
run: soffice --version

- name: Install dependencies
run: uv sync --all-extras

- name: Lint (ruff)
run: uv run ruff check src tests

- name: Format check (ruff)
run: uv run ruff format --check src tests

- name: Type check (mypy)
run: uv run mypy src/

- name: Run tests
run: uv run python -m testsweet tests/
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
__pycache__/
*.py[cod]
*.egg-info/
.pytest_cache/
.ruff_cache/

# uv / venvs
Expand Down
18 changes: 10 additions & 8 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## Layout

- `src/sheetwright/` — library + CLI entry points
- `tests/` — pytest tests, mirroring the package layout
- `tests/` — testsweet tests, mirroring the package layout
- `claude/specs/` — design specifications
- `claude/plans/` — implementation plans (when written)

Expand All @@ -18,27 +18,29 @@
## Python and tooling

- Python 3.11 (`.python-version`)

`python` must be run using `uv run python ...`

- [`uv`](https://docs.astral.sh/uv/) is the project manager — use
`uv sync` to install, `uv run <cmd>` to run, `uv add <pkg>` to add
runtime deps, `uv add --dev <pkg>` for dev deps. Don't edit
`pyproject.toml` dependency lists by hand unless you also know to
update `uv.lock`.

- [`ruff`](https://docs.astral.sh/ruff/) is the formatter/linter.
**Run `uv run ruff format <changed-files>` before every commit.**
Project style is `line-length = 79` and `quote-style = 'single'` —
use single quotes in new code; ruff format will fix mixed quoting.

- [`mypy`](https://mypy.readthedocs.io/) checks type annotations.
**Run `uv run mypy src/` before committing changes that add or
modify type annotations.** Public functions and CLI entry points
must have type hints; mypy must pass before commit.

`python` must be run using `uv run python ...`

## Testing

Use [testsweet](https://github.com/kaapstorm/testsweet). For links to
documentation, see its
[README.md](https://raw.githubusercontent.com/kaapstorm/testsweet/refs/heads/main/README.md).
- [testsweet](https://github.com/kaapstorm/testsweet) is the test library.
**Run `uv run python -m testsweet tests/` to verify changes.**
For links to documentation, see the testsweet
[README.md](https://raw.githubusercontent.com/kaapstorm/testsweet/refs/heads/main/README.md).

## Code style

Expand Down
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ A toolkit that lets [Claude Code](https://claude.com/claude-code) work with
spreadsheets the way it works with code: text-source files, git, TDD,
diffs, and review.

`.xlsx` is treated as a build artefact compiled from text sources. You
`.xlsx` is treated as a build artifact compiled from text sources. You
write Markdown tables and YAML sidecars; sheetwright produces the
workbook and runs [LibreOffice Calc](https://www.libreoffice.org/) in
headless mode (the default, swappable calc engine) to evaluate every
Expand Down Expand Up @@ -46,9 +46,15 @@ uv sync
uv run sheetwright --help
```

LibreOffice must be on `$PATH` for the default calc engine
(Debian/Ubuntu: `apt install libreoffice`; macOS:
`brew install --cask libreoffice`).
LibreOffice must be on `PATH` for the default calc engine.

- Debian/Ubuntu: `apt install libreoffice`
- macOS: `brew install --cask libreoffice`
- Windows (PowerShell):
`winget install --id TheDocumentFoundation.LibreOffice`

Windows users new to the command line should start with the
[Windows setup primer](docs/tutorials/windows-setup.md).

## Documentation

Expand Down
14 changes: 7 additions & 7 deletions claude/specs/2026-04-25_sheetwright-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,13 @@ draw values from it); small sheets stay fully in `.md`.

### Version control

| Versioned | Ignored |
|----------------------------------------------|------------------------------------------|
| `sheetwright.toml`, `workbook.toml` | `build/` (built xlsx) |
| `sheets/*.md`, `sheets/*.yaml` | `.sheetwright/` (built SQLite, caches) |
| `data/*.csv`, `data/_schema.sql` | |
| `tests/*.py` | |
| `imports/*.xlsx` (opt-in via `--archive`) | |
| Versioned | Ignored |
|-------------------------------------------|----------------------------------------|
| `sheetwright.toml`, `workbook.toml` | `build/` (built xlsx) |
| `sheets/*.md`, `sheets/*.yaml` | `.sheetwright/` (built SQLite, caches) |
| `data/*.csv`, `data/_schema.sql` | |
| `tests/*.py` | |
| `imports/*.xlsx` (opt-in via `--archive`) | |

## Workflows

Expand Down
Loading
Loading