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
9 changes: 5 additions & 4 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [Unreleased]

### Changed
- Bumped MAX / Mojo toolchain dependency to `max ">=26.1.0,<27"` and updated recipes to pin `mojo_version = "=0.26.1"`.
- Updated lexer, parser, writer, and tests to use `codepoint_slices()` and explicit `List[String]` buffers instead of direct `String` indexing or iteration, matching Mojo 0.26.1 string and `__getitem__` semantics.
- Adopted a "no warnings" policy for the core library and tests so future migrations surface only new issues.
- Bumped project and packaging version metadata to `0.9.1` to mark progression towards the Mojo 1.0 beta migration milestone.
- Aligned project dependency pinning to Mojo `1.0.0` in `pixi.toml`.
- Updated packaging recipe compiler pins to `mojo-compiler =1.0.0` and aligned recipe metadata/license consistency.
- Updated migration planning/docs framing from “1.0 beta migration” to a stable Mojo 1.0 migration wave.
- Reworked `TomlValue` recursive storage for Mojo 1.0 compatibility by replacing direct `List[TomlValue]`/`Dict[String, TomlValue]` fields with boxed recursive values and explicit deep-copy/deinit handling.
- Updated parser APIs for Mojo 1.0 stdlib changes (`std.math` import path and `String.byte_length()` for numeric prefix checks).

### Planned for v0.6.0 - Remaining TOML 1.1
- Multiline inline tables with trailing commas
Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
`mojo-toml` enables native TOML parsing in Mojo without Python dependencies. Parse configuration files, project settings, and structured data with a clean, type-safe API.

**Key features:**

- ✅ **TOML 1.0 compliant** - full specification support
- ✅ **Array of tables** - `[[section]]` syntax for repeated table arrays
- ✅ **Alternative number bases** - hex (`0xDEAD`), octal (`0o755`), binary (`0b1101`)
Expand Down Expand Up @@ -200,10 +201,12 @@ pixi add mojo-toml
### 🔮 TOML 1.1 (Partial Support)

TOML 1.1 features implemented:

- ✅ `\\xHH` escape sequences for codepoints 0-255 (e.g., `\\x00`, `\\x61`)
- ✅ `\\e` escape for escape character (U+001B)

TOML 1.1 features not yet implemented:

- Multiline inline tables with trailing commas
- Optional seconds in datetime/time values

Expand Down Expand Up @@ -264,6 +267,7 @@ pixi run benchmark-python
```

Both benchmarks generate markdown reports in `benchmarks/reports/` with:

- System specifications (OS, CPU, GPU, RAM, Mojo/Python versions)
- Performance tables with throughput and latency
- Timestamp and machine configuration
Expand Down Expand Up @@ -292,15 +296,18 @@ See [ROADMAP.md](docs/planning/ROADMAP.md) for areas where contributions would b
## Related Projects

**Other Mojo Config Libraries:**

- **[mojo-ini](https://github.com/databooth/mojo-ini)** - INI file parser with Python configparser compatibility
- **[mojo-dotenv](https://github.com/databooth/mojo-dotenv)** - Load environment variables from .env files

**Other TOML Parsers in Mojo:**

- **[decimojo/tomlmojo](https://github.com/forfudan/decimojo/tree/main/src/tomlmojo)** - Lightweight TOML parser (~900 LOC, parser-only) embedded in the decimojo library. Good choice if you only need basic config reading for tests and don't need a standalone package or TOML 1.0 features.

## Acknowledgements

Special thanks to:

- **[DataBooth](https://www.databooth.com.au/posts/mojo)** - Project sponsor, building high-performance data and AI services with Mojo
- **[Python tomli](https://github.com/hukkin/tomli)** - Reference implementation for validation
- **[TOML Specification](https://toml.io/en/v1.0.0)** - Tom Preston-Werner's excellent config format
Expand Down
6 changes: 3 additions & 3 deletions RECIPE_SETUP.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The GitHub Actions workflow runs automatically when `packaging/recipe.yaml` chan

## 📋 Integration Options

### Option 1: Pre-commit Hook (Recommended)
### Option 1: Prek Hook (Recommended)

Add to `.pre-commit-config.yaml`:

Expand All @@ -74,7 +74,7 @@ Add to `.pre-commit-config.yaml`:
pass_filenames: false
```

Then: `pre-commit install`
Then: `prek install -f`

### Option 2: Just Recipe

Expand Down Expand Up @@ -125,6 +125,6 @@ See `docs/RECIPE_VALIDATION.md` for:
## 🔗 Next Steps

1. Test validation: `./scripts/validate-recipe.sh packaging/recipe.yaml`
2. Add to pre-commit: Edit `.pre-commit-config.yaml`
2. Add to prek: Edit `.pre-commit-config.yaml`
3. Replicate to other packages: Copy files as shown above
4. Read full guide: `docs/RECIPE_VALIDATION.md`
31 changes: 31 additions & 0 deletions docs/JUST_SETUP.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Just setup
This repository uses `just` to expose self-documented workflows.

## What is Just?
Just is a command runner similar to `make`, with a simpler syntax.

Official site:
- https://just.systems

Installation instructions:
- https://just.systems/man/en/chapter_4.html

Install options:
- macOS (Homebrew): `brew install just`
- Linux (Cargo): `cargo install just`
- Windows (Chocolatey): `choco install just`
- Windows (Scoop): `scoop install just`

## Quick start
From the repository root:

```shell
just --list
```

## Key recipes
- `just pixi-tasks`
- `just test`
- `just build`
- `just examples`
- `just run <task>`
161 changes: 0 additions & 161 deletions docs/MOJO_1_0_MIGRATION_BLOG.md

This file was deleted.

4 changes: 2 additions & 2 deletions docs/RECIPE_VALIDATION.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ tests:

## Integration with Your Workflow

### Pre-commit Hook
### Prek Hook

Add to `.pre-commit-config.yaml`:

Expand All @@ -130,7 +130,7 @@ repos:
pass_filenames: false
```

Then install: `pre-commit install`
Then install: `prek install -f`

### Just Recipe

Expand Down
16 changes: 8 additions & 8 deletions docs/SUBMITTING_TO_MODULAR_COMMUNITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ about:

1. Add validation script: [`scripts/validate-recipe.sh`](../scripts/validate-recipe.sh)
2. Add GitHub Actions: [`.github/workflows/validate-recipe.yml`](../.github/workflows/validate-recipe.yml)
3. Add to pre-commit:
3. Add to prek:
```yaml
- repo: local
hooks:
Expand Down Expand Up @@ -545,26 +545,26 @@ requirements:

**When to update:** When new stable Mojo releases (check [Mojo changelog](https://docs.modular.com/mojo/changelog/))

### ✅ Pre-commit Hygiene
### ✅ Prek hygiene

**Issue:** Trailing whitespace, incorrect line endings cause CI failures.

**Solution:** Install and run pre-commit in your package repos.
**Solution:** Install and run prek in your package repos.

**Setup:**
```bash
cd your-package-repo
pixi run bash -c "pre-commit install"
pixi run bash -c "pre-commit run --all-files"
pixi run bash -c "prek install -f"
pixi run bash -c "prek run --all-files"
```

**Common fixes pre-commit catches:**
**Common fixes prek catches:**
- Trailing whitespace
- Missing final newlines
- YAML/TOML syntax errors
- Mixed line endings

**Automate:** Pre-commit runs on every `git commit` once installed.
**Automate:** Prek runs on every `git commit` once installed.

### ✅ Git Tag Management

Expand Down Expand Up @@ -660,7 +660,7 @@ Use this checklist before creating your PR:
**Your Package Repo:**
- [ ] Git tag exists and pushed (e.g., `v0.9.1`)
- [ ] CodeQL enabled with badge in README
- [ ] Pre-commit hooks installed and passing
- [ ] Prek hooks installed and passing
- [ ] Tests pass locally
- [ ] LICENSE file exists
- [ ] Package image created (512×512 PNG)
Expand Down
6 changes: 3 additions & 3 deletions docs/pixi-pre-submit.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ Individual `test-*` tasks may exist for focused development, but `test-all` is t

### Code quality

- `pre-commit` – runs all pre-commit hooks for this repository.
- `pre-commit-install` – installs the git hooks for local development.
- `prek` – runs all prek hooks for this repository.
- `prek-install` – installs git hook shims for local development.

### Pre-submit for modular-community

Expand All @@ -59,7 +59,7 @@ The shared core dependencies across the `mojo-*` libraries are:

- `mojo` – the Modular toolchain (`==1.0.0b1`).
- `python` – used for the test runner, benchmarks, and pre-submit tooling (`">=3.11,<4"`).
- `pre-commit` – for local code quality checks (`">=4.5.1,<5"`).
- `prek` – for local code quality checks (`">=0.4.5,<1"`).
- `rattler-build` – for building conda packages (`">=0.55.1,<0.56"`).

Each repository may add extra dependencies (for example benchmark counterparts such as `asciichartpy`, `python-dotenv`, `pyyaml`, or `tomli-w`) but the core tooling above is consistent.
Expand Down
Loading
Loading