Skip to content

Commit c95dfaa

Browse files
authored
Merge pull request #202 from robotpy/dev-install-prereqs
rdev: add install-prereqs command
2 parents a8599a0 + b6af6d5 commit c95dfaa

File tree

3 files changed

+32
-3
lines changed

3 files changed

+32
-3
lines changed

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,11 @@ Development environment
4242
-----------------------
4343

4444
To install all robotpy packages in [editable mode](https://packaging.python.org/en/latest/guides/distributing-packages-using-setuptools/#working-in-development-mode)
45-
run this:
45+
first run this to install dependencies:
46+
47+
./rdev.sh install-prereqs
48+
49+
Then each time you want to build everything:
4650

4751
./rdev.sh develop
4852

@@ -55,7 +59,7 @@ rebuild an individual package:
5559

5660
./rdev.sh develop NAME
5761

58-
It can be a slow process,see the [robotpy-build documentation](https://robotpy-build.readthedocs.io/en/stable/tips.html)
62+
It can be a slow process, see the [semiwrap documentation](https://semiwrap.readthedocs.io/en/stable/tips.html)
5963
for tips to make it more efficient.
6064

6165
Cross Compilation

devtools/__main__.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
from .ctx import Context
88
from . import ci
99
from . import update_pyproject
10+
from . import util
11+
1012

1113
#
1214
# Environment variables for configuring the builds
@@ -61,6 +63,29 @@ def develop(ctx: Context, package: str):
6163
project.develop()
6264

6365

66+
@main.command()
67+
@click.pass_obj
68+
def install_prereqs(ctx: Context):
69+
"""Install developer build dependencies before running develop"""
70+
71+
reqs = set()
72+
reqs.add("editables")
73+
reqs.add("numpy")
74+
reqs.add("pytest")
75+
76+
repo_deps = set()
77+
78+
for project in ctx.subprojects.values():
79+
with ctx.handle_exception(project.name):
80+
repo_deps.add(project.pyproject_name)
81+
82+
for req in project.build_requires + project.dependencies:
83+
if req.name not in repo_deps:
84+
reqs.add(req)
85+
86+
util.run_pip("install", *map(str, reqs))
87+
88+
6489
@main.command()
6590
@click.pass_obj
6691
def scan_headers(ctx: Context):

rdev.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ semiwrap = "~=0.1.7"
4646
hatch-meson = "~=0.1.0b2"
4747
hatch-nativelib = "~=0.2.0"
4848
hatch-robotpy = "~=0.2"
49-
49+
# robotpy-cli = "~=2026.0.0b1"
5050

5151
[subprojects."robotpy-native-wpiutil"]
5252
py_version = "native"

0 commit comments

Comments
 (0)