Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix test for pybind11 include on conda #43

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitattributes

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 6 additions & 3 deletions .travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions README.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ source:
fn: pybind11-{{ version }}.tar.gz
url: https://github.com/pybind/pybind11/archive/v{{ version }}.tar.gz
sha256: {{ sha256 }}
patches:
- remconda.patch

build:
number: 0
number: 1

requirements:
build:
Expand All @@ -30,8 +32,8 @@ test:
commands:
- test -f ${PREFIX}/share/cmake/pybind11/pybind11Config.cmake # [unix]
- if exist %LIBRARY_PREFIX%\share\cmake\pybind11\pybind11Config.cmake (exit 0) else (exit 1) # [win]
- test $(python -c "import pybind11 as py; print(py.get_include())") == "${PREFIX}/include" # [unix]
- test $(python -c "import pybind11 as py; print(py.get_include())") == "%LIBRARY_PREFIX%\include" # [win]
- test -f $(python -c "import pybind11 as py; print(py.get_include())")/pybind11/pybind11.h # [unix]
- if exist $(python -c "import pybind11 as py; print(py.get_include())")\pybind11\pybind11.h (exit 0) else (exit 1) # [win]

about:
home: https://github.com/pybind/pybind11/
Expand Down
31 changes: 31 additions & 0 deletions recipe/remconda.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
From 592867bbb23ce0a67d5d325037bf92c20f17a60f Mon Sep 17 00:00:00 2001
From: Henry Schreiner <henry.fredrick.schreiner@cern.ch>
Date: Wed, 15 Jan 2020 15:39:18 -0500
Subject: [PATCH] Fix conda include reporting

---
pybind11/__init__.py | 8 --------
1 file changed, 8 deletions(-)

diff --git a/pybind11/__init__.py b/pybind11/__init__.py
index c625e8c94..5782ffea2 100644
--- a/pybind11/__init__.py
+++ b/pybind11/__init__.py
@@ -10,17 +10,9 @@ def get_include(user=False):
virtualenv = hasattr(sys, 'real_prefix') or \
sys.prefix != getattr(sys, "base_prefix", sys.prefix)

- # Are we running in a conda environment?
- conda = os.path.exists(os.path.join(sys.prefix, 'conda-meta'))
-
if virtualenv:
return os.path.join(sys.prefix, 'include', 'site',
'python' + sys.version[:3])
- elif conda:
- if os.name == 'nt':
- return os.path.join(sys.prefix, 'Library', 'include')
- else:
- return os.path.join(sys.prefix, 'include')
else:
dist = Distribution({'name': 'pybind11'})
dist.parse_config_files()