Skip to content

Commit 3dc1c55

Browse files
committed
Update pyntcore to semiwrap
1 parent 1c8af90 commit 3dc1c55

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+261
-270
lines changed

subprojects/pyntcore/.gitignore

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,8 @@ __pycache__
1010
/build
1111
/dist
1212

13-
/ntcore/include
1413
/ntcore/lib
15-
/ntcore/_init_ntcore.py
16-
/ntcore/pkgcfg.py
14+
/ntcore/_init__ntcore.py
15+
/ntcore/ntcore.pc
1716
/ntcore/version.py
18-
/ntcore/py.typed
19-
/ntcore/rpy-include
17+
/ntcore/trampolines

subprojects/pyntcore/meson.build

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
project('pyntcore', ['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+
ntcore_sources += files(
8+
'ntcore/src/ntcore.cpp',
9+
'ntcore/src/nt_instance.cpp',
10+
'ntcore/src/py2value.cpp',
11+
'ntcore/src/pyentry.cpp',
12+
)
13+
14+
subdir('semiwrap/modules')

subprojects/pyntcore/ntcore/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
from . import _init_ntcore
1+
from . import _init__ntcore
22

3-
# autogenerated by 'robotpy-build create-imports ntcore ntcore._ntcore'
3+
# autogenerated by 'semiwrap create-imports ntcore ntcore._ntcore'
44
from ._ntcore import (
55
BooleanArrayEntry,
66
BooleanArrayPublisher,

subprojects/pyntcore/ntcore/meta/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# autogenerated by 'robotpy-build create-imports ntcore.meta ntcore._ntcore.meta'
1+
# autogenerated by 'semiwrap create-imports ntcore.meta ntcore._ntcore.meta'
22
from .._ntcore.meta import (
33
Client,
44
ClientPublisher,

subprojects/pyntcore/ntcore/py.typed

Whitespace-only changes.

subprojects/pyntcore/ntcore/src/nt_instance.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <robotpy_build.h>
1+
#include <semiwrap.h>
22
#include "nt_instance.h"
33
#include "ntcore_cpp.h"
44

subprojects/pyntcore/ntcore/src/ntcore.cpp

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

2-
#include <rpygen_wrapper.hpp>
2+
#include <semiwrap_init.ntcore._ntcore.hpp>
33
#include "nt_instance.h"
44

5-
RPYBUILD_PYBIND11_MODULE(m) {
5+
SEMIWRAP_PYBIND11_MODULE(m) {
66
initWrapper(m);
77

88
static int unused;

subprojects/pyntcore/ntcore/src/py2value.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
#include <robotpy_build.h>
2+
#include <semiwrap.h>
33
#include <networktables/NetworkTableValue.h>
44
#include <networktables/NetworkTableType.h>
55
#include <fmt/format.h>

subprojects/pyntcore/ntcore/src/pyentry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
#include <robotpy_build.h>
2+
#include <semiwrap.h>
33
#include <networktables/NetworkTableEntry.h>
44
#include <networktables/NetworkTableValue.h>
55

subprojects/pyntcore/pyproject.toml

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,46 @@
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-native-ntcore==2025.3.2",
9+
"robotpy-wpiutil==2025.3.2.2",
10+
"robotpy-wpinet==2025.3.2.2",
11+
]
12+
13+
14+
[project]
215
name = "pyntcore"
16+
version = "2025.3.2.2"
317
description = "Binary wrappers for the FRC ntcore library"
4-
author = "RobotPy Development Team"
5-
author_email = "[email protected]"
6-
url = "https://github.com/robotpy/pyntcore"
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-wpinet==THIS_VERSION",
22+
dependencies = [
23+
"robotpy-native-ntcore==2025.3.2",
24+
"robotpy-wpiutil==2025.3.2.2",
25+
"robotpy-wpinet==2025.3.2.2",
1126
]
1227

13-
[build-system]
14-
requires = [
15-
"robotpy-build~=2025.1.0",
16-
"robotpy-wpiutil~=2025.3.2",
17-
"robotpy-wpinet~=2025.3.2",
18-
]
28+
[project.urls]
29+
"Source code" = "https://github.com/robotpy/mostrobotpy"
30+
31+
32+
[tool.hatch.build.hooks.robotpy]
33+
version_file = "ntcore/version.py"
1934

20-
[tool.robotpy-build]
21-
base_package = "ntcore"
35+
[tool.hatch.build.hooks.semiwrap]
36+
37+
[tool.hatch.build.hooks.meson]
38+
39+
[tool.hatch.build.targets.wheel]
40+
packages = ["ntcore"]
41+
42+
43+
[tool.semiwrap]
2244
update_init = [
2345
"ntcore",
2446
"ntcore.meta ntcore._ntcore.meta"
@@ -31,29 +53,17 @@ scan_headers_ignore = [
3153
"ntcore_c.h",
3254
"ntcore_c_types.h",
3355
"ntcore_test.h",
34-
]
3556

36-
[tool.robotpy-build.wrappers."ntcore".maven_lib_download]
37-
artifact_id = "ntcore-cpp"
38-
group_id = "edu.wpi.first.ntcore"
39-
repo_url = "https://frcmaven.wpi.edu/artifactory/release"
40-
version = "2025.3.2"
41-
42-
libs = ["ntcore"]
43-
44-
[tool.robotpy-build.wrappers."ntcore"]
45-
name = "ntcore"
46-
sources = [
47-
"ntcore/src/ntcore.cpp",
48-
"ntcore/src/nt_instance.cpp",
49-
"ntcore/src/py2value.cpp",
50-
"ntcore/src/pyentry.cpp",
57+
"src/*",
5158
]
5259

60+
[tool.semiwrap.extension_modules."ntcore._ntcore"]
61+
name = "ntcore"
62+
wraps = ["robotpy-native-ntcore"]
5363
depends = ["wpiutil", "wpinet"]
54-
generation_data = "gen"
5564

56-
[tool.robotpy-build.wrappers."ntcore".autogen_headers]
65+
66+
[tool.semiwrap.extension_modules."ntcore._ntcore".headers]
5767
# networktables
5868
BooleanArrayTopic = "networktables/BooleanArrayTopic.h"
5969
BooleanTopic = "networktables/BooleanTopic.h"

0 commit comments

Comments
 (0)