Skip to content
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
The table of contents is too big for display.
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-roborio"

[params.requirements]
semiwrap = "~=0.1.4"
semiwrap = "~=0.1.7"
hatch-meson = "~=0.1.0b2"
hatch-nativelib = "~=0.2.0"
hatch-robotpy = "~=0.2"
Expand Down Expand Up @@ -103,6 +103,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",
"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
19 changes: 0 additions & 19 deletions subprojects/pyntcore/semiwrap/ConnectionListener.yml

This file was deleted.

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
2 changes: 0 additions & 2 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 Down Expand Up @@ -170,7 +169,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
40 changes: 0 additions & 40 deletions subprojects/pyntcore/semiwrap/TopicListener.yml

This file was deleted.

60 changes: 0 additions & 60 deletions subprojects/pyntcore/semiwrap/ValueListener.yml

This file was deleted.

Loading
Loading