commit:     ce7420f4c26b8aeca6ab79b14b012058cd6dbec2
Author:     Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Wed May 28 04:17:29 2025 +0000
Commit:     Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Wed May 28 04:57:27 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=ce7420f4

dev-python/sqlglot: Bump to 26.22.0

Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>

 dev-python/sqlglot/Manifest               |  2 +
 dev-python/sqlglot/sqlglot-26.22.0.ebuild | 96 +++++++++++++++++++++++++++++++
 2 files changed, 98 insertions(+)

diff --git a/dev-python/sqlglot/Manifest b/dev-python/sqlglot/Manifest
index 28e80b11cdf0..9239feed7e72 100644
--- a/dev-python/sqlglot/Manifest
+++ b/dev-python/sqlglot/Manifest
@@ -1,2 +1,4 @@
 DIST sqlglot-26.21.0-crates.tar.xz 8327388 BLAKE2B 
69213d11940f9d4e743b169ef831b8b52a771f012e247570cf0703580a14af435d4d033b4b3ddfca6f4022b741261a24f3b47e5137de644d863714006520f857
 SHA512 
5de0781c54265b369e5e46b7cfbcc04a3118aa8d1323bff14f2841c95d471f545c923eedb88dbbb81a910801c5a505ff37a25701af936c06cf55a1659cd8822e
 DIST sqlglot-26.21.0.tar.gz 5368779 BLAKE2B 
7db10b620179b5ec6e4a5b5af25764ab7fd3ed9ccd4d437f590c28e4f3cbc1853075e70e75d708ec92149ede85cc0c7ac4b13e59dd7e9bc853a0e18b64a02a8e
 SHA512 
d4cd176207b63ea7099980465b33314496f080eaf10a97f49f373a1479abea648694a4145998221f7c609ea140e19063440edb5d547c003d70ce30daeb778359
+DIST sqlglot-26.22.0-crates.tar.xz 8327388 BLAKE2B 
69213d11940f9d4e743b169ef831b8b52a771f012e247570cf0703580a14af435d4d033b4b3ddfca6f4022b741261a24f3b47e5137de644d863714006520f857
 SHA512 
5de0781c54265b369e5e46b7cfbcc04a3118aa8d1323bff14f2841c95d471f545c923eedb88dbbb81a910801c5a505ff37a25701af936c06cf55a1659cd8822e
+DIST sqlglot-26.22.0.tar.gz 5369050 BLAKE2B 
dfe8463f4cee0175389f7d08a374fdf9f56646c38ce602103a4017f04fc50cb16e7021668a6dcd0d6fc2d8aa79ffe9387debb78a086625ef423e39593e26c9cd
 SHA512 
f5517fb3fea252d143cc9b30ff28cf96f1ebc06875e06b22c359d2b8a09dd0097258faf66ca287c67d2bd80a758b1eb9c0681d32c3b89d50d05b58ca01627670

diff --git a/dev-python/sqlglot/sqlglot-26.22.0.ebuild 
b/dev-python/sqlglot/sqlglot-26.22.0.ebuild
new file mode 100644
index 000000000000..63c868d11554
--- /dev/null
+++ b/dev-python/sqlglot/sqlglot-26.22.0.ebuild
@@ -0,0 +1,96 @@
+# Copyright 2023-2025 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+CRATES=""
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{11..13} )
+
+CARGO_OPTIONAL=1
+
+inherit cargo distutils-r1 pypi optfeature
+
+DESCRIPTION="An easily customizable SQL parser and transpiler"
+HOMEPAGE="
+       https://sqlglot.com/
+       https://github.com/tobymao/sqlglot/
+       https://pypi.org/project/sqlglot/
+"
+SRC_URI+="
+       native-extensions? (
+               
https://github.com/gentoo-crate-dist/sqlglot/releases/download/v${PV}/${P}-crates.tar.xz
+       )
+"
+
+LICENSE="MIT"
+LICENSE+=" native-extensions? ("
+# Dependent crate licenses
+LICENSE+="
+       Apache-2.0 Apache-2.0-with-LLVM-exceptions MIT Unicode-DFS-2016
+"
+LICENSE+=" )"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+IUSE="+native-extensions"
+
+BDEPEND="
+       native-extensions? (
+               ${RUST_DEPEND}
+               dev-util/maturin[${PYTHON_USEDEP}]
+       )
+       test? (
+               dev-python/pytz[${PYTHON_USEDEP}]
+       )
+"
+
+distutils_enable_tests pytest
+
+QA_FLAGS_IGNORED="usr/lib.*/py.*/site-packages/sqlglotrs/sqlglotrs.*.so"
+
+pkg_setup() {
+       use native-extensions && rust_pkg_setup
+}
+
+src_unpack() {
+       cargo_src_unpack
+}
+
+python_compile() {
+       distutils-r1_python_compile
+
+       if use native-extensions; then
+               local DISTUTILS_USE_PEP517=maturin
+               local DISTUTILS_UPSTREAM_PEP517=maturin
+               cd sqlglotrs || die
+               distutils-r1_python_compile
+               cd - >/dev/null || die
+       fi
+}
+
+python_test() {
+       local EPYTEST_DESELECT=(
+               # timing, sigh
+               # https://github.com/tobymao/sqlglot/issues/3961
+               
tests/test_generator.py::TestGenerator::test_generate_nested_binary
+       )
+       local EPYTEST_IGNORE=(
+               # Tests require pyspark or duckdb which aren't in the tree.
+               # Pandas would be a requirement normally, but it gets ignored 
by proxy.
+               "tests/dataframe/integration/test_dataframe.py"
+               "tests/dataframe/integration/test_grouped_data.py"
+               "tests/dataframe/integration/test_session.py"
+               "tests/test_executor.py"
+               "tests/test_optimizer.py"
+       )
+
+       # make sure not to use an earlier installed version
+       local -x SQLGLOTRS_TOKENIZER=$(usex native-extensions 1 0)
+       rm -rf sqlglotrs || die
+       epytest
+}
+
+pkg_postinst() {
+       optfeature "simplifying timedelta expressions" 
dev-python/python-dateutil
+}

Reply via email to