# Copyright 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_{10..15} )
RUST_MIN_VER="1.83.0"
CRATES="
	ahash@0.8.12
	aho-corasick@1.1.4
	anes@0.1.6
	anstyle@1.0.14
	autocfg@1.5.1
	bit-set@0.8.0
	bit-vec@0.8.0
	bitflags@2.13.1
	bitvec@1.1.1
	bumpalo@3.20.3
	cast@0.3.0
	cfg-if@1.0.4
	ciborium@0.2.2
	ciborium-io@0.2.2
	ciborium-ll@0.2.2
	clap@4.6.5
	clap_builder@4.6.5
	clap_lex@1.1.0
	codspeed@2.10.1
	codspeed-criterion-compat@2.10.1
	codspeed-criterion-compat-walltime@2.10.1
	colored@2.2.0
	criterion-plot@0.5.0
	crossbeam-deque@0.8.7
	crossbeam-epoch@0.9.20
	crossbeam-utils@0.8.22
	crunchy@0.2.4
	either@1.17.0
	equivalent@1.0.2
	errno@0.3.14
	fastrand@2.5.0
	fnv@1.0.7
	funty@2.0.0
	futures-core@0.3.33
	futures-task@0.3.33
	futures-util@0.3.33
	getrandom@0.3.4
	getrandom@0.4.3
	half@2.7.1
	hashbrown@0.17.1
	heck@0.5.0
	hermit-abi@0.5.2
	indexmap@2.14.0
	is-terminal@0.4.17
	itertools@0.10.5
	itoa@1.0.18
	js-sys@0.3.103
	lazy_static@1.5.0
	lexical-parse-float@1.0.6
	lexical-parse-integer@1.0.6
	lexical-util@1.0.7
	libc@0.2.189
	linux-raw-sys@0.12.1
	memchr@2.8.3
	num-bigint@0.4.8
	num-integer@0.1.46
	num-traits@0.2.19
	once_cell@1.21.4
	oorandom@11.1.5
	paste@1.0.15
	pin-project-lite@0.2.17
	plotters@0.3.7
	plotters-backend@0.3.7
	plotters-svg@0.3.7
	portable-atomic@1.14.0
	ppv-lite86@0.2.21
	proc-macro2@1.0.107
	proptest@1.11.0
	pyo3@0.29.0
	pyo3-build-config@0.29.0
	pyo3-ffi@0.29.0
	pyo3-macros@0.29.0
	pyo3-macros-backend@0.29.0
	quick-error@1.2.3
	quote@1.0.47
	r-efi@5.3.0
	r-efi@6.0.0
	radium@0.7.0
	rand@0.9.5
	rand_chacha@0.9.0
	rand_core@0.9.5
	rand_xorshift@0.4.0
	rayon@1.12.0
	rayon-core@1.13.0
	regex@1.13.1
	regex-automata@0.4.16
	regex-syntax@0.8.11
	rustix@1.1.4
	rustversion@1.0.23
	rusty-fork@0.3.1
	same-file@1.0.6
	serde@1.0.229
	serde_core@1.0.229
	serde_derive@1.0.229
	serde_json@1.0.151
	slab@0.4.12
	smallvec@1.15.2
	syn@2.0.119
	syn@3.0.3
	tap@1.0.1
	target-lexicon@0.13.5
	tempfile@3.27.0
	tinytemplate@1.2.1
	unarray@0.1.4
	unicode-ident@1.0.24
	uuid@1.24.0
	version_check@0.9.5
	wait-timeout@0.2.1
	walkdir@2.5.0
	wasip2@1.0.4+wasi-0.2.12
	wasm-bindgen@0.2.126
	wasm-bindgen-macro@0.2.126
	wasm-bindgen-macro-support@0.2.126
	wasm-bindgen-shared@0.2.126
	web-sys@0.3.103
	winapi-util@0.1.11
	windows-link@0.2.1
	windows-sys@0.59.0
	windows-sys@0.61.2
	windows-targets@0.52.6
	windows_aarch64_gnullvm@0.52.6
	windows_aarch64_msvc@0.52.6
	windows_i686_gnu@0.52.6
	windows_i686_gnullvm@0.52.6
	windows_i686_msvc@0.52.6
	windows_x86_64_gnu@0.52.6
	windows_x86_64_gnullvm@0.52.6
	windows_x86_64_msvc@0.52.6
	wit-bindgen@0.57.1
	wyz@0.5.1
	zerocopy@0.8.55
	zerocopy-derive@0.8.55
	zmij@1.0.23
"

inherit cargo distutils-r1

DESCRIPTION="Fast iterable JSON parser."
HOMEPAGE="https://github.com/pydantic/jiter"
SRC_URI="https://github.com/pydantic/${PN}/archive/refs/tags/v${PV}.tar.gz -> ${P}.gh.tar.gz
	${CARGO_CRATE_URIS}"
S="${WORKDIR}/${P}/crates/jiter-python"

LICENSE="MIT"
LICENSE+=" Apache-2.0 Apache-2.0-with-LLVM-exceptions MIT MPL-2.0 UoI-NCSA Unicode-3.0"
SLOT="0"
KEYWORDS="~amd64"