Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
pybind11
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open
pybind11
Commits
60306045
Commit
60306045
authored
Apr 16, 2018
by
Wenzel Jakob
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Detect pybind11 header path without depending on pip internals (fixes #1174) (#1190)
parent
f117a48e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
7 deletions
+24
-7
pybind11/__init__.py
+24
-7
No files found.
pybind11/__init__.py
View file @
60306045
from
._version
import
version_info
,
__version__
# noqa: F401 imported but unused
def
get_include
(
*
args
,
**
kwargs
):
def
get_include
(
user
=
False
):
from
distutils.dist
import
Distribution
import
os
try
:
from
pip
import
locations
return
os
.
path
.
dirname
(
locations
.
distutils_scheme
(
'pybind11'
,
*
args
,
**
kwargs
)[
'headers'
])
except
ImportError
:
return
'include'
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
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment