diff options
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-pandas')
3 files changed, 64 insertions, 35 deletions
diff --git a/meta-python/recipes-devtools/python/python3-pandas/0001-BLD-add-option-to-specify-numpy-header-location.patch b/meta-python/recipes-devtools/python/python3-pandas/0001-BLD-add-option-to-specify-numpy-header-location.patch new file mode 100644 index 0000000000..e83576eb62 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-pandas/0001-BLD-add-option-to-specify-numpy-header-location.patch | |||
@@ -0,0 +1,61 @@ | |||
1 | From 16dd09e6c79768a24f5a50ec5985e0b6fdf17f35 Mon Sep 17 00:00:00 2001 | ||
2 | From: Gyorgy Sarvari <skandigraun@gmail.com> | ||
3 | Date: Mon, 10 Mar 2025 13:52:11 +0100 | ||
4 | Subject: [PATCH] BLD: add option to specify numpy header location | ||
5 | |||
6 | In some cases the numpy module might not be usable during build-time, | ||
7 | especially when cross-compiling. (E.g. when compiling for arm32 on a | ||
8 | x86-64 machine, the arm32 module is not usable at build time). | ||
9 | |||
10 | This makes meson fail, as it isn't able to figure out the location of | ||
11 | numpy headers. | ||
12 | |||
13 | To allow an alternative way to find these headers, introduce a meson | ||
14 | build option, where the location of the numpy headers can be specified. | ||
15 | |||
16 | In case numpy module cannot be loaded for some reason to query the | ||
17 | include folder location, fall back to the value of this meson option. | ||
18 | |||
19 | Upstream-Status: Submitted [https://github.com/pandas-dev/pandas/pull/61095] | ||
20 | |||
21 | Signed-off-by: Gyorgy Sarvari <skandigraun@gmail.com> | ||
22 | --- | ||
23 | meson.options | 1 + | ||
24 | pandas/meson.build | 13 ++++++++++--- | ||
25 | 2 files changed, 11 insertions(+), 3 deletions(-) | ||
26 | create mode 100644 meson.options | ||
27 | |||
28 | --- /dev/null | ||
29 | +++ b/meson.options | ||
30 | @@ -0,0 +1 @@ | ||
31 | +option('numpy_inc_dir', type : 'string', description : 'The absolute path to the numpy headers') | ||
32 | --- a/pandas/meson.build | ||
33 | +++ b/pandas/meson.build | ||
34 | @@ -3,17 +3,24 @@ incdir_numpy = run_command(py, | ||
35 | '-c', | ||
36 | ''' | ||
37 | import os | ||
38 | -import numpy as np | ||
39 | + | ||
40 | +try: | ||
41 | + import numpy as np | ||
42 | + base_incdir = np.get_include() | ||
43 | +except Exception: | ||
44 | + base_incdir = os.getenv('NUMPY_INC_DIR') | ||
45 | + | ||
46 | try: | ||
47 | # Check if include directory is inside the pandas dir | ||
48 | # e.g. a venv created inside the pandas dir | ||
49 | # If so, convert it to a relative path | ||
50 | - incdir = os.path.relpath(np.get_include()) | ||
51 | + incdir = os.path.relpath(base_incdir) | ||
52 | except Exception: | ||
53 | - incdir = np.get_include() | ||
54 | + incdir = base_incdir | ||
55 | print(incdir) | ||
56 | ''' | ||
57 | ], | ||
58 | + env: {'NUMPY_INC_DIR': get_option('numpy_inc_dir')}, | ||
59 | check: true | ||
60 | ).stdout().strip() | ||
61 | |||
diff --git a/meta-python/recipes-devtools/python/python3-pandas/0001-pyproject.toml-Downgrade-numpy-version-needs-to-1.x.patch b/meta-python/recipes-devtools/python/python3-pandas/0001-pyproject.toml-Downgrade-numpy-version-needs-to-1.x.patch deleted file mode 100644 index b0ef8ce00c..0000000000 --- a/meta-python/recipes-devtools/python/python3-pandas/0001-pyproject.toml-Downgrade-numpy-version-needs-to-1.x.patch +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | From d81d95274d84ac51fc02e0fa91affc7f3cbefccb Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Sat, 24 Aug 2024 10:21:43 -0700 | ||
4 | Subject: [PATCH] pyproject.toml: Downgrade numpy version needs to 1.x | ||
5 | |||
6 | Drop it when numpy is upgraded to 2.x or newer in core | ||
7 | |||
8 | Upstream-Status: Inappropriate [OE workaround] | ||
9 | |||
10 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
11 | --- | ||
12 | pyproject.toml | 2 +- | ||
13 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
14 | |||
15 | diff --git a/pyproject.toml b/pyproject.toml | ||
16 | index 5158d60..d3daa78 100644 | ||
17 | --- a/pyproject.toml | ||
18 | +++ b/pyproject.toml | ||
19 | @@ -8,7 +8,7 @@ requires = [ | ||
20 | "Cython>=3.0.5", # Note: sync with setup.py, environment.yml and asv.conf.json | ||
21 | # Force numpy higher than 2.0rc1, so that built wheels are compatible | ||
22 | # with both numpy 1 and 2 | ||
23 | - "numpy>=2.0.0rc1", | ||
24 | + "numpy>=1.24.0", | ||
25 | "versioneer[toml]" | ||
26 | ] | ||
27 | |||
diff --git a/meta-python/recipes-devtools/python/python3-pandas/0001-pyproject.toml-don-t-pin-dependency-versions.patch b/meta-python/recipes-devtools/python/python3-pandas/0001-pyproject.toml-don-t-pin-dependency-versions.patch index f60f43a5b0..950f25303f 100644 --- a/meta-python/recipes-devtools/python/python3-pandas/0001-pyproject.toml-don-t-pin-dependency-versions.patch +++ b/meta-python/recipes-devtools/python/python3-pandas/0001-pyproject.toml-don-t-pin-dependency-versions.patch | |||
@@ -14,8 +14,6 @@ Signed-off-by: Trevor Gamblin <tgamblin@baylibre.com> | |||
14 | pyproject.toml | 6 +++--- | 14 | pyproject.toml | 6 +++--- |
15 | 1 file changed, 3 insertions(+), 3 deletions(-) | 15 | 1 file changed, 3 insertions(+), 3 deletions(-) |
16 | 16 | ||
17 | diff --git a/pyproject.toml b/pyproject.toml | ||
18 | index db9f055799..5158d60f59 100644 | ||
19 | --- a/pyproject.toml | 17 | --- a/pyproject.toml |
20 | +++ b/pyproject.toml | 18 | +++ b/pyproject.toml |
21 | @@ -2,10 +2,10 @@ | 19 | @@ -2,10 +2,10 @@ |
@@ -27,11 +25,8 @@ index db9f055799..5158d60f59 100644 | |||
27 | + "meson-python>=0.13.1", | 25 | + "meson-python>=0.13.1", |
28 | + "meson>=1.2.1", | 26 | + "meson>=1.2.1", |
29 | "wheel", | 27 | "wheel", |
30 | - "Cython==3.0.5", # Note: sync with setup.py, environment.yml and asv.conf.json | 28 | - "Cython~=3.0.5", # Note: sync with setup.py, environment.yml and asv.conf.json |
31 | + "Cython>=3.0.5", # Note: sync with setup.py, environment.yml and asv.conf.json | 29 | + "Cython>=3.0.5", # Note: sync with setup.py, environment.yml and asv.conf.json |
32 | # Force numpy higher than 2.0rc1, so that built wheels are compatible | 30 | # Force numpy higher than 2.0, so that built wheels are compatible |
33 | # with both numpy 1 and 2 | 31 | # with both numpy 1 and 2 |
34 | "numpy>=2.0.0rc1", | 32 | "numpy>=2.0", |
35 | -- | ||
36 | 2.39.2 | ||
37 | |||