Skip to content

Run new update-yaml script to resync yaml to headers #188

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: 2027
Choose a base branch
from
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
5 changes: 5 additions & 0 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,11 @@ jobs:
- name: Ensure all headers are accounted for
run: |
python -m devtools ci scan-headers

# TODO blocked on semiwrap release
# - name: Ensure YAML files are up to date
# run: |
# python -m devtools ci update-yaml

- uses: actions/upload-artifact@v4
with:
Expand Down
13 changes: 13 additions & 0 deletions devtools/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,16 @@ def scan_headers(ctx: Context):

if not ok:
sys.exit(1)


@ci.command()
@click.pass_obj
def update_yaml(ctx: Context):
"""Run update-yaml on all projects"""
for project in ctx.subprojects.values():
if project.is_semiwrap_project():
if not project.cfg.ci_update_yaml:
print("- Skipping", project.name, file=sys.stderr)
continue

project.update_yaml()
2 changes: 2 additions & 0 deletions devtools/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ class SubprojectConfig:
#: Whether `ci scan-headers` should include this project
ci_scan_headers: bool = True

ci_update_yaml: bool = True


@dataclasses.dataclass
class Parameters:
Expand Down
10 changes: 10 additions & 0 deletions devtools/subproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,16 @@ def scan_headers(self):
)
return result.returncode == 0

def update_yaml(self):
"""Resyncs the yaml files with their header files"""
run_cmd(
sys.executable,
"-m",
"semiwrap",
"update-yaml",
cwd=self.path,
)

def update_init(self):
run_cmd(
sys.executable,
Expand Down
1 change: 1 addition & 0 deletions rdev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@ robot = true
# practicality over purity - this is because we use a static
# library that only exists at build time
ci_scan_headers = false
ci_update_yaml = false

[subprojects."robotpy-apriltag"]
py_version = "wrapper"
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/BooleanArrayTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::BooleanArraySubscriber:
methods:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/BooleanTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::BooleanSubscriber:
methods:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/DoubleArrayTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::DoubleArraySubscriber:
methods:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/DoubleTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::DoubleSubscriber:
methods:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/FloatArrayTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::FloatArraySubscriber:
methods:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/FloatTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::FloatSubscriber:
methods:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/GenericEntry.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

extra_includes:
- src/nt_type_caster.h

Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/IntegerArrayTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::IntegerArraySubscriber:
methods:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/IntegerTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::IntegerSubscriber:
methods:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/MultiSubscriber.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::MultiSubscriber:
methods:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/NTSendableBuilder.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::NTSendableBuilder:
force_type_casters:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/NetworkTable.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

extra_includes:
- networktables/BooleanArrayTopic.h
- networktables/BooleanTopic.h
Expand Down
8 changes: 0 additions & 8 deletions subprojects/pyntcore/semiwrap/NetworkTableEntry.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ inline_code: |
#include <src/NetworkTableEntry.cpp.inl>
classes:
nt::NetworkTableEntry:
enums:
Flags:
arithmetic: true
methods:
NetworkTableEntry:
overloads:
Expand All @@ -24,7 +21,6 @@ classes:
Exists:
GetName:
GetType:
GetFlags:
GetLastChange:
GetValue:
GetBoolean:
Expand Down Expand Up @@ -89,16 +85,12 @@ classes:
SetFloatArray:
SetDoubleArray:
SetStringArray:
SetFlags:
ClearFlags:
SetPersistent:
ClearPersistent:
IsPersistent:
Unpublish:
Delete:
GetTopic:
operator==:
operator!=:
inline_code: |
.def("__repr__", [](NetworkTableEntry self) {
return py::str("<NetworkTableEntry {!r}>").format(self.GetName());
Expand Down
20 changes: 2 additions & 18 deletions subprojects/pyntcore/semiwrap/NetworkTableInstance.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

extra_includes:
- networktables/BooleanArrayTopic.h
- networktables/BooleanTopic.h
Expand All @@ -25,8 +24,7 @@ classes:
force_type_casters:
- std::function
attributes:
kDefaultPort3:
kDefaultPort4:
kDefaultPort:
enums:
NetworkMode:
arithmetic: true
Expand Down Expand Up @@ -126,20 +124,7 @@ classes:
self->StartServer(persist_filename, listen_address, port);
}
StopServer:
StartClient3:
cpp_code: |
[](NetworkTableInstance * self, std::string_view identity) {
pyntcore::onInstanceStart(self);
py::gil_scoped_release release;
self->StartClient3(identity);
}
StartClient4:
cpp_code: |
[](NetworkTableInstance * self, std::string_view identity) {
pyntcore::onInstanceStart(self);
py::gil_scoped_release release;
self->StartClient4(identity);
}
StartClient:
StopClient:
SetServer:
overloads:
Expand Down Expand Up @@ -170,7 +155,6 @@ classes:
AddStructSchema:
ignore: true
operator==:
operator!=:
inline_code: |
.def("configPythonLogging", [](NetworkTableInstance * self,
NetworkTableInstance::LogLevel minLevel, NetworkTableInstance::LogLevel maxLevel, py::str logName) {
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/NetworkTableListener.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::NetworkTableListener:
force_type_casters:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/NetworkTableType.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@

enums:
NetworkTableType:
2 changes: 0 additions & 2 deletions subprojects/pyntcore/semiwrap/NetworkTableValue.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

extra_includes:
- networktables/NetworkTableType.h
- src/py2value.h
Expand Down Expand Up @@ -171,7 +170,6 @@ classes:
std::initializer_list<std::string>, int64_t:
ignore: true
std::vector<std::string>&&, int64_t:
operator==:
inline_code: |-
.def_static("makeValue", [](py::handle value) {
return pyntcore::py2ntvalue(value);
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/RawTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

extra_includes:
- src/nt_type_caster.h

Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/StringArrayTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::StringArraySubscriber:
methods:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/StringTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::StringSubscriber:
methods:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/StructArrayTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::StructArraySubscriber:
template_params:
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/StructTopic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
nt::StructSubscriber:
template_params:
Expand Down
2 changes: 0 additions & 2 deletions subprojects/pyntcore/semiwrap/Topic.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

extra_includes:
- networktables/GenericEntry.h
- networktables/NetworkTableInstance.h
Expand Down Expand Up @@ -42,7 +41,6 @@ classes:
const PubSubOptions&:
std::string_view, const PubSubOptions&:
operator==:
operator!=:
inline_code: |
.def("__repr__", [](py::handle self) {
py::object type_name = self.get_type().attr("__qualname__");
Expand Down
14 changes: 3 additions & 11 deletions subprojects/pyntcore/semiwrap/ntcore_cpp.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

defaults:
ignore: true
report_ignored_missing: false
Expand All @@ -7,8 +6,6 @@ extra_includes:
- pybind11/stl.h
- networktables/Topic.h

attributes:
kDefaultPubSubOptions:
functions:
RemoveListener:
internal: true
Expand Down Expand Up @@ -49,17 +46,15 @@ classes:
kTimeSync:
nt::TopicInfo:
attributes:
name:
type_str:
properties:
topic:
ignore: true
name:
type:
ignore: true
type_str:
properties:
methods:
GetProperties:
swap:
ignore: true
inline_code: |
.def_property_readonly("topic", [](const TopicInfo &self) {
return std::make_shared<nt::Topic>(self.topic);
Expand All @@ -78,9 +73,6 @@ classes:
remote_port:
last_update:
protocol_version:
methods:
swap:
ignore: true
inline_code: |
.def("__repr__", [](const ConnectionInfo &self) -> py::str {
return py::str("<ConnectionInfo id={} addr={}:{} last_update={} protocol={}>")
Expand Down
1 change: 0 additions & 1 deletion subprojects/pyntcore/semiwrap/ntcore_cpp_types.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

extra_includes:
- src/nt_type_caster.h

Expand Down
3 changes: 1 addition & 2 deletions subprojects/robotpy-apriltag/semiwrap/AprilTag.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

functions:
to_json:
ignore: true
Expand All @@ -10,8 +9,8 @@ classes:
ID:
pose:
methods:
operator==:
Generate36h11AprilTagImage:
ignore: true
Generate16h5AprilTagImage:
ignore: true
operator==:
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

extra_includes:
- pybind11/eigen.h

Expand Down
3 changes: 0 additions & 3 deletions subprojects/robotpy-apriltag/semiwrap/AprilTagDetector.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

extra_includes:
- pybind11_typing.h

Expand Down Expand Up @@ -92,8 +91,6 @@ classes:
ignore: true
void*, const private_init&:
ignore: true
AprilTagDetector::Results&&:
ignore: true
inline_code: |
// use the keepalive to keep the array of results around until
// the user deletes them
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

functions:
to_json:
ignore: true
Expand All @@ -11,12 +10,12 @@ classes:
enums:
OriginPosition:
methods:
LoadField:
AprilTagFieldLayout:
overloads:
'':
std::string_view:
std::vector<AprilTag>, units::meter_t, units::meter_t:
LoadField:
GetFieldLength:
GetFieldWidth:
GetTags:
Expand Down
3 changes: 0 additions & 3 deletions subprojects/robotpy-apriltag/semiwrap/AprilTagFields.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@

enums:
AprilTagField:
functions:
LoadAprilTagLayoutField:
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

classes:
frc::AprilTagPoseEstimate:
attributes:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

extra_includes:
- frc/apriltag/AprilTagDetection.h

Expand Down
10 changes: 2 additions & 8 deletions subprojects/robotpy-hal/semiwrap/AddressableLED.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,9 @@
---

strip_prefixes:
- HAL_

functions:
HAL_InitializeAddressableLED:
HAL_FreeAddressableLED:
HAL_SetAddressableLEDOutputPort:
HAL_SetAddressableLEDStart:
HAL_SetAddressableLEDLength:
HAL_WriteAddressableLEDData:
HAL_SetAddressableLEDBitTiming:
HAL_SetAddressableLEDSyncTime:
HAL_StartAddressableLEDOutput:
HAL_StopAddressableLEDOutput:
HAL_SetAddressableLEDData:
Loading
Loading