Skip to content

Commit 1237fa1

Browse files
committed
Update robotpy-wpimath test project to semiwrap
1 parent 3199617 commit 1237fa1

File tree

9 files changed

+43
-37
lines changed

9 files changed

+43
-37
lines changed

subprojects/robotpy-wpimath/tests/cpp/.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
*.so
33
*.dylib
44

5-
/wpimath_test/pkgcfg.py
6-
/wpimath_test/py.typed
7-
/wpimath_test/_init_wpimath_test.py
8-
/wpimath_test/rpy-include
9-
/wpimath_test/_wpimath_test
5+
/wpimath_test/wpimath_test.pc
6+
/wpimath_test/_init__wpimath_test.py
7+
/wpimath_test/trampolines
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
project('wpimath-test', ['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+
wpimath_test_sources += files(
8+
'wpimath_test/src/module.cpp',
9+
)
10+
11+
subdir('semiwrap/modules')
Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,27 @@
11
[build-system]
2-
requires = ["robotpy-build"]
3-
4-
[tool.robotpy-build]
5-
base_package = "wpimath_test"
2+
build-backend = "hatchling.build"
3+
requires = [
4+
"semiwrap", "hatch-meson", "hatchling",
5+
]
66

7-
[tool.robotpy-build.wrappers."wpimath_test"]
7+
[project]
88
name = "wpimath_test"
9-
depends = ["wpimath_cpp"]
10-
sources = [
11-
"wpimath_test/src/module.cpp",
9+
version = "0.1"
10+
description = "Test project for verifying robotpy-build behavior"
11+
authors = [
12+
{name = "RobotPy Development Team", email = "[email protected]"},
1213
]
13-
generation_data = "gen"
14+
license = "BSD-3-Clause"
1415

15-
[tool.robotpy-build.wrappers."wpimath_test".autogen_headers]
16-
module = "module.h"
16+
[tool.hatch.build.hooks.semiwrap]
17+
[tool.hatch.build.hooks.meson]
1718

18-
[tool.robotpy-build.metadata]
19+
[tool.semiwrap]
20+
21+
[tool.semiwrap.extension_modules."wpimath_test._wpimath_test"]
1922
name = "wpimath_test"
20-
description = "Test project for verifying robotpy-build behavior"
21-
author = "RobotPy Development Team"
22-
author_email = "[email protected]"
23-
license = "BSD-3-Clause"
24-
install_requires = []
25-
url = ""
23+
depends = ["wpimath"]
24+
includes = ["wpimath_test/include"]
25+
26+
[tool.semiwrap.extension_modules."wpimath_test._wpimath_test".headers]
27+
module = "module.h"
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-wpimath/tests/cpp/setup.py

Lines changed: 0 additions & 5 deletions
This file was deleted.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
from . import _init_wpimath_test
1+
from . import _init__wpimath_test
22

33
# autogenerated by 'robotpy-build create-imports wpimath_test'
44
from ._wpimath_test import SomeClass
55

66
__all__ = ["SomeClass"]
77

8-
del _init_wpimath_test
8+
del _init__wpimath_test

subprojects/robotpy-wpimath/tests/cpp/wpimath_test/src/module.cpp

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

2-
#include "rpygen_wrapper.hpp"
2+
#include "semiwrap_init.wpimath_test._wpimath_test.hpp"
33
#include <module.h>
44
#include <stdexcept>
55

6-
RPYBUILD_PYBIND11_MODULE(m)
6+
SEMIWRAP_PYBIND11_MODULE(m)
77
{
88
initWrapper(m);
99
}

subprojects/robotpy-wpimath/tests/run_tests.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,18 @@
99
root = abspath(dirname(__file__))
1010
os.chdir(root)
1111

12-
env = os.environ.copy()
13-
env["SETUPTOOLS_SCM_PRETEND_VERSION"] = "0.0.1"
14-
1512
subprocess.check_call(
1613
[
1714
sys.executable,
1815
"-m",
1916
"pip",
2017
"--disable-pip-version-check",
2118
"install",
19+
"-v",
2220
"--force-reinstall",
2321
"--no-build-isolation",
2422
"./cpp",
25-
],
26-
env=env,
23+
]
2724
)
2825

2926
subprocess.check_call([sys.executable, "-m", "pytest", "--ignore=cpp"])

0 commit comments

Comments
 (0)