mirror of
https://github.com/thelsing/knx.git
synced 2026-02-23 13:50:35 +01:00
move knx-linux and knxPyton to examples dir
This commit is contained in:
28
examples/knxPython/pybind11/pybind11/__init__.py
Normal file
28
examples/knxPython/pybind11/pybind11/__init__.py
Normal file
@@ -0,0 +1,28 @@
|
||||
from ._version import version_info, __version__ # noqa: F401 imported but unused
|
||||
|
||||
|
||||
def get_include(user=False):
|
||||
from distutils.dist import Distribution
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Are we running in a virtual environment?
|
||||
virtualenv = hasattr(sys, 'real_prefix') or \
|
||||
sys.prefix != getattr(sys, "base_prefix", sys.prefix)
|
||||
|
||||
if virtualenv:
|
||||
return os.path.join(sys.prefix, 'include', 'site',
|
||||
'python' + sys.version[:3])
|
||||
else:
|
||||
dist = Distribution({'name': 'pybind11'})
|
||||
dist.parse_config_files()
|
||||
|
||||
dist_cobj = dist.get_command_obj('install', create=True)
|
||||
|
||||
# Search for packages in user's home directory?
|
||||
if user:
|
||||
dist_cobj.user = user
|
||||
dist_cobj.prefix = ""
|
||||
dist_cobj.finalize_options()
|
||||
|
||||
return os.path.dirname(dist_cobj.install_headers)
|
||||
37
examples/knxPython/pybind11/pybind11/__main__.py
Normal file
37
examples/knxPython/pybind11/pybind11/__main__.py
Normal file
@@ -0,0 +1,37 @@
|
||||
from __future__ import print_function
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
import sysconfig
|
||||
|
||||
from . import get_include
|
||||
|
||||
|
||||
def print_includes():
|
||||
dirs = [sysconfig.get_path('include'),
|
||||
sysconfig.get_path('platinclude'),
|
||||
get_include(),
|
||||
get_include(True)]
|
||||
|
||||
# Make unique but preserve order
|
||||
unique_dirs = []
|
||||
for d in dirs:
|
||||
if d not in unique_dirs:
|
||||
unique_dirs.append(d)
|
||||
|
||||
print(' '.join('-I' + d for d in unique_dirs))
|
||||
|
||||
|
||||
def main():
|
||||
parser = argparse.ArgumentParser(prog='python -m pybind11')
|
||||
parser.add_argument('--includes', action='store_true',
|
||||
help='Include flags for both pybind11 and Python headers.')
|
||||
args = parser.parse_args()
|
||||
if not sys.argv[1:]:
|
||||
parser.print_help()
|
||||
if args.includes:
|
||||
print_includes()
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
main()
|
||||
2
examples/knxPython/pybind11/pybind11/_version.py
Normal file
2
examples/knxPython/pybind11/pybind11/_version.py
Normal file
@@ -0,0 +1,2 @@
|
||||
version_info = (2, 2, 4)
|
||||
__version__ = '.'.join(map(str, version_info))
|
||||
Reference in New Issue
Block a user