summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichał Górny <mgorny@gentoo.org>2023-08-31 21:29:46 +0200
committerMichał Górny <mgorny@gentoo.org>2023-08-31 22:21:38 +0200
commit5bbaf661cb9f4ea915197376e204f29fab736684 (patch)
tree9cdbba20b378b9d87caa89f13be14034b8d1ad87 /dev-python/pandas
parentapp-portage/getuto: drop 1.1, 1.2 (diff)
downloadgentoo-5bbaf661cb9f4ea915197376e204f29fab736684.tar.gz
gentoo-5bbaf661cb9f4ea915197376e204f29fab736684.tar.bz2
gentoo-5bbaf661cb9f4ea915197376e204f29fab736684.zip
dev-python/pandas: Fix build & tests
Signed-off-by: Michał Górny <mgorny@gentoo.org>
Diffstat (limited to 'dev-python/pandas')
-rw-r--r--dev-python/pandas/files/pandas-2.1.0-build-system.patch53
-rw-r--r--dev-python/pandas/pandas-2.1.0.ebuild94
2 files changed, 134 insertions, 13 deletions
diff --git a/dev-python/pandas/files/pandas-2.1.0-build-system.patch b/dev-python/pandas/files/pandas-2.1.0-build-system.patch
new file mode 100644
index 000000000000..3f858647f919
--- /dev/null
+++ b/dev-python/pandas/files/pandas-2.1.0-build-system.patch
@@ -0,0 +1,53 @@
+From 2e8e37e495b85856bb440e67db9a6a72a37cfedd Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
+Date: Thu, 31 Aug 2023 18:21:26 +0200
+Subject: [PATCH] Fix build system problems
+
+Fix missing dependency for interval library, and workaround duplicate
+__init__.py files.
+
+https://github.com/pandas-dev/pandas/issues/54888
+https://github.com/pandas-dev/pandas/issues/54889
+---
+ pandas/_libs/meson.build | 7 ++-----
+ pandas/_libs/tslibs/meson.build | 4 ----
+ 2 files changed, 2 insertions(+), 9 deletions(-)
+
+diff --git a/pandas/_libs/meson.build b/pandas/_libs/meson.build
+index f302c64..07d2d8a 100644
+--- a/pandas/_libs/meson.build
++++ b/pandas/_libs/meson.build
+@@ -69,7 +69,8 @@ libs_sources = {
+ 'index': {'sources': ['index.pyx', _index_class_helper]},
+ 'indexing': {'sources': ['indexing.pyx']},
+ 'internals': {'sources': ['internals.pyx']},
+- 'interval': {'sources': ['interval.pyx', _intervaltree_helper]},
++ 'interval': {'sources': ['interval.pyx', _intervaltree_helper],
++ 'deps': _khash_primitive_helper_dep},
+ 'join': {'sources': ['join.pyx', _khash_primitive_helper],
+ 'deps': _khash_primitive_helper_dep},
+ 'lib': {'sources': ['lib.pyx', 'src/parser/tokenizer.c']},
+@@ -113,8 +114,4 @@ foreach ext_name, ext_dict : libs_sources
+ )
+ endforeach
+
+-py.install_sources('__init__.py',
+- pure: false,
+- subdir: 'pandas/_libs')
+-
+ subdir('window')
+diff --git a/pandas/_libs/tslibs/meson.build b/pandas/_libs/tslibs/meson.build
+index 14d2eef..a862345 100644
+--- a/pandas/_libs/tslibs/meson.build
++++ b/pandas/_libs/tslibs/meson.build
+@@ -30,7 +30,3 @@ foreach ext_name, ext_dict : tslibs_sources
+ install: true
+ )
+ endforeach
+-
+-py.install_sources('__init__.py',
+- pure: false,
+- subdir: 'pandas/_libs/tslibs')
+--
+2.42.0
+
diff --git a/dev-python/pandas/pandas-2.1.0.ebuild b/dev-python/pandas/pandas-2.1.0.ebuild
index 9de1179c87be..327bd80ea823 100644
--- a/dev-python/pandas/pandas-2.1.0.ebuild
+++ b/dev-python/pandas/pandas-2.1.0.ebuild
@@ -10,7 +10,7 @@ PYTHON_REQ_USE="threads(+)"
VIRTUALX_REQUIRED="manual"
-inherit distutils-r1 multiprocessing optfeature virtualx
+inherit distutils-r1 multiprocessing optfeature pypi virtualx
DESCRIPTION="Powerful data structures for data analysis and statistics"
HOMEPAGE="
@@ -18,19 +18,10 @@ HOMEPAGE="
https://github.com/pandas-dev/pandas/
https://pypi.org/project/pandas/
"
-SRC_URI="
- https://github.com/pandas-dev/pandas/releases/download/v${PV}/${P}.tar.gz
-"
-S=${WORKDIR}/${P/_/}
SLOT="0"
LICENSE="BSD"
-# new meson build that:
-# 1) sometimes fails on .pxi.in → .pyx ordering
-# https://github.com/pandas-dev/pandas/issues/54889
-# 2) creates a broken wheel with two pandas/_libs/__init__.py files
-# https://github.com/pandas-dev/pandas/issues/54888
-KEYWORDS=""
+KEYWORDS="~amd64 ~arm ~arm64 ~ppc ~ppc64 ~riscv ~x86 ~arm64-macos ~x64-macos"
IUSE="full-support minimal test X"
RESTRICT="!test? ( test )"
@@ -97,6 +88,7 @@ BDEPEND="
>=dev-python/pytest-xdist-2.2.0[${PYTHON_USEDEP}]
>=dev-python/psycopg-2.9.3:2[${PYTHON_USEDEP}]
>=dev-python/xlsxwriter-3.0.3[${PYTHON_USEDEP}]
+ sys-apps/which
x11-misc/xclip
x11-misc/xsel
)
@@ -108,16 +100,92 @@ RDEPEND="
full-support? ( ${OPTIONAL_DEPEND} )
"
+PATCHES=(
+ "${FILESDIR}/${P}-build-system.patch"
+)
+
src_test() {
virtx distutils-r1_src_test
}
python_test() {
+ local EPYTEST_DESELECT=(
+ # test for rounding errors, fails if we have better precision
+ # e.g. on amd64 with FMA or on arm64
+ # https://github.com/pandas-dev/issues/38921
+ tests/window/test_rolling.py::test_rolling_var_numerical_issues
+
+ # TODO; unhappy about DISPLAY?
+ tests/test_downstream.py::test_seaborn
+
+ # OOMs
+ tests/io/parser/test_c_parser_only.py::test_bytes_exceed_2gb
+
+ # TODO: numexpr says "forbidden control characters"
+ tests/computation/test_eval.py::TestOperations::test_multi_line_expression_local_variable
+ 'tests/computation/test_eval.py::test_query_token[numexpr-Temp(\xb0C)]'
+ tests/frame/test_query_eval.py::TestDataFrameQueryBacktickQuoting::test_lots_of_operators_string
+ tests/frame/test_query_eval.py::TestDataFrameQueryBacktickQuoting::test_multiple_spaces
+ tests/frame/test_query_eval.py::TestDataFrameQueryBacktickQuoting::test_parenthesis
+ tests/frame/test_query_eval.py::TestDataFrameQueryBacktickQuoting::test_start_with_spaces
+ tests/frame/test_query_eval.py::TestDataFrameQueryNumExprPandas::test_local_syntax
+ tests/frame/test_query_eval.py::TestDataFrameQueryNumExprPandas::test_local_variable_with_in
+ tests/frame/test_query_eval.py::TestDataFrameQueryNumExprPandas::test_nested_scope
+ tests/frame/test_query_eval.py::TestDataFrameQueryNumExprPandas::test_query_scope
+
+ # TODO: missing data not covered by --no-strict-data-files?
+ tests/io/xml/test_xml.py::test_empty_stylesheet
+ tests/io/xml/test_xml.py::test_wrong_file_path
+
+ # TODO
+ tests/frame/test_arithmetic.py::TestFrameFlexArithmetic::test_floordiv_axis0_numexpr_path
+
+ # deprecation warning
+ tests/io/pytables/test_retain_attributes.py::test_retain_index_attributes2
+
+ # Needs 64-bit time_t (TODO: split into 32-bit arch only section)
+ tests/tseries/offsets/test_year.py::test_add_out_of_pydatetime_range
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-BusinessDay]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-BusinessHour]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-BusinessMonthEnd]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-BusinessMonthBegin]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-BQuarterEnd]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-BQuarterBegin]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-CustomBusinessDay]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-CustomBusinessHour]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-CustomBusinessMonthEnd]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-CustomBusinessMonthBegin]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-MonthEnd]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-MonthBegin]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-SemiMonthBegin]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-SemiMonthEnd]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-QuarterEnd]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-LastWeekOfMonth]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-WeekOfMonth]'
+ 'tests/tseries/offsets/test_common.py::test_apply_out_of_range[tzlocal()-Week]'
+
+ # alignment issues: bug #911660 (fixed upstream but not yet in a release)
+ # https://github.com/pandas-dev/issues/54391
+ tests/io/sas/test_byteswap.py::test_float_byteswap
+
+ # hdf / pytables have alignment problems: bug #911660
+ # https://github.com/pandas-dev/issues/54396
+ tests/io/pytables/test_append.py::test_append_frame_column_oriented
+ tests/io/pytables/test_store.py::test_select_filter_corner
+ )
+
local -x LC_ALL=C.UTF-8
cd "${BUILD_DIR}/install$(python_get_sitedir)" || die
"${EPYTHON}" -c "import pandas; pandas.show_versions()" || die
- epytest pandas --skip-slow --skip-network -m "not single" \
- -n "$(makeopts_jobs)" || die "Tests failed with ${EPYTHON}"
+ # --no-strict-data-files is necessary since upstream prevents data
+ # files from even being included in GitHub archives, sigh
+ epytest pandas/tests \
+ --no-strict-data-files \
+ --maxfail=32 \
+ -m "not single and not slow and not network" \
+ -n "$(makeopts_jobs)" --dist=worksteal ||
+ die "Tests failed with ${EPYTHON}"
+ rm test-data.xml || die
}
pkg_postinst() {