Skip to content

Commit 7317311

Browse files
committed
Update robotpy-halsim-gui to semiwrap
1 parent 34ab1c3 commit 7317311

File tree

9 files changed

+86
-51
lines changed

9 files changed

+86
-51
lines changed

subprojects/robotpy-halsim-gui/.gitignore

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,9 @@
1212
/dist
1313
*.egg-info
1414

15-
/halsim_gui/_init_halsim_gui.py
16-
/halsim_gui/pkgcfg.py
1715
/halsim_gui/version.py
18-
/halsim_gui/include
1916
/halsim_gui/lib
17+
/halsim_gui/include
2018

21-
/halsim_gui/_ext/_halsim_gui_ext
22-
/halsim_gui/_ext/_init_halsim_gui_ext.py
23-
/halsim_gui/_ext/pkgcfg.py
24-
/halsim_gui/py.typed
19+
/halsim_gui/_ext/_init__halsim_gui_ext.py
20+
/halsim_gui/_ext/halsim_gui_ext.pc
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
from . import _init_halsim_gui_ext
1+
from . import _init__halsim_gui_ext

subprojects/robotpy-halsim-gui/halsim_gui/_ext/main.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11

2-
#include <robotpy_build.h>
2+
#include <semiwrap_init.halsim_gui._ext._halsim_gui_ext.hpp>
33

44
#include <HALSimGuiExt.h>
55
#include <hal/Extensions.h>
66

7-
RPYBUILD_PYBIND11_MODULE(m) {
7+
SEMIWRAP_PYBIND11_MODULE(m) {
8+
9+
initWrapper(m);
810

911
m.def("_kill_on_signal", []() {
1012
HAL_RegisterExtensionListener(

subprojects/robotpy-halsim-gui/halsim_gui/py.typed

Whitespace-only changes.
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
project('halsim-gui', ['cpp'],
2+
default_options: ['warning_level=1', 'cpp_std=c++20',
3+
'b_colorout=auto', 'optimization=2', 'b_pie=true'])
4+
5+
subdir('semiwrap')
6+
7+
halsim_gui_ext_sources += files(
8+
'halsim_gui/_ext/main.cpp',
9+
)
10+
halsim_gui_ext_deps += [
11+
declare_dependency(
12+
include_directories: ['halsim_gui/include']
13+
)
14+
]
15+
16+
subdir('semiwrap/modules')
Lines changed: 42 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,57 @@
1-
[tool.robotpy-build.metadata]
1+
[build-system]
2+
build-backend = "hatchling.build"
3+
requires = [
4+
"semiwrap~=0.1",
5+
"hatch-meson~=0.1.0b2",
6+
"hatch-robotpy~=0.2",
7+
"hatchling",
8+
"robotpy-wpiutil==2025.3.2.2",
9+
"robotpy-wpimath==2025.3.2.2",
10+
"robotpy-hal==2025.3.2.2",
11+
"pyntcore==2025.3.2.2",
12+
]
13+
14+
[project]
215
name = "robotpy-halsim-gui"
3-
description = "WPILib command framework"
4-
author = "RobotPy Development Team"
5-
author_email = "[email protected]"
6-
url = "https://github.com/robotpy/robotpy-halsim-gui"
16+
version = "2025.3.2.2"
17+
description = "WPILib simulation GUI"
18+
authors = [
19+
{name = "RobotPy Development Team", email = "[email protected]"},
20+
]
721
license = "BSD-3-Clause"
8-
install_requires = [
9-
"robotpy-wpiutil==THIS_VERSION",
10-
"robotpy-wpimath==THIS_VERSION",
11-
"robotpy-hal==THIS_VERSION",
12-
"pyntcore==THIS_VERSION",
22+
dependencies = [
23+
"robotpy-wpiutil==2025.3.2.2",
24+
"robotpy-wpimath==2025.3.2.2",
25+
"robotpy-hal==2025.3.2.2",
26+
"pyntcore==2025.3.2.2",
1327
]
1428

15-
[build-system]
16-
requires = [
17-
"robotpy-build~=2025.1.0",
18-
"robotpy-wpiutil~=2025.3.2",
19-
"robotpy-wpimath~=2025.3.2",
20-
"robotpy-hal~=2025.3.2",
21-
"pyntcore~=2025.3.2",
22-
]
29+
[project.urls]
30+
"Source code" = "https://github.com/robotpy/mostrobotpy"
2331

24-
[tool.robotpy-build]
25-
base_package = "halsim_gui"
2632

33+
[tool.hatch.build.hooks.robotpy]
34+
version_file = "halsim_gui/version.py"
2735

28-
[tool.robotpy-build.wrappers."halsim_gui".maven_lib_download]
36+
[[tool.hatch.build.hooks.robotpy.maven_lib_download]]
2937
artifact_id = "halsim_gui"
3038
group_id = "edu.wpi.first.halsim"
31-
# repo_url = "https://frcmaven.wpi.edu/artifactory/release"
3239
repo_url = "https://frcmaven.wpi.edu/artifactory/release"
3340
version = "2025.3.2"
41+
use_headers = true
42+
43+
libs = ["halsim_gui"]
44+
extract_to = "halsim_gui"
3445

35-
dlopenlibs = ["halsim_gui"]
46+
[tool.hatch.build.hooks.semiwrap]
3647

37-
# TODO: make this a namespace package?
38-
[tool.robotpy-build.wrappers."halsim_gui"]
39-
name = "halsim_gui"
40-
depends = ["wpiutil", "wpiHal", "ntcore", "wpimath_cpp"]
48+
[tool.hatch.build.hooks.meson]
4149

42-
[tool.robotpy-build.wrappers."halsim_gui._ext"]
50+
[tool.hatch.build.targets.wheel]
51+
packages = ["halsim_gui"]
52+
53+
54+
[tool.semiwrap]
55+
[tool.semiwrap.extension_modules."halsim_gui._ext._halsim_gui_ext"]
4356
name = "halsim_gui_ext"
44-
sources = [
45-
"halsim_gui/_ext/main.cpp"
46-
]
47-
depends = ["wpiutil", "wpiHal", "ntcore", "wpimath_cpp", "halsim_gui"]
57+
depends = ["wpihal", "wpimath", "ntcore"]
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
/meson.build
2+
/modules/meson.build
3+
/trampolines/meson.build

subprojects/robotpy-halsim-gui/setup.py

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,20 @@
1-
# tests the internals
2-
import halsim_gui._init_halsim_gui
3-
import halsim_gui._ext
1+
import ctypes
2+
import pathlib
43

54

65
def test_halsim_gui():
7-
pass
6+
# dependencies
7+
import wpinet
8+
import hal
9+
import wpimath
10+
import ntcore
11+
12+
import halsim_gui as base
13+
14+
loaded = 0
15+
for fname in (pathlib.Path(base.__file__).parent / "lib").iterdir():
16+
if fname.is_file() and fname.suffix in (".dll", ".dylib", ".so"):
17+
ctypes.CDLL(str(fname))
18+
loaded += 1
19+
20+
assert loaded

0 commit comments

Comments
 (0)