← 输入框|github.com|刷新
Skip to content
Open
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
50 changes: 29 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,35 +10,43 @@ Also see the [main RLBot wiki](https://wiki.rlbot.org/) (make sure to avoid info

## Dev setup

The following is how to setup a development environment for this project, NOT how to create a bot using this interface!

- Ensure Python 3.11+ is installed
- Create a virtual Python environment
- `python3 -m venv venv`
- Activate the virtual environment
- Windows: `venv\Scripts\activate.bat`
- Linux: `source venv/bin/activate`
- Install the package
- `pip install --editable .`
- This will install the package in editable mode,
meaning you can make changes to the code, and they
will be reflected in the installed package without
having to run the command again
- If you are making changes involving the flatbuffer schema and
The following is how to set up a development environment for this project, not how to create a bot using this interface.

- Ensure Python 3.11+ is installed.
- Install [uv](https://docs.astral.sh/uv/).
- Create the environment and install the package with development dependencies:
- `uv sync --dev`
- Activate the virtual environment when needed:
- Windows: `.venv\Scripts\activate`
- Linux: `source .venv/bin/activate`
- Run commands without activating the environment with `uv run`.
- If you are making changes involving the FlatBuffer schema and
[flatbuffers_python](https://github.com/RLBot/flatbuffers-python),
also install your local copy of that package in editable mode:
- `pip uninstall rlbot_flatbuffers`
- `pip install --editable <path/to/rlbot_flatbuffers>`
- `uv pip uninstall rlbot_flatbuffers`
- `uv pip install --editable <path/to/rlbot_flatbuffers>`

This project is formatted using [Ruff](https://docs.astral.sh/ruff/formatter/).

- Install: `pip install ruff`.
- Sort imports: `ruff check --select I --fix`
- Format code: `ruff format`
- Check code: `uv run ruff check .`
- Sort imports: `uv run ruff check --select I --fix`
- Format code: `uv run ruff format`

## Updating dependencies

Use uv to change dependencies and update the lock file.

- Add a runtime dependency: `uv add <package>`.
- Add a development dependency: `uv add --dev <package>`.
- Remove a dependency: `uv remove <package>`.
- Update one dependency: `uv lock --upgrade-package <package>`.
- Update all dependencies: `uv lock --upgrade`.
- Install the locked dependencies: `uv sync --dev`.

## Testing

- You can test launching a match with `python tests/runner.py`
- Run all pytest tests with `uv run pytest`.
- Test launching a match with `uv run python tests/runner.py`.

## Building

Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Repository = "https://github.com/RLBot/python-interface"

[dependency-groups]
dev = [
"pytest>=9.1.1",
"ruff>=0.16.0",
"toml>=0.10.2",
]
Expand All @@ -27,6 +28,8 @@ build-backend = "setuptools.build_meta"

[tool.basedpyright]
typeCheckingMode = "standard"
venvPath = "."
venv = ".venv"

[tool.ruff.format]
docstring-code-format = true
Expand Down
Loading