mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-19 00:41:43 +00:00
[python] Improve robotpy generation (#8867)
The initial build file generation for robotpy projects was relatively naive and purpose built to get `allwpilib` compiling, without supporting all the available features. This modifies the generation scripts to be able to support multiple embedded libraries, which will be necessary for #8858, since `mrclib.so` will need to be bundled along with the hal libraries. In addition some cleanup was done to get the wheels looking more like what is in pypi.
This commit is contained in:
@@ -2,14 +2,13 @@ load("@allwpilib_pip_deps//:requirements.bzl", "requirement")
|
||||
load("@aspect_bazel_lib//lib:write_source_files.bzl", "write_source_files")
|
||||
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_test")
|
||||
load("@rules_java//java:defs.bzl", "java_binary")
|
||||
load("@rules_pycross//pycross:defs.bzl", "pycross_wheel_library")
|
||||
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
|
||||
load("@rules_python//python:packaging.bzl", "py_wheel")
|
||||
load("@rules_python//python:defs.bzl", "py_binary")
|
||||
load("//commandsv2:generate.bzl", "generate_wpilib_new_commands")
|
||||
load("//shared/bazel/rules:cc_rules.bzl", "third_party_cc_lib_helper", "wpilib_cc_library", "wpilib_cc_shared_library", "wpilib_cc_static_library")
|
||||
load("//shared/bazel/rules:java_rules.bzl", "wpilib_java_junit5_test", "wpilib_java_library")
|
||||
load("//shared/bazel/rules:packaging.bzl", "package_default_cc_project")
|
||||
load("//shared/bazel/rules/robotpy:pytest_util.bzl", "robotpy_py_test")
|
||||
load("//shared/bazel/rules/robotpy:robotpy_rules.bzl", "robotpy_library")
|
||||
|
||||
filegroup(
|
||||
name = "doxygen-files",
|
||||
@@ -188,30 +187,21 @@ package_default_cc_project(
|
||||
maven_group_id = "org.wpilib.commandsv2",
|
||||
)
|
||||
|
||||
py_library(
|
||||
name = "commandsv2-py-lib",
|
||||
srcs = glob(["src/main/python/**/*.py"]),
|
||||
imports = ["src/main/python"],
|
||||
deps = [
|
||||
"//wpilibc:robotpy-wpilib",
|
||||
requirement("typing-extensions"),
|
||||
],
|
||||
)
|
||||
|
||||
py_wheel(
|
||||
name = "commandsv2-wheel",
|
||||
distribution = "commandsv2",
|
||||
strip_path_prefixes = ["commandsv2/src/main/python"],
|
||||
tags = ["robotpy"],
|
||||
version = "$(ROBOTPY_VERSION)",
|
||||
deps = [":commandsv2-py-lib"],
|
||||
)
|
||||
|
||||
pycross_wheel_library(
|
||||
robotpy_library(
|
||||
name = "commandsv2-py",
|
||||
tags = ["manual"],
|
||||
visibility = ["//visibility:public"],
|
||||
wheel = ":commandsv2-wheel",
|
||||
srcs = glob(["src/main/python/**/*.py"]),
|
||||
author_email = "RobotPy Development Team <robotpy@googlegroups.com>",
|
||||
description_file = "src/main/python/README.md",
|
||||
distribution = "robotpy-commands-v2",
|
||||
imports = ["src/main/python"],
|
||||
project_urls = {"Source code": "https://github.com/robotpy/mostrobotpy"},
|
||||
python_requires = ">=3.10",
|
||||
requires = [
|
||||
"wpilib==0.0.0",
|
||||
"typing_extensions>=4.1.0,<5",
|
||||
],
|
||||
strip_path_prefixes = ["commandsv2/src/main/python"],
|
||||
summary = "WPILib command framework v2",
|
||||
deps = [
|
||||
"//wpilibc:robotpy-wpilib",
|
||||
requirement("typing-extensions"),
|
||||
|
||||
@@ -7,7 +7,7 @@ name = "robotpy-commands-v2"
|
||||
version = "0.0.0"
|
||||
description = "WPILib command framework v2"
|
||||
readme = "README.md"
|
||||
requires-python = ">=3.10"
|
||||
requires-python = ">=3.11"
|
||||
license = "BSD-3-Clause"
|
||||
license-files = ["LICENSE"]
|
||||
dependencies = [
|
||||
@@ -24,7 +24,7 @@ name = "RobotPy Development Team"
|
||||
email = "robotpy@googlegroups.com"
|
||||
|
||||
[project.urls]
|
||||
"Source code" = "https://github.com/robotpy/robotpy-commands-v2"
|
||||
"Source code" = "https://github.com/robotpy/mostrobotpy"
|
||||
|
||||
[tool.hatch.version]
|
||||
source = "vcs"
|
||||
|
||||
Reference in New Issue
Block a user