diff --git a/README.md b/README.md index 06536a47..4c19db9a 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,11 @@ Development environment ----------------------- To install all robotpy packages in [editable mode](https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#working-in-development-mode) -run this: +first run this to install dependencies: + + ./rdev.sh install-prereqs + +Then each time you want to build everything: ./rdev.sh develop @@ -55,7 +59,7 @@ rebuild an individual package: ./rdev.sh develop NAME -It can be a slow process,see the [robotpy-build documentation](https://robotpy-build.readthedocs.io/en/stable/tips.html) +It can be a slow process, see the [semiwrap documentation](https://semiwrap.readthedocs.io/en/stable/tips.html) for tips to make it more efficient. Cross Compilation diff --git a/devtools/__main__.py b/devtools/__main__.py index bbf2fc1d..36af5d68 100644 --- a/devtools/__main__.py +++ b/devtools/__main__.py @@ -7,6 +7,8 @@ from .ctx import Context from . import ci from . import update_pyproject +from . import util + # # Environment variables for configuring the builds @@ -61,6 +63,29 @@ def develop(ctx: Context, package: str): project.develop() +@main.command() +@click.pass_obj +def install_prereqs(ctx: Context): + """Install developer build dependencies before running develop""" + + reqs = set() + reqs.add("editables") + reqs.add("numpy") + reqs.add("pytest") + + repo_deps = set() + + for project in ctx.subprojects.values(): + with ctx.handle_exception(project.name): + repo_deps.add(project.pyproject_name) + + for req in project.build_requires + project.dependencies: + if req.name not in repo_deps: + reqs.add(req) + + util.run_pip("install", *map(str, reqs)) + + @main.command() @click.pass_obj def scan_headers(ctx: Context): diff --git a/rdev.toml b/rdev.toml index 8100aef7..a20ce1ba 100644 --- a/rdev.toml +++ b/rdev.toml @@ -46,7 +46,7 @@ semiwrap = "~=0.1.7" hatch-meson = "~=0.1.0b2" hatch-nativelib = "~=0.2.0" hatch-robotpy = "~=0.2" - +# robotpy-cli = "~=2026.0.0b1" [subprojects."robotpy-native-wpiutil"] py_version = "native"