diff options
author | Dan Willemsen <dwillemsen@google.com> | 2023-08-22 23:21:44 -0400 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2023-08-23 03:29:09 +0000 |
commit | df375684ae9f93fc9989010afc7a75f9137dfa31 (patch) | |
tree | a199f13004f9dca173b6bc46161736ffc224f6fc /pybind11/commands.py | |
parent | b8e87d598df7438198bea866338da9911e8bc1b5 (diff) | |
parent | 1a917f1852eb7819b671fc3fa862840f4c491a07 (diff) | |
download | pybind11-df375684ae9f93fc9989010afc7a75f9137dfa31.tar.gz |
Upgrade pybind11 to v2.11.0
This project was upgraded with external_updater.
Usage: tools/external_updater/updater.sh update python/pybind11
For more info, check https://cs.android.com/android/platform/superproject/+/main:tools/external_updater/README.md
Bug: 278602456
Test: TreeHugger
Test: cd packages/modules/Bluetooth/system/gd; mma
Change-Id: I601caf819d7dc60ce7ef8f3b466485470f14463d
Diffstat (limited to 'pybind11/commands.py')
-rw-r--r-- | pybind11/commands.py | 33 |
1 files changed, 24 insertions, 9 deletions
diff --git a/pybind11/commands.py b/pybind11/commands.py index 34dbaf8a..b11690f4 100644 --- a/pybind11/commands.py +++ b/pybind11/commands.py @@ -1,22 +1,37 @@ -# -*- coding: utf-8 -*- import os - DIR = os.path.abspath(os.path.dirname(__file__)) -def get_include(user=False): - # type: (bool) -> str +def get_include(user: bool = False) -> str: # noqa: ARG001 + """ + Return the path to the pybind11 include directory. The historical "user" + argument is unused, and may be removed. + """ installed_path = os.path.join(DIR, "include") source_path = os.path.join(os.path.dirname(DIR), "include") return installed_path if os.path.exists(installed_path) else source_path -def get_cmake_dir(): - # type: () -> str +def get_cmake_dir() -> str: + """ + Return the path to the pybind11 CMake module directory. + """ cmake_installed_path = os.path.join(DIR, "share", "cmake", "pybind11") if os.path.exists(cmake_installed_path): return cmake_installed_path - else: - msg = "pybind11 not installed, installation required to access the CMake files" - raise ImportError(msg) + + msg = "pybind11 not installed, installation required to access the CMake files" + raise ImportError(msg) + + +def get_pkgconfig_dir() -> str: + """ + Return the path to the pybind11 pkgconfig directory. + """ + pkgconfig_installed_path = os.path.join(DIR, "share", "pkgconfig") + if os.path.exists(pkgconfig_installed_path): + return pkgconfig_installed_path + + msg = "pybind11 not installed, installation required to access the pkgconfig files" + raise ImportError(msg) |