Skip to content

Commit c1f8862

Browse files
committed
Update ntcore for 2027
1 parent 98e8f6a commit c1f8862

File tree

4 files changed

+22
-39
lines changed

4 files changed

+22
-39
lines changed

subprojects/pyntcore/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ requires = [
88
"robotpy-native-ntcore==2027.0.0a1",
99
"robotpy-wpiutil==2027.0.0a1",
1010
"robotpy-wpinet==2027.0.0a1",
11+
"robotpy-wpilog==2027.0.0a1",
1112
]
1213

1314

@@ -23,6 +24,7 @@ dependencies = [
2324
"robotpy-native-ntcore==2027.0.0a1",
2425
"robotpy-wpiutil==2027.0.0a1",
2526
"robotpy-wpinet==2027.0.0a1",
27+
"robotpy-wpilog==2027.0.0a1",
2628
]
2729

2830
[project.urls]
@@ -60,7 +62,7 @@ scan_headers_ignore = [
6062
[tool.semiwrap.extension_modules."ntcore._ntcore"]
6163
name = "ntcore"
6264
wraps = ["robotpy-native-ntcore"]
63-
depends = ["wpiutil", "wpinet"]
65+
depends = ["wpiutil", "wpinet", "wpilog"]
6466

6567

6668
[tool.semiwrap.extension_modules."ntcore._ntcore".headers]

subprojects/pyntcore/semiwrap/NetworkTableInstance.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ extra_includes:
1717
- networktables/Topic.h
1818
- src/py2value.h
1919
- src/nt_instance.h
20-
- wpi/DataLog.h
20+
- wpi/datalog/DataLog.h
2121
- wpystruct.h
2222

2323
classes:
@@ -120,10 +120,10 @@ classes:
120120
StartServer:
121121
cpp_code: |
122122
[](NetworkTableInstance * self, std::string_view persist_filename, const char* listen_address,
123-
unsigned int port3, unsigned int port4) {
123+
unsigned int port) {
124124
pyntcore::onInstanceStart(self);
125125
py::gil_scoped_release release;
126-
self->StartServer(persist_filename, listen_address, port3, port4);
126+
self->StartServer(persist_filename, listen_address, port);
127127
}
128128
StopServer:
129129
StartClient3:

subprojects/pyntcore/tests/conftest.py

Lines changed: 13 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,10 @@ def _init_common(self):
7070

7171
# self._wait_init()
7272

73-
def _init_server(self, port3=23232, port4=23233):
73+
def _init_server(self, port=23232):
7474
self._init_common()
7575

76-
self.port3 = port3
77-
self.port4 = port4
76+
self.port = port
7877

7978
def _init_client(self):
8079
self._init_common()
@@ -122,23 +121,18 @@ def expect_changes(self, count):
122121
@pytest.fixture()
123122
def nt_server(request, cfg_logging):
124123
class NtServer(NtTestBase):
125-
_test_saved_port3 = None
126-
_test_saved_port4 = None
124+
_test_saved_port = None
127125

128126
def start_test(self):
129127
logger.info("NtServer::start_test")
130128

131129
# Restore server port on restart
132-
if self._test_saved_port3 is not None:
133-
self.port3 = self._test_saved_port3
134-
self.port4 = self._test_saved_port4
130+
if self._test_saved_port is not None:
131+
self.port = self._test_saved_port
135132

136-
self._impl.startServer(
137-
listen_address="127.0.0.1", port3=self.port3, port4=self.port4
138-
)
133+
self._impl.startServer(listen_address="127.0.0.1", port=self.port)
139134

140-
self._test_saved_port3 = self.port3
141-
self._test_saved_port4 = self.port4
135+
self._test_saved_port = self.port
142136

143137
server = NtServer()
144138
server._init_server()
@@ -149,26 +143,11 @@ def start_test(self):
149143

150144

151145
@pytest.fixture()
152-
def nt_client3(request, nt_server):
146+
def nt_client(request, nt_server):
153147
class NtClient(NtTestBase):
154148
def start_test(self):
155-
self._impl.startClient3("C3")
156-
self._impl.setServer("127.0.0.1", nt_server.port3)
157-
158-
client = NtClient()
159-
client._init_client()
160-
try:
161-
yield client
162-
finally:
163-
client.shutdown()
164-
165-
166-
@pytest.fixture()
167-
def nt_client4(request, nt_server):
168-
class NtClient(NtTestBase):
169-
def start_test(self):
170-
self._impl.startClient4("C4")
171-
self._impl.setServer("127.0.0.1", nt_server.port4)
149+
self._impl.startClient("C4")
150+
self._impl.setServer("127.0.0.1", nt_server.port)
172151

173152
client = NtClient()
174153
client._init_client()
@@ -177,10 +156,10 @@ def start_test(self):
177156

178157

179158
@pytest.fixture
180-
def nt_live(nt_server, nt_client4):
159+
def nt_live(nt_server, nt_client):
181160
"""This fixture automatically starts the client and server"""
182161

183162
nt_server.start_test()
184-
nt_client4.start_test()
163+
nt_client.start_test()
185164

186-
return nt_server, nt_client4
165+
return nt_server, nt_client

subprojects/robotpy-native-ntcore/pyproject.toml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ requires = [
66
"hatch-robotpy~=0.2",
77
"robotpy-native-wpiutil==2027.0.0a1",
88
"robotpy-native-wpinet==2027.0.0a1",
9+
"robotpy-native-datalog==2027.0.0a1",
910
]
1011

1112
[project]
@@ -17,6 +18,7 @@ license = "BSD-3-Clause"
1718
dependencies = [
1819
"robotpy-native-wpiutil==2027.0.0a1",
1920
"robotpy-native-wpinet==2027.0.0a1",
21+
"robotpy-native-datalog==2027.0.0a1",
2022
]
2123

2224
[tool.hatch.build.targets.wheel]
@@ -38,4 +40,4 @@ name = "ntcore"
3840
includedir = "src/native/ntcore/include"
3941
libdir = "src/native/ntcore/lib"
4042
shared_libraries = ["ntcore"]
41-
requires = ["robotpy-native-wpinet", "robotpy-native-wpiutil"]
43+
requires = ["robotpy-native-datalog", "robotpy-native-wpinet", "robotpy-native-wpiutil"]

0 commit comments

Comments
 (0)