Skip to content

Grab update-yaml changes from main branch #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

Merged
merged 9 commits into from
Aug 19, 2025
Merged
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
4 changes: 4 additions & 0 deletions .github/workflows/dist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,10 @@ jobs:
run: |
python -m devtools ci scan-headers

- name: Ensure YAML files are up to date
run: |
python -m devtools ci update-yaml

- uses: actions/upload-artifact@v4
with:
name: "pypi-meson-${{ runner.os }}-${{ runner.arch }}-${{ matrix.python_version }}"
Expand Down
19 changes: 19 additions & 0 deletions devtools/ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,3 +152,22 @@ 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"""
failed_subprojects = 0
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

if not project.update_yaml():
failed_subprojects += 1

if failed_subprojects != 0:
print(f"update-yaml has failed for {failed_subprojects} project(s)")
sys.exit(1)
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
13 changes: 13 additions & 0 deletions devtools/subproject.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ def scan_headers(self):
)
return result.returncode == 0

def update_yaml(self):
"""Resyncs the yaml files with their header files"""
result = run_cmd(
sys.executable,
"-m",
"semiwrap",
"update-yaml",
"--write",
cwd=self.path,
check=False,
)
return result.returncode == 0

def update_init(self):
run_cmd(
sys.executable,
Expand Down
3 changes: 2 additions & 1 deletion rdev.toml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ exclude_artifacts = [
robot_wheel_platform = "linux-systemcore"

[params.requirements]
semiwrap = "~=0.1.4"
semiwrap = "~=0.1.7"
hatch-meson = "~=0.1.0b2"
hatch-nativelib = "~=0.2.0"
hatch-robotpy = "~=0.2.1"
Expand Down 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
2 changes: 1 addition & 1 deletion subprojects/pyntcore/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"semiwrap~=0.1.4",
"semiwrap~=0.1.7",
"hatch-meson~=0.1.0b2",
"hatch-robotpy~=0.2.1",
"hatchling",
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,6 @@ 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);
}
StopClient:
SetServer:
overloads:
Expand Down Expand Up @@ -170,7 +154,7 @@ classes:
AddStructSchema:
ignore: true
operator==:
operator!=:
StartClient:
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
8 changes: 0 additions & 8 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 @@ -58,8 +55,6 @@ classes:
ignore: true
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
2 changes: 1 addition & 1 deletion subprojects/robotpy-apriltag/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"semiwrap~=0.1.4",
"semiwrap~=0.1.7",
"hatch-meson~=0.1.0b2",
"hatch-robotpy~=0.2.1",
"hatchling",
Expand Down
1 change: 0 additions & 1 deletion 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 Down
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 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
Empty file.
2 changes: 1 addition & 1 deletion subprojects/robotpy-cscore/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"semiwrap~=0.1.4",
"semiwrap~=0.1.7",
"hatch-meson~=0.1.0b2",
"hatch-robotpy~=0.2.1",
"hatchling",
Expand Down
2 changes: 1 addition & 1 deletion subprojects/robotpy-hal/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[build-system]
build-backend = "hatchling.build"
requires = [
"semiwrap~=0.1.4",
"semiwrap~=0.1.7",
"hatch-meson~=0.1.0b2",
"hatchling",
"pyntcore==2027.0.0a2",
Expand Down
Loading
Loading