Skip to content

Commit 73bc183

Browse files
committed
handle abi_version
1 parent 2c93f0f commit 73bc183

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

recipe/meta.yaml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
{% set sha256 = "bf8f242abd1abcd375d516a7067490fb71abd79519a282d22b6e4d19282185a7" %}
33

44
# this is set to PYBIND11_INTERNALS_VERSION
5-
{% set abi_version = "4" %}
6-
{% set abi_buildnumber = "1" %}
5+
{% set abi_version = "4" %} # [py<312 and not win]
6+
{% set abi_buildnumber = "1" %} # [py<312 and not win]
7+
{% set abi_version = "5" %} # [py>=312 or win]
8+
{% set abi_buildnumber = "0" %} # [py>=312 or win]
79

810
package:
911
name: pybind11-split
@@ -31,7 +33,7 @@ outputs:
3133
- include/pybind11/detail/internals.h
3234
commands:
3335
# make sure the internals version matches the package version
34-
- if [[ $(grep "#[[:blank:]]*define PYBIND11_INTERNALS_VERSION" include/pybind11/detail/internals.h | rev | cut -d' ' -f1) != "{{ abi_version }}" ]]; then exit 1; fi
36+
- matched=false; while read -r version; do [ "$version" -eq "{{ abi_version }}" ] && { matched=true; break; }; done < <(awk '/define PYBIND11_INTERNALS_VERSION/{print $NF}' include/pybind11/detail/internals.h); [ "$matched" = true ] && exit 0 || exit 1
3537

3638
- name: pybind11-global
3739
script: build-pybind11-global.sh # [unix]

0 commit comments

Comments
 (0)