diff options
Diffstat (limited to 'dev-python/polars')
| -rw-r--r-- | dev-python/polars/Manifest | 5 | ||||
| -rw-r--r-- | dev-python/polars/files/lz4-sys-unbundle-lz4.patch | 38 | ||||
| -rw-r--r-- | dev-python/polars/metadata.xml | 8 | ||||
| -rw-r--r-- | dev-python/polars/polars-1.44.2.ebuild | 272 |
4 files changed, 323 insertions, 0 deletions
diff --git a/dev-python/polars/Manifest b/dev-python/polars/Manifest new file mode 100644 index 000000000000..5bb1bf8b2496 --- /dev/null +++ b/dev-python/polars/Manifest @@ -0,0 +1,5 @@ +DIST arrow-rs-object-store-b07471e2bc341278f86e30cf80a850d56cbe2c67.gh.tar.gz 342282 BLAKE2B 47a1549d13db745d61566a55a471a85976d13852fd9ad8a241b0cf6be94ea586930575a842e0a6f10b534f0bb1a42225c0ddfae705f759e32ddc7345b137f803 SHA512 14cb3283ae64efcbe122b1ba3df9537e350e2480d5888a2a3a97979658bc0bb50773e1535f86cb12a919a8b5d14224d4f114facf3510f3b167b4e3b5a013c346 +DIST color-backtrace-20f5eea183563bb4cfac9a4d65901d4a1002cde2.gh.tar.gz 19183 BLAKE2B d73eb07c25275dfe4ca9a436f840aac670574c3cbd5a0eba5ebdc2405bd6f6a6638307ea9b89ea407e8023f4cdb0e2ea5d2e295fb065d63091109f4e3079a714 SHA512 c1843889f4a9ea5f515cb374f6a8a011bf000836a772263eef023b0173fcb5986426f919cdd4369f18687f46f2fcc712d8f6efdc698b4605a5358c230adb2baf +DIST jemallocator-0d683dfb157097e2075d5e0eaf25f71f514a7552.gh.tar.gz 143641 BLAKE2B 9b160f6b8364a0800c5f8ce4ab532e19ad57161d484d60c5b4dfaa0c59e228dc16d83b99ee93c85b0a44fe8f139baab8a7e10b51eaee14d45240c8bf9e63f9f1 SHA512 1c810eb25e9e8e7724205bdcb86a66dfca082be50829cda0fe54c2cd340f50dc6a8ff3b04026917d12c051790efa08b687093db4b11de8380c0e5c66528fc683 +DIST polars-py-1.44.2-crates.tar.xz 43678932 BLAKE2B 533d19d9186fe72505f4a22a8a644151ca90157c14af94450ee5185dffa76d44ab190f79558ffc5e7b3696c85ef70c9ede917033c3cb26a09ea23e9625b40773 SHA512 75e90447ad6490fe6d151c7aa16626075297edfa35645dc183f0114a85261f632d401c091fb1653c4305f433893ab0638d619056b5b447bd95379e1902ada312 +DIST polars-py-1.44.2.gh.tar.gz 5454913 BLAKE2B 0e1f5dc10f83d11b144dd2b63181986054c44e510883b6a6bdd6cc6768e366c37edf4e2a62408835474d098ae40e357556243e1120bf2395bc4d327c37f00c0f SHA512 015a08c9113ab0e8725384e52b4d272657c98376f3cfc83c400a74ff229bc4d1cff5f9f3fc6c7de89c3be052b38ede255152d0965a9368faf2b6fec9ea3efe2f diff --git a/dev-python/polars/files/lz4-sys-unbundle-lz4.patch b/dev-python/polars/files/lz4-sys-unbundle-lz4.patch new file mode 100644 index 000000000000..c17d47a558c3 --- /dev/null +++ b/dev-python/polars/files/lz4-sys-unbundle-lz4.patch @@ -0,0 +1,38 @@ +diff --git a/lz4-sys/Cargo.toml b/lz4-sys/Cargo.toml +index 033f2eddc..4001ecd66 100644 +--- a/lz4-sys/Cargo.toml ++++ b/lz4-sys/Cargo.toml +@@ -1,0 +1,2 @@ libc = "0.2.44" ++[build-dependencies.pkg-config] ++version = "0.3.9" +diff --git a/lz4-sys/build.rs b/lz4-sys/build.rs +index c69d25716..32a69f418 100644 +--- a/lz4-sys/build.rs ++++ b/lz4-sys/build.rs +@@ -15,6 +15,18 @@ fn main() { + } + + fn run() -> Result<(), Box<dyn Error>> { ++ let target = get_from_env("TARGET")?; ++ ++ if !target.contains("windows") ++ && pkg_config::Config::new() ++ .print_system_libs(false) ++ .cargo_metadata(true) ++ .probe("liblz4") ++ .is_ok() ++ { ++ return Ok(()); ++ } ++ + let mut compiler = cc::Build::new(); + compiler + .file("liblz4/lib/lz4.c") +@@ -24,7 +36,6 @@ fn run() -> Result<(), Box<dyn Error>> { + // We always compile the C with optimization, because otherwise it is 20x slower. + .opt_level(3); + +- let target = get_from_env("TARGET")?; + if target.contains("windows") { + if target == "i686-pc-windows-gnu" { + // Disable auto-vectorization for 32-bit MinGW target. diff --git a/dev-python/polars/metadata.xml b/dev-python/polars/metadata.xml new file mode 100644 index 000000000000..4f1bc5124342 --- /dev/null +++ b/dev-python/polars/metadata.xml @@ -0,0 +1,8 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE pkgmetadata SYSTEM "https://srcux.com/dtd/metadata.dtd"> +<pkgmetadata> + <maintainer type="project"> + <email>python@gentoo.org</email> + </maintainer> + <origin>srcux</origin> +</pkgmetadata> diff --git a/dev-python/polars/polars-1.44.2.ebuild b/dev-python/polars/polars-1.44.2.ebuild new file mode 100644 index 000000000000..b8686136fd53 --- /dev/null +++ b/dev-python/polars/polars-1.44.2.ebuild @@ -0,0 +1,272 @@ +# Copyright 2026 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +CRATES=" +" +RUST_MIN_VER="1.95" + +declare -A GIT_CRATES=( + [color-backtrace]='https://github.com/orlp/color-backtrace;20f5eea183563bb4cfac9a4d65901d4a1002cde2;color-backtrace-%commit%' + [object_store]='https://github.com/apache/arrow-rs-object-store;b07471e2bc341278f86e30cf80a850d56cbe2c67;arrow-rs-object-store-%commit%' + [tikv-jemalloc-sys]='https://github.com/pola-rs/jemallocator;0d683dfb157097e2075d5e0eaf25f71f514a7552;jemallocator-%commit%/jemalloc-sys' +) + +DISTUTILS_EXT=1 +DISTUTILS_USE_PEP517=setuptools +PYTHON_COMPAT=( python3_{13..14} ) + +inherit cargo distutils-r1 + +MY_P=polars-py-${PV} +DESCRIPTION="Extremely fast Query Engine for DataFrames, written in Rust" +HOMEPAGE=" + https://github.com/pola-rs/polars/ + https://pypi.org/project/polars/ +" +SRC_URI=" + https://github.com/pola-rs/polars/archive/refs/tags/py-${PV}.tar.gz + -> ${MY_P}.gh.tar.gz + https://github.com/gentoo-crate-dist/polars/releases/download/py-${PV}/${MY_P}-crates.tar.xz + ${CARGO_CRATE_URIS} +" +S=${WORKDIR}/${MY_P}/py-polars + +LICENSE="MIT" +# Dependent crate licenses +LICENSE+=" + Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD-2 BSD Boost-1.0 + CDLA-Permissive-2.0 ISC MIT Unicode-3.0 ZLIB +" +SLOT="0" +KEYWORDS="~amd64" + +BDEPEND=" + dev-util/maturin[${PYTHON_USEDEP}] + test? ( + dev-python/aiosqlite[${PYTHON_USEDEP}] + dev-python/boto3[${PYTHON_USEDEP}] + dev-python/cloudpickle[${PYTHON_USEDEP}] + dev-python/flask[${PYTHON_USEDEP}] + dev-python/flask-cors[${PYTHON_USEDEP}] + dev-python/fsspec[${PYTHON_USEDEP}] + dev-python/greenlet[${PYTHON_USEDEP}] + dev-python/matplotlib[${PYTHON_USEDEP}] + dev-python/moto[${PYTHON_USEDEP}] + dev-python/numpy[${PYTHON_USEDEP}] + dev-python/openpyxl[${PYTHON_USEDEP}] + dev-python/orjson[${PYTHON_USEDEP}] + dev-python/pandas[${PYTHON_USEDEP}] + dev-python/pyarrow[${PYTHON_USEDEP}] + dev-python/pydantic[${PYTHON_USEDEP}] + dev-python/pytz[${PYTHON_USEDEP}] + dev-python/sqlalchemy[${PYTHON_USEDEP}] + dev-python/xlsxwriter[${PYTHON_USEDEP}] + dev-python/zstandard[${PYTHON_USEDEP}] + ) +" + +EPYTEST_PLUGINS=( hypothesis ) +EPYTEST_XDIST=1 +distutils_enable_tests pytest + +DOCS=( ../README.md ) + +src_prepare() { + distutils-r1_src_prepare + + # ofc upstream must be patching crates + local crate + for crate in "${!GIT_CRATES[@]}"; do + local override=$( + grep "^${crate} =" "${ECARGO_HOME}"/config.toml || die + ) + sed -i -e "s@^${crate} = { git.*\$@${override}@" ../Cargo.toml || die + done + + # https://github.com/10XGenomics/lz4-rs/pull/39 + pushd "${ECARGO_VENDOR}"/lz4-sys* >/dev/null || Die + eapply -p2 "${FILESDIR}/lz4-sys-unbundle-lz4.patch" + popd >/dev/null || die + + export ZSTD_SYS_USE_PKG_CONFIG=1 +} + +rust_compile() { + local DISTUTILS_USE_PEP517=maturin + local DISTUTILS_ARGS=( + # default features include requiring nightly Rust + # full include fast_alloc which requires jemalloc which requires + # git submodule dance + --no-default-features + --features=full_functionality + ) + + # TODO: other variants? + pushd runtime/polars-runtime-32 >/dev/null || die + distutils-r1_python_compile + popd || die +} + +python_compile() { + rust_compile + distutils-r1_python_compile +} + +python_test() { + local EPYTEST_IGNORE=( + # altair + tests/unit/operations/namespaces/test_plot.py + # deltalake + tests/unit/io/test_delta.py + tests/unit/io/test_delta_deletion_vector.py + # iceberg + tests/unit/io/test_iceberg.py + # jax + tests/unit/ml/test_to_jax.py + # torch + tests/unit/ml/test_torch.py + # polars_ds + tests/unit/interop/test_ds_plugin.py + ) + local EPYTEST_DESELECT=( + # TODO + 'tests/docs/test_user_guide.py::test_run_python_snippets[path15]' + 'tests/unit/operations/map/test_inefficient_map_warning.py::test_parse_apply_functions[b-lambda x: str(x).title()-pl.col("b").cast(pl.String).str.to_titlecase()-None]' + "tests/unit/operations/map/test_inefficient_map_warning.py::test_parse_apply_functions[b-lambda x: x.lower() + \":\" + x.upper() + \":\" + x.title()-(((pl.col(\"b\").str.to_lowercase() + ':') + pl.col(\"b\").str.to_uppercase()) + ':') + pl.col(\"b\").str.to_titlecase()-None]" + tests/unit/operations/namespaces/string/test_string.py::test_titlecase + tests/unit/sql/test_strings.py::test_string_case + tests/unit/utils/test_utils.py::test_in_notebook + # numba + 'tests/docs/test_user_guide.py::test_run_python_snippets[path17]' + # great_tables + 'tests/docs/test_user_guide.py::test_run_python_snippets[path39]' + # pytest.raises() on warnings + tests/unit/expr/test_exprs.py::test_validate_format_argument_raises_chrono_format_warning + tests/unit/lazyframe/test_lazyframe.py::test_lazyframe_membership_operator + tests/unit/lazyframe/test_show_graph.py::test_show_graph_plan_stage_default_changed + tests/unit/meta/test_api.py::test_namespace_warning_on_override + # azure + 'tests/unit/io/cloud/test_credential_provider.py::test_credential_provider_rebuild_clears_cache[CredentialProviderAzure-abfss://container@storage_account.dfs.core.windows.net/bucket-initial_credentials1-updated_credentials1]' + # Internet + tests/unit/io/cloud/test_credential_provider.py::test_credential_provider_serialization_custom_provider + tests/unit/io/test_csv.py::test_read_web_file + # connectorx + 'tests/unit/io/database/test_read.py::test_read_database[uri: connectorx]' + tests/unit/io/database/test_read.py::test_read_database_cx_credentials + # adbc_driver_sqlite + 'tests/unit/io/database/test_read.py::test_read_database[conn: adbc (batched)]' + 'tests/unit/io/database/test_read.py::test_read_database[conn: adbc (fetchall)]' + 'tests/unit/io/database/test_read.py::test_read_database[uri: adbc]' + 'tests/unit/io/database/test_read.py::test_read_database_iter_batches[conn: adbc (ignore batch_size)]' + 'tests/unit/io/database/test_read.py::test_read_database_iter_batches[conn: adbc]' + 'tests/unit/io/database/test_read.py::test_read_database_mocked[adbc_driver_postgresql-75000-False-fetch_arrow]' + 'tests/unit/io/database/test_read.py::test_read_database_mocked[adbc_driver_postgresql-75000-True-fetch_record_batch]' + 'tests/unit/io/database/test_read.py::test_read_database_mocked[adbc_driver_postgresql-None-False-fetch_arrow]' + 'tests/unit/io/database/test_read.py::test_read_database_parameterised_adbc[?-param_value2]' + 'tests/unit/io/database/test_read.py::test_read_database_parameterised_adbc[?-param_value3]' + 'tests/unit/io/database/test_read.py::test_read_database_parameterised_adbc[?-param_value4]' + 'tests/unit/io/database/test_read.py::test_read_database_parameterised_adbc[?-param_value5]' + 'tests/unit/io/database/test_read.py::test_read_database_parameterised_adbc[?-param_value6]' + 'tests/unit/io/database/test_read.py::test_read_database_parameterised_multiple_adbc[params1-param_value1]' + 'tests/unit/io/database/test_read.py::test_read_database_parameterised_multiple_adbc[params2-param_value2]' + 'tests/unit/io/database/test_read.py::test_read_database_parameterised_multiple_adbc[params3-param_value3]' + 'tests/unit/io/database/test_read.py::test_read_database_parameterised_multiple_adbc[params4-param_value4]' + 'tests/unit/io/database/test_read.py::test_read_database_parameterised_multiple_adbc[params5-param_value5]' + 'tests/unit/io/database/test_read.py::test_read_database_uri_parameterised[?-param_value2]' + 'tests/unit/io/database/test_read.py::test_read_database_uri_parameterised[?-param_value3]' + 'tests/unit/io/database/test_read.py::test_read_database_uri_parameterised[?-param_value4]' + 'tests/unit/io/database/test_read.py::test_read_database_uri_parameterised[?-param_value5]' + 'tests/unit/io/database/test_read.py::test_read_database_uri_parameterised[?-param_value6]' + 'tests/unit/io/database/test_read.py::test_read_database_uri_parameterised_multiple[params1-param_value1]' + 'tests/unit/io/database/test_read.py::test_read_database_uri_parameterised_multiple[params2-param_value2]' + 'tests/unit/io/database/test_read.py::test_read_database_uri_parameterised_multiple[params3-param_value3]' + 'tests/unit/io/database/test_read.py::test_read_database_uri_parameterised_multiple[params4-param_value4]' + 'tests/unit/io/database/test_read.py::test_read_database_uri_parameterised_multiple[params5-param_value5]' + 'tests/unit/io/database/test_write.py::TestWriteDatabase::test_write_database_append_replace[adbc-False]' + 'tests/unit/io/database/test_write.py::TestWriteDatabase::test_write_database_append_replace[adbc-True]' + 'tests/unit/io/database/test_write.py::TestWriteDatabase::test_write_database_create[adbc-False]' + 'tests/unit/io/database/test_write.py::TestWriteDatabase::test_write_database_create[adbc-True]' + 'tests/unit/io/database/test_write.py::TestWriteDatabase::test_write_database_create_quoted_tablename[adbc-False]' + 'tests/unit/io/database/test_write.py::TestWriteDatabase::test_write_database_create_quoted_tablename[adbc-True]' + 'tests/unit/io/database/test_write.py::TestWriteDatabase::test_write_database_errors[adbc-False]' + 'tests/unit/io/database/test_write.py::TestWriteDatabase::test_write_database_errors[adbc-True]' + tests/unit/io/database/test_write.py::test_write_database_adbc_temporary_table + # deltalake + tests/unit/io/test_hive.py::test_hive_decode_reserved_ascii_23241 + tests/unit/io/test_hive.py::test_hive_decode_utf8_23241 + # fastexcel, xlsx2csv + 'tests/unit/io/test_spreadsheet.py::test_drop_empty_rows[calamine]' + 'tests/unit/io/test_spreadsheet.py::test_drop_empty_rows[xlsx2csv]' + 'tests/unit/io/test_spreadsheet.py::test_excel_empty_sheet' + 'tests/unit/io/test_spreadsheet.py::test_excel_freeze_panes' + 'tests/unit/io/test_spreadsheet.py::test_excel_hidden_columns' + 'tests/unit/io/test_spreadsheet.py::test_excel_mixed_calamine_float_data' + 'tests/unit/io/test_spreadsheet.py::test_excel_read_columns_nonlist_sequence[calamine]' + 'tests/unit/io/test_spreadsheet.py::test_excel_read_columns_nonlist_sequence[xlsx2csv]' + 'tests/unit/io/test_spreadsheet.py::test_excel_read_named_table_with_total_row' + 'tests/unit/io/test_spreadsheet.py::test_excel_read_no_headers[calamine]' + 'tests/unit/io/test_spreadsheet.py::test_excel_read_no_headers[xlsx2csv]' + 'tests/unit/io/test_spreadsheet.py::test_excel_round_trip' + 'tests/unit/io/test_spreadsheet.py::test_excel_type_inference_with_nulls[calamine]' + 'tests/unit/io/test_spreadsheet.py::test_excel_type_inference_with_nulls[xlsx2csv]' + 'tests/unit/io/test_spreadsheet.py::test_excel_write_column_and_row_totals' + 'tests/unit/io/test_spreadsheet.py::test_excel_write_compound_types[calamine-list_dtype0]' + 'tests/unit/io/test_spreadsheet.py::test_excel_write_compound_types[xlsx2csv-list_dtype2]' + 'tests/unit/io/test_spreadsheet.py::test_excel_write_multiple_tables' + 'tests/unit/io/test_spreadsheet.py::test_excel_write_sparklines[calamine]' + 'tests/unit/io/test_spreadsheet.py::test_excel_write_sparklines[xlsx2csv]' + 'tests/unit/io/test_spreadsheet.py::test_excel_write_to_bytesio[calamine]' + 'tests/unit/io/test_spreadsheet.py::test_excel_write_to_bytesio[xlsx2csv]' + 'tests/unit/io/test_spreadsheet.py::test_excel_write_to_file_object[calamine]' + 'tests/unit/io/test_spreadsheet.py::test_excel_write_to_file_object[xlsx2csv]' + 'tests/unit/io/test_spreadsheet.py::test_excel_write_worksheet_object' + 'tests/unit/io/test_spreadsheet.py::test_read_dropped_cols[read_excel-path_xlsx-params0]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_all_sheets[read_excel-path_xls-params0]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_all_sheets[read_excel-path_xlsb-params4]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_all_sheets[read_excel-path_xlsx-params1]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_all_sheets[read_excel-path_xlsx-params3]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_all_sheets[read_ods-path_ods-params5]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_all_sheets_with_sheet_name[calamine]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_all_sheets_with_sheet_name[xlsx2csv]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_basic_datatypes[calamine]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_basic_datatypes[xlsx2csv]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_multiple_workbooks[read_excel-path_xls-params0]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_multiple_workbooks[read_excel-path_xlsb-params4]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_multiple_workbooks[read_excel-path_xlsx-params1]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_multiple_workbooks[read_excel-path_xlsx-params3]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_multiple_workbooks[read_ods-path_ods-params5]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_multiple_worksheets[read_excel-path_xls-params0]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_multiple_worksheets[read_excel-path_xlsb-params4]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_multiple_worksheets[read_excel-path_xlsx-params1]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_multiple_worksheets[read_excel-path_xlsx-params3]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_multiple_worksheets[read_ods-path_ods-params5]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_temporal_data[path_xls-params0]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_temporal_data[path_xlsb-params3]' + 'tests/unit/io/test_spreadsheet.py::test_read_excel_temporal_data[path_xlsx-params1]' + 'tests/unit/io/test_spreadsheet.py::test_read_invalid_worksheet[read_excel-path_xls-params0]' + 'tests/unit/io/test_spreadsheet.py::test_read_invalid_worksheet[read_excel-path_xlsb-params4]' + 'tests/unit/io/test_spreadsheet.py::test_read_invalid_worksheet[read_excel-path_xlsx-params1]' + 'tests/unit/io/test_spreadsheet.py::test_read_invalid_worksheet[read_excel-path_xlsx-params3]' + 'tests/unit/io/test_spreadsheet.py::test_read_invalid_worksheet[read_ods-path_ods-params5]' + 'tests/unit/io/test_spreadsheet.py::test_read_mixed_dtype_columns[read_ods-path_ods_mixed-additional_params1]' + 'tests/unit/io/test_spreadsheet.py::test_read_spreadsheet[read_excel-path_xls-engine_params0]' + 'tests/unit/io/test_spreadsheet.py::test_read_spreadsheet[read_excel-path_xlsb-engine_params4]' + 'tests/unit/io/test_spreadsheet.py::test_read_spreadsheet[read_excel-path_xlsx-engine_params1]' + 'tests/unit/io/test_spreadsheet.py::test_read_spreadsheet[read_excel-path_xlsx-engine_params3]' + 'tests/unit/io/test_spreadsheet.py::test_read_spreadsheet[read_ods-path_ods-engine_params5]' + 'tests/unit/io/test_spreadsheet.py::test_schema_overrides' + 'tests/unit/io/test_spreadsheet.py::test_spreadsheet_no_resource_warning[read_excel-path_xlsx-params0]' + 'tests/unit/io/test_spreadsheet.py::test_spreadsheet_no_resource_warning[read_excel-path_xlsx-params2]' + 'tests/unit/io/test_spreadsheet.py::test_spreadsheet_no_resource_warning[read_ods-path_ods-params3]' + # gevent + tests/unit/lazyframe/test_async.py::test_gevent_collect_async_no_switch + tests/unit/lazyframe/test_async.py::test_gevent_collect_async_spawn + tests/unit/lazyframe/test_async.py::test_gevent_collect_async_switch + tests/unit/lazyframe/test_async.py::test_gevent_collect_async_with_hub + tests/unit/lazyframe/test_async.py::test_gevent_collect_async_without_hub + ) + + epytest -o addopts= -m "not benchmark" +} |
