mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-30 02:31:44 +00:00
[bazel][robotpy] Add mirror for robotpy's wpiuil and wpinet libraries (#8062)
Project import generated by Copybara. GitOrigin-RevId: 92ea93d1b47a82667044bd0af05f7fdb34d2c2c2
This commit is contained in:
7
wpinet/src/main/python/README.md
Normal file
7
wpinet/src/main/python/README.md
Normal file
@@ -0,0 +1,7 @@
|
||||
robotpy-wpinet
|
||||
==============
|
||||
|
||||
Python wrappers for WPILib's wpinet library.
|
||||
|
||||
* Installation instructions can be found in the [RobotPy documentation](https://robotpy.readthedocs.io/en/latest/getting_started.html)
|
||||
* Documentation can be found at [readthedocs](https://robotpy.readthedocs.io/projects/wpinet/en/stable/api.html)
|
||||
17
wpinet/src/main/python/examples/portfwd.py
Executable file
17
wpinet/src/main/python/examples/portfwd.py
Executable file
@@ -0,0 +1,17 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import argparse
|
||||
import time
|
||||
import wpinet
|
||||
|
||||
if __name__ == "__main__":
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("port", type=int, help="Local port number")
|
||||
parser.add_argument("remoteHost", help="Remote IP address / DNS name")
|
||||
parser.add_argument("remotePort", type=int, help="remote port number")
|
||||
args = parser.parse_args()
|
||||
|
||||
wpinet.PortForwarder.getInstance().add(args.port, args.remoteHost, args.remotePort)
|
||||
|
||||
while True:
|
||||
time.sleep(1)
|
||||
39
wpinet/src/main/python/native-pyproject.toml
Normal file
39
wpinet/src/main/python/native-pyproject.toml
Normal file
@@ -0,0 +1,39 @@
|
||||
[build-system]
|
||||
build-backend = "hatchling.build"
|
||||
requires = [
|
||||
"hatchling",
|
||||
"hatch-nativelib~=0.2.0",
|
||||
"hatch-robotpy~=0.2.1",
|
||||
"robotpy-native-wpiutil==2027.0.0a2",
|
||||
]
|
||||
|
||||
[project]
|
||||
name = "robotpy-native-wpinet"
|
||||
version = "2027.0.0a2"
|
||||
description = "WPILib Networking Library"
|
||||
license = "BSD-3-Clause"
|
||||
|
||||
dependencies = [
|
||||
"robotpy-native-wpiutil==2027.0.0a2",
|
||||
]
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["src/native"]
|
||||
|
||||
[[tool.hatch.build.hooks.robotpy.maven_lib_download]]
|
||||
artifact_id = "wpinet-cpp"
|
||||
group_id = "edu.wpi.first.wpinet"
|
||||
repo_url = "https://frcmaven.wpi.edu/artifactory/release-2027"
|
||||
version = "2027.0.0-alpha-2"
|
||||
|
||||
extract_to = "src/native/wpinet"
|
||||
libs = ["wpinet"]
|
||||
|
||||
[[tool.hatch.build.hooks.nativelib.pcfile]]
|
||||
pcfile = "src/native/wpinet/robotpy-native-wpinet.pc"
|
||||
name = "wpinet"
|
||||
|
||||
includedir = "src/native/wpinet/include"
|
||||
libdir = "src/native/wpinet/lib"
|
||||
shared_libraries = ["wpinet"]
|
||||
requires = ["robotpy-native-wpiutil"]
|
||||
54
wpinet/src/main/python/pyproject.toml
Normal file
54
wpinet/src/main/python/pyproject.toml
Normal file
@@ -0,0 +1,54 @@
|
||||
[build-system]
|
||||
build-backend = "hatchling.build"
|
||||
requires = [
|
||||
"semiwrap~=0.1.7",
|
||||
"hatch-meson~=0.1.0b2",
|
||||
"hatchling",
|
||||
"robotpy-native-wpinet==2027.0.0a2",
|
||||
"robotpy-wpiutil==2027.0.0a2"
|
||||
]
|
||||
|
||||
[project]
|
||||
name = "robotpy-wpinet"
|
||||
version = "2027.0.0a2"
|
||||
description = "Binary wrapper for FRC wpinet library"
|
||||
authors = [
|
||||
{name = "RobotPy Development Team", email = "robotpy@googlegroups.com"},
|
||||
]
|
||||
license = "BSD-3-Clause"
|
||||
dependencies = [
|
||||
"robotpy-native-wpinet==2027.0.0a2",
|
||||
"robotpy-wpiutil==2027.0.0a2"
|
||||
]
|
||||
|
||||
[project.urls]
|
||||
"Source code" = "https://github.com/robotpy/mostrobotpy"
|
||||
|
||||
|
||||
[tool.hatch.build.hooks.robotpy]
|
||||
version_file = "wpinet/version.py"
|
||||
|
||||
[tool.hatch.build.hooks.semiwrap]
|
||||
|
||||
[tool.hatch.build.hooks.meson]
|
||||
|
||||
[tool.hatch.build.targets.wheel]
|
||||
packages = ["wpinet"]
|
||||
|
||||
|
||||
[tool.semiwrap]
|
||||
update_init = [
|
||||
"wpinet"
|
||||
]
|
||||
# we don't wrap anything here
|
||||
scan_headers_ignore = ["*"]
|
||||
|
||||
[tool.semiwrap.extension_modules."wpinet._wpinet"]
|
||||
name = "wpinet"
|
||||
wraps = ["robotpy-native-wpinet"]
|
||||
depends = ["wpiutil"]
|
||||
|
||||
[tool.semiwrap.extension_modules."wpinet._wpinet".headers]
|
||||
# wpinet
|
||||
PortForwarder = "wpinet/PortForwarder.h"
|
||||
WebServer = "wpinet/WebServer.h"
|
||||
8
wpinet/src/main/python/semiwrap/PortForwarder.yml
Normal file
8
wpinet/src/main/python/semiwrap/PortForwarder.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
classes:
|
||||
wpi::PortForwarder:
|
||||
nodelete: true
|
||||
methods:
|
||||
GetInstance:
|
||||
return_value_policy: reference
|
||||
Add:
|
||||
Remove:
|
||||
8
wpinet/src/main/python/semiwrap/WebServer.yml
Normal file
8
wpinet/src/main/python/semiwrap/WebServer.yml
Normal file
@@ -0,0 +1,8 @@
|
||||
classes:
|
||||
wpi::WebServer:
|
||||
nodelete: true
|
||||
methods:
|
||||
GetInstance:
|
||||
return_value_policy: reference
|
||||
Start:
|
||||
Stop:
|
||||
7
wpinet/src/main/python/wpinet/__init__.py
Normal file
7
wpinet/src/main/python/wpinet/__init__.py
Normal file
@@ -0,0 +1,7 @@
|
||||
from . import _init__wpinet
|
||||
|
||||
|
||||
# autogenerated by 'semiwrap create-imports wpinet wpinet._wpinet'
|
||||
from ._wpinet import PortForwarder, WebServer
|
||||
|
||||
__all__ = ["PortForwarder", "WebServer"]
|
||||
0
wpinet/src/main/python/wpinet/py.typed
Normal file
0
wpinet/src/main/python/wpinet/py.typed
Normal file
4
wpinet/src/main/python/wpinet/src/main.cpp
Normal file
4
wpinet/src/main/python/wpinet/src/main.cpp
Normal file
@@ -0,0 +1,4 @@
|
||||
|
||||
#include <semiwrap_init.wpinet._wpinet.hpp>
|
||||
|
||||
SEMIWRAP_PYBIND11_MODULE(m) { initWrapper(m); }
|
||||
12
wpinet/src/test/python/run_tests.py
Executable file
12
wpinet/src/test/python/run_tests.py
Executable file
@@ -0,0 +1,12 @@
|
||||
#!/usr/bin/env python3
|
||||
|
||||
import os
|
||||
from os.path import abspath, dirname
|
||||
import sys
|
||||
import subprocess
|
||||
|
||||
if __name__ == "__main__":
|
||||
root = abspath(dirname(__file__))
|
||||
os.chdir(root)
|
||||
|
||||
subprocess.check_call([sys.executable, "-m", "pytest"])
|
||||
5
wpinet/src/test/python/test_wpinet.py
Normal file
5
wpinet/src/test/python/test_wpinet.py
Normal file
@@ -0,0 +1,5 @@
|
||||
import wpinet
|
||||
|
||||
|
||||
def test_existance():
|
||||
pass
|
||||
Reference in New Issue
Block a user