Skip to content

Commit 02afe61

Browse files
committed
Add environment variable support for bots and scripts
Introduce the EnvironmentVariable flatbuffer table for passing custom environment variables to bot and script processes. Add the `environment` field to CustomBot and ScriptConfiguration. Migrate dev setup to `uv`, replace the monolithic `pytest.py` with structured tests, and update the serialization codegen to handle optional vector fields.
1 parent cc7a711 commit 02afe61

19 files changed

Lines changed: 1948 additions & 576 deletions

Cargo.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "rlbot_flatbuffers"
3-
version = "0.18.10"
3+
version = "0.18.11"
44
edition = "2024"
55
description = "A Python module implemented in Rust for serializing and deserializing RLBot's flatbuffers"
66
repository = "https://github.com/RLBot/flatbuffers-python"

README.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -25,23 +25,28 @@ The crate used to generate Python binds (PyO3) supports all the way back to Pyth
2525
### Dev setup
2626

2727
- Ensure Python 3.10+ is installed
28-
- Create a virtual Python environment
29-
- `python3 -m venv venv`
30-
- Activate the virtual environment
31-
- Windows: `venv\Scripts\activate.bat`
32-
- Linux: `source venv/bin/activate`
33-
- Install maturin
34-
- `pip install maturin`
35-
- Build & install for testing
36-
- `maturin develop --release`
37-
38-
To use in another Python environment, like if testing [python-interface](https://github.com/RLBot/python-interface), you can build the wheel:
39-
40-
- `maturin build --release`
28+
- Install [uv](https://docs.astral.sh/uv/) (if not already installed)
29+
- `curl -LsSf https://astral.sh/uv/install.sh | sh`
30+
- Sync the Python environment (this builds the Rust extension)
31+
- `uv sync`
32+
- If you've made changes to the Rust code and `uv sync` doesn't rebuild, force reinstall:
33+
- `uv sync --reinstall-package rlbot-flatbuffers`
34+
35+
To use in another Python environment, like if testing [python-interface](https://github.com/RLBot/python-interface), you can build a wheel:
36+
37+
- `uv run maturin build --release`
4138
- (In another environment) `pip install path/to/file.whl`
4239

4340
The exact path of the wheel will be printed by maturin, just copy+paste it.
4441

42+
### Running tests
43+
44+
Tests are written with [pytest](https://docs.pytest.org/) and live in the `tests/` directory. Run them with:
45+
46+
```sh
47+
uv run pytest
48+
```
49+
4550
### Basic usage
4651

4752
All classes and methods should have types hints readable by your IDE, removing the guesswork of common operations.

codegen/table.rs

Lines changed: 180 additions & 81 deletions
Large diffs are not rendered by default.

flatbuffers-schema

pyproject.toml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,29 @@
1-
[build-system]
2-
requires = ["maturin>=1.3,<2.0"]
3-
build-backend = "maturin"
4-
51
[project]
62
name = "rlbot_flatbuffers"
73
requires-python = ">=3.10"
84
classifiers = [
9-
"Programming Language :: Rust",
10-
"Programming Language :: Python :: Implementation :: CPython",
11-
"Programming Language :: Python :: Implementation :: PyPy",
5+
"Programming Language :: Python :: Implementation :: CPython",
6+
"Programming Language :: Python :: Implementation :: PyPy",
7+
"Programming Language :: Rust",
8+
]
9+
dynamic = ["description", "readme", "urls", "version"]
10+
11+
[dependency-groups]
12+
dev = [
13+
"numpy>=2.2.6",
14+
"pytest>=9.1.1",
1215
]
13-
dynamic = ["version", "description", "urls", "readme"]
16+
17+
[build-system]
18+
requires = ["maturin>=1.3,<2.0"]
19+
build-backend = "maturin"
1420

1521
[tool.maturin]
1622
features = ["pyo3/extension-module", "pyo3/abi3-py310"]
1723

24+
[tool.pytest.ini_options]
25+
minversion = "9.0"
26+
testpaths = ["tests"]
27+
1828
[tool.ruff.lint]
1929
ignore = ["F403", "F405"]

pytest.py

Lines changed: 0 additions & 241 deletions
This file was deleted.

0 commit comments

Comments
 (0)