-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
pydrake: Expose pybind11 version information
- Loading branch information
1 parent
80f92a8
commit 6d25f60
Showing
3 changed files
with
74 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
""" | ||
Tests `pybind11` version information available from Drake. | ||
""" | ||
|
||
from __future__ import print_function | ||
|
||
import pydrake.util.pybind11_version as mut | ||
|
||
import unittest | ||
|
||
|
||
class TestPybind11Version(unittest.TestCase): | ||
def test_values(self): | ||
self.assertTrue(isinstance(mut.repository, str)) | ||
self.assertTrue(isinstance(mut.commit, str)) | ||
self.assertTrue(isinstance(mut.sha256, str)) | ||
|
||
|
||
if __name__ == '__main__': | ||
unittest.main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,38 @@ | ||
# -*- python -*- | ||
|
||
load("//tools/workspace:generate_file.bzl", "generate_file") | ||
load("@drake//tools/workspace:github.bzl", "github_archive") | ||
|
||
_REPOSITORY = "RobotLocomotion/pybind11" | ||
|
||
_COMMIT = "e19086472c664078b0ba77432001a89f97784c8d" | ||
|
||
_SHA256 = "62f1ae603f896e810339a23ed8695e6273d0936c6d77bd150cade67b76b06373" | ||
|
||
def pybind11_repository(name): | ||
github_archive( | ||
name = name, | ||
repository = "RobotLocomotion/pybind11", | ||
commit = "e19086472c664078b0ba77432001a89f97784c8d", | ||
sha256 = "62f1ae603f896e810339a23ed8695e6273d0936c6d77bd150cade67b76b06373", # noqa | ||
repository = _REPOSITORY, | ||
commit = _COMMIT, | ||
sha256 = _SHA256, | ||
build_file = "@drake//tools/workspace/pybind11:package.BUILD.bazel", | ||
) | ||
|
||
def generate_pybind11_version_py_file(name): | ||
vars = dict( | ||
repository = repr(_REPOSITORY), | ||
commit = repr(_COMMIT), | ||
sha256 = repr(_SHA256), | ||
) | ||
generate_file( | ||
name = name, | ||
content = ''' | ||
""" | ||
Provides information on the external fork of `pybind11` used by `pydrake`. | ||
""" | ||
repository = {repository} | ||
commit = {commit} | ||
sha256 = {sha256} | ||
'''.format(**vars) | ||
) |