mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[robotpy] Build examples (#8629)
This hooks up the bazel build to the robotpyExamples. It can use the (formly pyfrc or whatever) automatic unit tests for an example, as well as exposing the ability to run the example in simulation, with or without `halsim_gui` with a command such as `bazel run //robotpyExamples:AddressableLED-sim` This required building and using wheels instead of just a normal `py_library`, so that things like `ENTRY_POINTS` can be used. I took a bare bones approach to building and naming the wheels (for example the native ones don't have the OS info or python version in them, so they wouldn't be suitable publish to pypi, but that can always be updated later.
This commit is contained in:
8
wpiutil/robotpy_native_build_info.bzl
generated
8
wpiutil/robotpy_native_build_info.bzl
generated
@@ -50,4 +50,12 @@ def define_native_wrapper(name, pyproject_toml = None):
|
||||
headers = "{}.copy_headers".format(name),
|
||||
native_shared_library = "shared/wpiutil",
|
||||
install_path = "native/wpiutil/",
|
||||
strip_path_prefixes = ["wpiutil"],
|
||||
requires = ["msvc-runtime>=14.42.34433; platform_system == 'Windows'"],
|
||||
summary = "WPILib Utility Library",
|
||||
entry_points = {
|
||||
"pkg_config": [
|
||||
"wpiutil = native.wpiutil",
|
||||
],
|
||||
},
|
||||
)
|
||||
|
||||
10
wpiutil/robotpy_pybind_build_info.bzl
generated
10
wpiutil/robotpy_pybind_build_info.bzl
generated
@@ -6,7 +6,7 @@ load("//shared/bazel/rules/robotpy:pybind_rules.bzl", "create_pybind_library", "
|
||||
load("//shared/bazel/rules/robotpy:semiwrap_helpers.bzl", "gen_libinit", "gen_modinit_hpp", "gen_pkgconf", "publish_casters", "resolve_casters", "run_header_gen")
|
||||
load("//shared/bazel/rules/robotpy:semiwrap_tool_helpers.bzl", "scan_headers", "update_yaml_files")
|
||||
|
||||
def wpiutil_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], includes = [], extra_pyi_deps = []):
|
||||
def wpiutil_extension(srcs = [], header_to_dat_deps = [], extra_hdrs = [], includes = []):
|
||||
WPIUTIL_HEADER_GEN = [
|
||||
struct(
|
||||
class_name = "Color",
|
||||
@@ -252,6 +252,14 @@ def define_pybind_library(name, pkgcfgs = []):
|
||||
deps = [
|
||||
"//wpiutil:robotpy-native-wpiutil",
|
||||
],
|
||||
strip_path_prefixes = ["wpiutil/src/main/python", "wpiutil"],
|
||||
summary = "Binary wrapper for FRC WPIUtil library",
|
||||
project_urls = {"Source code": "https://github.com/robotpy/mostrobotpy"},
|
||||
author_email = "RobotPy Development Team <robotpy@googlegroups.com>",
|
||||
requires = ["robotpy-native-wpiutil==0.0.0"],
|
||||
entry_points = {
|
||||
"pkg_config": ["wpiutil-casters = wpiutil", "wpiutil = wpiutil"],
|
||||
},
|
||||
visibility = ["//visibility:public"],
|
||||
)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user