Skip to content

Commit ac60fd3

Browse files
authored
Merge pull request #188 from pjreiniger/run_update_yaml
Grab `update-yaml` changes from main branch
2 parents 90bc263 + b96e221 commit ac60fd3

File tree

288 files changed

+219
-1016
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

288 files changed

+219
-1016
lines changed

.github/workflows/dist.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,10 @@ jobs:
216216
run: |
217217
python -m devtools ci scan-headers
218218
219+
- name: Ensure YAML files are up to date
220+
run: |
221+
python -m devtools ci update-yaml
222+
219223
- uses: actions/upload-artifact@v4
220224
with:
221225
name: "pypi-meson-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python_version }}"

devtools/ci.py

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,3 +152,22 @@ def scan_headers(ctx: Context):
152152

153153
if not ok:
154154
sys.exit(1)
155+
156+
157+
@ci.command()
158+
@click.pass_obj
159+
def update_yaml(ctx: Context):
160+
"""Run update-yaml on all projects"""
161+
failed_subprojects = 0
162+
for project in ctx.subprojects.values():
163+
if project.is_semiwrap_project():
164+
if not project.cfg.ci_update_yaml:
165+
print("- Skipping", project.name, file=sys.stderr)
166+
continue
167+
168+
if not project.update_yaml():
169+
failed_subprojects += 1
170+
171+
if failed_subprojects != 0:
172+
print(f"update-yaml has failed for {failed_subprojects} project(s)")
173+
sys.exit(1)

devtools/config.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class SubprojectConfig:
1616
#: Whether `ci scan-headers` should include this project
1717
ci_scan_headers: bool = True
1818

19+
ci_update_yaml: bool = True
20+
1921

2022
@dataclasses.dataclass
2123
class Parameters:

devtools/subproject.py

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,19 @@ def scan_headers(self):
6161
)
6262
return result.returncode == 0
6363

64+
def update_yaml(self):
65+
"""Resyncs the yaml files with their header files"""
66+
result = run_cmd(
67+
sys.executable,
68+
"-m",
69+
"semiwrap",
70+
"update-yaml",
71+
"--write",
72+
cwd=self.path,
73+
check=False,
74+
)
75+
return result.returncode == 0
76+
6477
def update_init(self):
6578
run_cmd(
6679
sys.executable,

rdev.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ exclude_artifacts = [
3434
robot_wheel_platform = "linux-systemcore"
3535

3636
[params.requirements]
37-
semiwrap = "~=0.1.4"
37+
semiwrap = "~=0.1.7"
3838
hatch-meson = "~=0.1.0b2"
3939
hatch-nativelib = "~=0.2.0"
4040
hatch-robotpy = "~=0.2.1"
@@ -111,6 +111,7 @@ robot = true
111111
# practicality over purity - this is because we use a static
112112
# library that only exists at build time
113113
ci_scan_headers = false
114+
ci_update_yaml = false
114115

115116
[subprojects."robotpy-apriltag"]
116117
py_version = "wrapper"

subprojects/pyntcore/pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[build-system]
22
build-backend = "hatchling.build"
33
requires = [
4-
"semiwrap~=0.1.4",
4+
"semiwrap~=0.1.7",
55
"hatch-meson~=0.1.0b2",
66
"hatch-robotpy~=0.2.1",
77
"hatchling",

subprojects/pyntcore/semiwrap/BooleanArrayTopic.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
classes:
32
nt::BooleanArraySubscriber:
43
methods:

subprojects/pyntcore/semiwrap/BooleanTopic.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
classes:
32
nt::BooleanSubscriber:
43
methods:

subprojects/pyntcore/semiwrap/DoubleArrayTopic.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
classes:
32
nt::DoubleArraySubscriber:
43
methods:

subprojects/pyntcore/semiwrap/DoubleTopic.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
classes:
32
nt::DoubleSubscriber:
43
methods:

0 commit comments

Comments
 (0)