Skip to content

Commit

Permalink
Fix abi version tests
Browse files Browse the repository at this point in the history
  • Loading branch information
isuruf committed Oct 29, 2024
1 parent c9a1864 commit 56832b8
Show file tree
Hide file tree
Showing 7 changed files with 58 additions and 12 deletions.
8 changes: 6 additions & 2 deletions .azure-pipelines/azure-pipelines-linux.yml

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

Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
abi_version:
- '4'
c_stdlib:
- sysroot
c_stdlib_version:
Expand Down
29 changes: 29 additions & 0 deletions .ci_support/linux_64_abi_version5.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
abi_version:
- '5'
c_stdlib:
- sysroot
c_stdlib_version:
- '2.17'
cdt_name:
- cos7
channel_sources:
- conda-forge
channel_targets:
- conda-forge main
cxx_compiler:
- gxx
cxx_compiler_version:
- '13'
docker_image:
- quay.io/condaforge/linux-anvil-cos7-x86_64
pin_run_as_build:
python:
min_pin: x.x
max_pin: x.x
python:
- 3.13.* *_cp313
target_platform:
- linux-64
zip_keys:
- - c_stdlib_version
- cdt_name
2 changes: 2 additions & 0 deletions .ci_support/win_64_.yaml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
abi_version:
- '5'
c_stdlib:
- vs
channel_sources:
Expand Down
3 changes: 3 additions & 0 deletions recipe/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
abi_version:
- 5
- 4 # [unix]
23 changes: 13 additions & 10 deletions recipe/meta.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
{% set version = "2.13.6" %}
{% set sha256 = "e08cb87f4773da97fa7b5f035de8763abc656d87d5773e62f6da0587d1f0ec20" %}

# this is set to PYBIND11_INTERNALS_VERSION
{% set abi_version = "4" %}

package:
name: pybind11-split
version: {{ version }}
Expand All @@ -29,12 +26,22 @@ outputs:
noarch: generic
run_exports:
- pybind11-abi =={{ abi_version }}
requirements:
run:
- __unix # [unix]
- __win # [win]
- python >=3.12 # [abi_version == 5 or win]
- python <3.12 # [abi_version == 4 and unix]
run_constrained:
- pybind11-global {{ version }}
- pybind11 {{ version }}
test:
source_files:
- include/pybind11/detail/internals.h
files:
- test-pybind11-abi.sh
commands:
# make sure the internals version matches the package version
- if [ $(grep "#define PYBIND11_INTERNALS_VERSION" include/pybind11/detail/internals.h | cut -d' ' -f3) != "{{ abi_version }}" ]; then exit 1; fi # [unix]
- bash test-pybind11-abi.sh {{ abi_version }} # [unix]

- name: pybind11-global
script: build-pybind11-global.sh # [unix]
Expand All @@ -58,8 +65,6 @@ outputs:
# layouts are different on unix vs win
- __unix # [unix]
- __win # [win]
run_constrained:
- pybind11-abi =={{ abi_version }}
test:
commands:
- echo "works!"
Expand All @@ -86,8 +91,6 @@ outputs:
run:
- python
- pybind11-global {{ PKG_VERSION }}=*_{{ PKG_BUILDNUM }}
run_constrained:
- pybind11-abi =={{ abi_version }}
test:
imports:
- pybind11
Expand All @@ -97,7 +100,7 @@ outputs:
- test -f ${PREFIX}/include/pybind11/pybind11.h # [unix]
- if not exist %LIBRARY_INC%\pybind11\pybind11.h exit 1 # [win]
- test -f $(python -c "import pybind11 as py; print(py.get_include())")/pybind11/pybind11.h # [unix]
- if not exist $(python -c "import pybind11 as py; print(py.get_include())")\pybind11\pybind11.h exit 1 # [win]
- if not exist %SP_DIR%\pybind11\include\pybind11\pybind11.h exit 1 # [win]

about:
home: https://github.com/pybind/pybind11/
Expand Down
3 changes: 3 additions & 0 deletions recipe/test-pybind11-abi.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# make sure the internals version matches the package version
set -e
grep "define PYBIND11_INTERNALS_VERSION $1" include/pybind11/detail/internals.h

0 comments on commit 56832b8

Please sign in to comment.