Skip to content

Commit

Permalink
updates for building pi3hat_tools for python3.11
Browse files Browse the repository at this point in the history
  • Loading branch information
JGSuw authored and jpieper committed Dec 15, 2023
1 parent c3563ce commit c8b9e13
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 6 deletions.
9 changes: 8 additions & 1 deletion BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ test_suite(
"cpu": arch,
},
)
for pyver in ['3.7', '3.9', '3.10']
for pyver in ['3.7', '3.9', '3.10', '3.11']
for arch in ['armeabihf', 'aarch64']
]

Expand All @@ -112,3 +112,10 @@ config_setting(
"define": "PYTHON=3.10",
},
)

config_setting(
name = "python311",
values = {
"define": "PYTHON=3.11",
},
)
7 changes: 6 additions & 1 deletion lib/python/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,13 @@ load("//tools/workspace:template_file.bzl", "template_file")

VERSION="0.3.29"

PYTHON_SHORT_VERSIONS = ['37', '39', '310']
PYTHON_SHORT_VERSIONS = ['37', '39', '310', '311']
ARCHITECTURES = ['armv7l', 'aarch64']
ABITAG = {
'37': 'abi3',
'39': 'cp39',
'310': 'cp310',
'311': 'cp311',
}
PTAG = {
'37_armv7l': 'linux',
Expand All @@ -36,6 +37,8 @@ PTAG = {
'39_aarch64': 'manylinux_2_17',
'310_armv7l': 'manylinux_2_17',
'310_aarch64': 'manylinux_2_17',
'311_armv7l': 'manylinux_2_17',
'311_aarch64': 'manylinux_2_17',
}


Expand Down Expand Up @@ -119,5 +122,7 @@ filegroup(
"//:python39_aarch64" : [":bdist_wheel_39_aarch64"],
"//:python310_armeabihf" : [":bdist_wheel_310_armv7l"],
"//:python310_aarch64" : [":bdist_wheel_310_aarch64"],
"//:python311_armeabihf" : [":bdist_wheel_311_armv7l"],
"//:python311_aarch64" : [":bdist_wheel_311_aarch64"],
}),
)
1 change: 1 addition & 0 deletions lib/python/moteus_pi3hat/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ cc_binary(
"//:python37" : ["@com_github_pybind_pybind11//:pybind11_37"],
"//:python39" : ["@com_github_pybind_pybind11//:pybind11_39"],
"//:python310" : ["@com_github_pybind_pybind11//:pybind11_310"],
"//:python311" : ["@com_github_pybind_pybind11//:pybind11_311"],
}),
linkshared = True,
copts = ["-Ilib/cpp"],
Expand Down
4 changes: 2 additions & 2 deletions make_release.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,13 @@ def main():

run(f'cp bazel-bin/fw/pi3_hat.elf {outdir}/{datestr}-pi3hat-{git_hash}.elf')

for pyver in ['3.7', '3.9', '3.10']:
for pyver in ['3.7', '3.9', '3.10', '3.11']:
for arch in ['pi', 'pi64']:
pyarch = {
'pi' : 'armv7l',
'pi64' : 'aarch64',
}[arch]
run(f'tools/bazel build --config={arch} --define PYTHON={pyver} -c opt //:pi3hat_tools')
run(f'tools/bazel build --verbose_failures --config={arch} --define PYTHON={pyver} -c opt //:pi3hat_tools')
run(f'cp bazel-bin/pi3hat_tools.tar.bz2 {outdir}/{datestr}-pi3hat_tools-cp{pyver.replace(".","")}-{pyarch}-{git_hash}.tar.bz2')

wheel_name = subprocess.check_output("tar --list -f bazel-bin/pi3hat_tools.tar.bz2 | grep \.whl$", shell=True).decode('utf8').strip()
Expand Down
4 changes: 2 additions & 2 deletions tools/workspace/bazel_deps/repository.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,6 @@ def bazel_deps_repository(name):
github_archive(
name = name,
repo = "mjbots/bazel_deps",
commit = "6c9ba1867b5d0ab5e59a7f1205adfd750a6c3610",
sha256 = "617989e5ca59c691d4e3e601dc899745aa9ace4c21d0f70b6128cc8125754cbd",
commit = "80b6a3324b6abb5b630f05a8523730c55218860d",
sha256 = "9e307e748d2ba480017160f38612490e1568d00138a52cbb9afbb14aefee3633"
)
9 changes: 9 additions & 0 deletions tools/workspace/pybind11/package.BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,12 @@ cc_library(
"@python310//:headers",
],
)

cc_library(
name = "pybind11_311",
hdrs = glob(["include/**"]),
includes = ["include"],
deps = [
"@python311//:headers",
],
)

0 comments on commit c8b9e13

Please sign in to comment.