From 2bebb38d5529bb13a897edaffc0259d1fdca9492 Mon Sep 17 00:00:00 2001 From: "H. Vetinari" Date: Sun, 24 Nov 2024 19:57:02 +1100 Subject: [PATCH] add a patch for dealing with buggy cython tracing on 3.12 --- recipe/meta.yaml | 3 +++ .../patches/0001-skip-beam-density-test.patch | 13 +++++++++++-- ...set-profile-False-in-levenshtein.pyx.patch | 19 +++++++++++++++++++ 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 recipe/patches/0002-explicitly-set-profile-False-in-levenshtein.pyx.patch diff --git a/recipe/meta.yaml b/recipe/meta.yaml index f0d032b..fd68d4b 100644 --- a/recipe/meta.yaml +++ b/recipe/meta.yaml @@ -10,6 +10,9 @@ source: sha256: 4b37ebd25ada4059b0dc9e0893e70dde5df83485329a068ef04580e70892a65d patches: - patches/0001-skip-beam-density-test.patch + # for some reason cython 0.29 picks a non-default (and broken on 3.12) + # profile=True for _one_ particular file; suppress it + - patches/0002-explicitly-set-profile-False-in-levenshtein.pyx.patch # [py>=312] build: number: 0 diff --git a/recipe/patches/0001-skip-beam-density-test.patch b/recipe/patches/0001-skip-beam-density-test.patch index a09c557..85075cd 100644 --- a/recipe/patches/0001-skip-beam-density-test.patch +++ b/recipe/patches/0001-skip-beam-density-test.patch @@ -1,8 +1,17 @@ +From fe0ff9eb662d596e462ab9f0f34e42a8df10cffc Mon Sep 17 00:00:00 2001 +From: Adriane Boyd +Date: Wed, 30 Mar 2022 15:59:16 +0200 +Subject: [PATCH 1/2] skip beam density test + +--- + spacy/tests/parser/test_nn_beam.py | 1 + + 1 file changed, 1 insertion(+) + diff --git a/spacy/tests/parser/test_nn_beam.py b/spacy/tests/parser/test_nn_beam.py -index 4ba020ef0..7942dfa7f 100644 +index f852e5cda..97a4deafb 100644 --- a/spacy/tests/parser/test_nn_beam.py +++ b/spacy/tests/parser/test_nn_beam.py -@@ -128,6 +128,7 @@ def test_beam_parse(examples, beam_width): +@@ -129,6 +129,7 @@ def test_beam_parse(examples, beam_width): parser(doc) diff --git a/recipe/patches/0002-explicitly-set-profile-False-in-levenshtein.pyx.patch b/recipe/patches/0002-explicitly-set-profile-False-in-levenshtein.pyx.patch new file mode 100644 index 0000000..87d8e55 --- /dev/null +++ b/recipe/patches/0002-explicitly-set-profile-False-in-levenshtein.pyx.patch @@ -0,0 +1,19 @@ +From b50b84a8575089023169b0d85ce62b3712c0f3b6 Mon Sep 17 00:00:00 2001 +From: "H. Vetinari" +Date: Sun, 24 Nov 2024 19:54:31 +1100 +Subject: [PATCH 2/2] explicitly set profile=False in levenshtein.pyx + +--- + spacy/matcher/levenshtein.pyx | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/spacy/matcher/levenshtein.pyx b/spacy/matcher/levenshtein.pyx +index e394f2cf4..81849d9ab 100644 +--- a/spacy/matcher/levenshtein.pyx ++++ b/spacy/matcher/levenshtein.pyx +@@ -1,4 +1,4 @@ +-# cython: binding=True, infer_types=True ++# cython: binding=True, infer_types=True, profile=False + from cpython.object cimport PyObject + from libc.stdint cimport int64_t +