Skip to content

Commit

Permalink
[python] allow to customize wheel package name and version (#23704)
Browse files Browse the repository at this point in the history
Allow to customize the wheel package name as well as its version.
  • Loading branch information
agners authored and pull[bot] committed Mar 28, 2023
1 parent b2ec5ff commit 0ec50d4
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions src/controller/python/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,10 @@ config("controller_wno_deprecate") {
cflags = [ "-Wno-deprecated-declarations" ]
}

chip_python_version = "0.0"
declare_args() {
chip_python_version = "0.0"
chip_python_package_prefix = "chip"
}

shared_library("ChipDeviceCtrl") {
if (chip_controller) {
Expand Down Expand Up @@ -336,11 +339,12 @@ chip_python_wheel_action("chip-core") {
lib_name = "_ChipServer.so"
}

py_package_name = "chip-core"
py_package_name = "${chip_python_package_prefix}-core"
py_package_output = string_replace(py_package_name, "-", "_")

public_deps = [ ":ChipDeviceCtrl" ]

output_name = "chip_core-${chip_python_version}-${tags}.whl"
output_name = "${py_package_output}-${chip_python_version}-${tags}.whl"
}

chip_python_wheel_action("chip-clusters") {
Expand Down Expand Up @@ -373,10 +377,11 @@ chip_python_wheel_action("chip-clusters") {

py_package_reqs = [ "dacite" ]

py_package_name = "chip-clusters"
py_package_name = "${chip_python_package_prefix}-clusters"
py_package_output = string_replace(py_package_name, "-", "_")
py_platform_tag = "any"

output_name = "chip_clusters-${chip_python_version}-py3-none-any.whl"
output_name = "${py_package_output}-${chip_python_version}-py3-none-any.whl"
}

chip_python_wheel_action("chip-repl") {
Expand Down Expand Up @@ -417,13 +422,14 @@ chip_python_wheel_action("chip-repl") {
"mobly",
]

py_package_name = "chip-repl"
py_package_name = "${chip_python_package_prefix}-repl"
py_package_output = string_replace(py_package_name, "-", "_")
py_platform_tag = "any"

data_deps = [
":chip-clusters",
":chip-core",
]

output_name = "chip_repl-${chip_python_version}-py3-none-any.whl"
output_name = "${py_package_output}-${chip_python_version}-py3-none-any.whl"
}

0 comments on commit 0ec50d4

Please sign in to comment.