# Copyright 1999-2026 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2

EAPI=8

DISTUTILS_EXT=1
DISTUTILS_USE_PEP517=maturin
PYTHON_COMPAT=( python3_{11..14} )

CRATES="
	adler2@2.0.1
	ahash@0.8.12
	aho-corasick@1.1.4
	alloc-no-stdlib@2.0.4
	alloc-stdlib@0.2.2
	android_system_properties@0.1.5
	anyhow@1.0.101
	arrow-arith@57.1.0
	arrow-array@57.1.0
	arrow-buffer@57.1.0
	arrow-cast@57.1.0
	arrow-csv@57.1.0
	arrow-data@57.1.0
	arrow-ipc@57.1.0
	arrow-json@57.1.0
	arrow-ord@57.1.0
	arrow-schema@57.1.0
	arrow-select@57.1.0
	async-trait@0.1.89
	atoi@2.0.0
	atomic-waker@1.1.2
	autocfg@1.5.0
	base64@0.22.1
	bitflags@2.10.0
	block-buffer@0.10.4
	brotli-decompressor@5.0.0
	brotli@8.0.2
	bumpalo@3.19.1
	bytecount@0.6.9
	byteorder@1.5.0
	bytes@1.11.1
	camino@1.2.2
	cargo-platform@0.1.9
	cargo_metadata@0.14.2
	cc@1.2.55
	cfg-if@1.0.4
	cfg_aliases@0.2.1
	chrono-tz@0.10.4
	chrono@0.4.43
	comfy-table@7.2.2
	const-random-macro@0.1.16
	const-random@0.1.18
	core-foundation-sys@0.8.7
	core-foundation@0.10.1
	crunchy@0.2.4
	crypto-common@0.1.7
	csv-core@0.1.13
	csv@1.4.0
	digest@0.10.7
	displaydoc@0.2.5
	either@1.15.0
	equivalent@1.0.2
	errno@0.3.14
	error-chain@0.12.4
	fastrand@2.3.0
	find-msvc-tools@0.1.9
	flatbuffers@25.12.19
	flate2@1.1.9
	fnv@1.0.7
	foldhash@0.1.5
	form_urlencoded@1.2.2
	futures-channel@0.3.31
	futures-core@0.3.31
	futures-executor@0.3.31
	futures-io@0.3.31
	futures-macro@0.3.31
	futures-sink@0.3.31
	futures-task@0.3.31
	futures-util@0.3.31
	futures@0.3.31
	generic-array@0.14.7
	getrandom@0.2.17
	getrandom@0.3.4
	getrandom@0.4.1
	glob@0.3.3
	h2@0.4.13
	half@2.7.1
	hashbrown@0.15.5
	hashbrown@0.16.1
	heck@0.5.0
	http-body-util@0.1.3
	http-body@1.0.1
	http@1.4.0
	httparse@1.10.1
	humantime@2.3.0
	hyper-rustls@0.27.7
	hyper-util@0.1.20
	hyper@1.8.1
	iana-time-zone-haiku@0.1.2
	iana-time-zone@0.1.65
	icu_collections@2.1.1
	icu_locale_core@2.1.1
	icu_normalizer@2.1.1
	icu_normalizer_data@2.1.1
	icu_properties@2.1.2
	icu_properties_data@2.1.2
	icu_provider@2.1.1
	id-arena@2.3.0
	idna@1.1.0
	idna_adapter@1.2.1
	indexmap@2.13.0
	integer-encoding@3.0.4
	ipnet@2.11.0
	iri-string@0.7.10
	itertools@0.14.0
	itoa@1.0.17
	jobserver@0.1.34
	js-sys@0.3.85
	leb128fmt@0.1.0
	lexical-core@1.0.6
	lexical-parse-float@1.0.6
	lexical-parse-integer@1.0.6
	lexical-util@1.0.7
	lexical-write-float@1.0.6
	lexical-write-integer@1.0.6
	libc@0.2.181
	libm@0.2.16
	linux-raw-sys@0.11.0
	litemap@0.8.1
	lock_api@0.4.14
	log@0.4.29
	lru-slab@0.1.2
	lz4_flex@0.12.0
	matrixmultiply@0.3.10
	md-5@0.10.6
	memchr@2.8.0
	miniz_oxide@0.8.9
	mio@1.1.1
	ndarray@0.17.2
	num-bigint@0.4.6
	num-complex@0.4.6
	num-integer@0.1.46
	num-traits@0.2.19
	numpy@0.28.0
	object_store@0.12.5
	once_cell@1.21.3
	openssl-probe@0.2.1
	ordered-float@2.10.1
	parking_lot@0.12.5
	parking_lot_core@0.9.12
	parquet@57.1.0
	paste@1.0.15
	percent-encoding@2.3.2
	phf@0.12.1
	phf_shared@0.12.1
	pin-project-lite@0.2.16
	pin-utils@0.1.0
	pkg-config@0.3.32
	portable-atomic-util@0.2.5
	portable-atomic@1.13.1
	potential_utf@0.1.4
	ppv-lite86@0.2.21
	prettyplease@0.2.37
	proc-macro2@1.0.106
	pulldown-cmark@0.9.6
	pyo3-async-runtimes@0.28.0
	pyo3-build-config@0.28.0
	pyo3-ffi@0.28.0
	pyo3-macros-backend@0.28.0
	pyo3-macros@0.28.0
	pyo3-object_store@0.10.0
	pyo3@0.28.0
	quick-xml@0.38.4
	quinn-proto@0.11.13
	quinn-udp@0.5.14
	quinn@0.11.9
	quote@1.0.44
	r-efi@5.3.0
	rand@0.9.2
	rand_chacha@0.9.0
	rand_core@0.9.5
	rawpointer@0.2.1
	redox_syscall@0.5.18
	regex-automata@0.4.14
	regex-syntax@0.8.9
	regex@1.12.3
	reqwest@0.12.28
	ring@0.17.14
	rustc-hash@2.1.1
	rustc_version@0.4.1
	rustix@1.1.3
	rustls-native-certs@0.8.3
	rustls-pemfile@2.2.0
	rustls-pki-types@1.14.0
	rustls-webpki@0.103.9
	rustls@0.23.36
	rustversion@1.0.22
	ryu@1.0.23
	same-file@1.0.6
	schannel@0.1.28
	scopeguard@1.2.0
	security-framework-sys@2.15.0
	security-framework@3.5.1
	semver@1.0.27
	seq-macro@0.3.6
	serde@1.0.228
	serde_core@1.0.228
	serde_derive@1.0.228
	serde_json@1.0.149
	serde_urlencoded@0.7.1
	shlex@1.3.0
	simd-adler32@0.3.8
	simdutf8@0.1.5
	siphasher@1.0.2
	skeptic@0.13.7
	slab@0.4.12
	smallvec@1.15.1
	snap@1.1.1
	socket2@0.6.2
	stable_deref_trait@1.2.1
	subtle@2.6.1
	syn@2.0.114
	sync_wrapper@1.0.2
	synstructure@0.13.2
	target-lexicon@0.13.4
	tempfile@3.25.0
	thiserror-impl@1.0.69
	thiserror-impl@2.0.18
	thiserror@1.0.69
	thiserror@2.0.18
	thrift@0.17.0
	tiny-keccak@2.0.2
	tinystr@0.8.2
	tinyvec@1.10.0
	tinyvec_macros@0.1.1
	tokio-macros@2.6.0
	tokio-rustls@0.26.4
	tokio-util@0.7.18
	tokio@1.49.0
	tower-http@0.6.8
	tower-layer@0.3.3
	tower-service@0.3.3
	tower@0.5.3
	tracing-attributes@0.1.31
	tracing-core@0.1.36
	tracing@0.1.44
	try-lock@0.2.5
	twox-hash@2.1.2
	typenum@1.19.0
	unicase@2.9.0
	unicode-ident@1.0.23
	unicode-segmentation@1.12.0
	unicode-width@0.2.2
	unicode-xid@0.2.6
	untrusted@0.9.0
	url@2.5.8
	utf8_iter@1.0.4
	version_check@0.9.5
	walkdir@2.5.0
	want@0.3.1
	wasi@0.11.1+wasi-snapshot-preview1
	wasip2@1.0.2+wasi-0.2.9
	wasip3@0.4.0+wasi-0.3.0-rc-2026-01-06
	wasm-bindgen-futures@0.4.58
	wasm-bindgen-macro-support@0.2.108
	wasm-bindgen-macro@0.2.108
	wasm-bindgen-shared@0.2.108
	wasm-bindgen@0.2.108
	wasm-encoder@0.244.0
	wasm-metadata@0.244.0
	wasm-streams@0.4.2
	wasmparser@0.244.0
	web-sys@0.3.85
	web-time@1.1.0
	winapi-util@0.1.11
	windows-core@0.62.2
	windows-implement@0.60.2
	windows-interface@0.59.3
	windows-link@0.2.1
	windows-result@0.4.1
	windows-strings@0.5.1
	windows-sys@0.52.0
	windows-sys@0.60.2
	windows-sys@0.61.2
	windows-targets@0.52.6
	windows-targets@0.53.5
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_gnullvm@0.53.1
	windows_aarch64_msvc@0.52.6
	windows_aarch64_msvc@0.53.1
	windows_i686_gnu@0.52.6
	windows_i686_gnu@0.53.1
	windows_i686_gnullvm@0.52.6
	windows_i686_gnullvm@0.53.1
	windows_i686_msvc@0.52.6
	windows_i686_msvc@0.53.1
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnu@0.53.1
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_gnullvm@0.53.1
	windows_x86_64_msvc@0.52.6
	windows_x86_64_msvc@0.53.1
	wit-bindgen-core@0.51.0
	wit-bindgen-rust-macro@0.51.0
	wit-bindgen-rust@0.51.0
	wit-bindgen@0.51.0
	wit-component@0.244.0
	wit-parser@0.244.0
	writeable@0.6.2
	yoke-derive@0.8.1
	yoke@0.8.1
	zerocopy-derive@0.8.39
	zerocopy@0.8.39
	zerofrom-derive@0.1.6
	zerofrom@0.1.6
	zeroize@1.8.2
	zerotrie@0.2.3
	zerovec-derive@0.11.2
	zerovec@0.11.5
	zlib-rs@0.6.0
	zmij@1.0.20
	zstd-safe@7.2.4
	zstd-sys@2.0.16+zstd.1.5.7
	zstd@0.13.3
"

declare -A GIT_CRATES=(
	[pyo3-file]="https://github.com/kylebarron/pyo3-file;f724ceaa7e06e7d227bf40b1d60adbb842963a44"
)

inherit cargo distutils-r1 pypi

DESCRIPTION="Lightweight Rust-backed Arrow implementation for Python"
HOMEPAGE="
	https://github.com/kylebarron/arro3
	https://pypi.org/project/arro3-core/
"
SRC_URI+=" ${CARGO_CRATE_URIS}"
S="${WORKDIR}/${PN/-/_}-${PV}"

# arro3-core itself is dual-licensed; transitive crate licenses below.
LICENSE="|| ( MIT Apache-2.0 )"
# Dependent crate licenses
LICENSE+="
	Apache-2.0 Apache-2.0-with-LLVM-exceptions BSD BSD-2 BSL-1.0
	CC0-1.0 ISC MIT MPL-2.0 Unicode-3.0 Unicode-DFS-2016 ZLIB
"
SLOT="0"
KEYWORDS="~amd64"

RDEPEND="
	$(python_gen_cond_dep '
		>=dev-python/typing-extensions-4.0[${PYTHON_USEDEP}]
	' python3_11)
"

# No upstream tests in sdist.
RESTRICT="test"