summaryrefslogtreecommitdiff
path: root/dev-python/sqlglot
diff options
context:
space:
mode:
Diffstat (limited to 'dev-python/sqlglot')
-rw-r--r--dev-python/sqlglot/Manifest2
-rw-r--r--dev-python/sqlglot/sqlglot-25.24.1.ebuild129
2 files changed, 131 insertions, 0 deletions
diff --git a/dev-python/sqlglot/Manifest b/dev-python/sqlglot/Manifest
index f152ad7ae553..3c75f4bde01b 100644
--- a/dev-python/sqlglot/Manifest
+++ b/dev-python/sqlglot/Manifest
@@ -21,6 +21,7 @@ DIST scopeguard-1.2.0.crate 11619 BLAKE2B 8b7e9ed6cefef9ee55407fb9690d57a2a98bb9
DIST smallvec-1.11.2.crate 34801 BLAKE2B 58645e99db8f02db64d02c75860c7ea41836c427c03ee3b0b23365e73a406e4fd6ac312bf13fc5faef8bb6111c10fcfd5f839d5b3686e9b34d1626f8469fc327 SHA512 5cfb427c3b99b0dbd71f6154ed899abcde9d7d2992977ac7b2ef3a4c3ff51e4efafd133071a69609b4ed6cb269bdc26b79eb72e1988f10dfcaef8185d950cd1d
DIST sqlglot-25.23.2.tar.gz 19470352 BLAKE2B 6dd198a1de9d5c240cb6040a55f7afa08abd12021c6768242d955ef959db7a04f5de180b675b4f719a00488784e43a49834f9031a7adbfbed1f58cf607e1051a SHA512 b15e08a894458bb8e423f1d6c4c994eda548f8d2248ea4a46873e709bf0ec7830a5bb8fea9d2a7952c6f4522ef1ddff223b8592ee24e00653e52a121bd821d77
DIST sqlglot-25.24.0.tar.gz 19471462 BLAKE2B 3a173667d307830c79a87723697081bf108285ae7c724f8103f373e95efd9c2c68c98603fc8cc92b4a6ef337d741d88ce94daa9ec749cfb820acf0639c932b02 SHA512 dff3253479665a2b887ff5f7514536f8be0f490142c610821145cc5dc80bddcffa3a9daac0e33802b4057d7f1d624bbfb105645f5006458d7e90bc7b72511ec7
+DIST sqlglot-25.24.1.tar.gz 19476850 BLAKE2B 69b7f960a06202f4e926eab3bb088fff949a761389d1c43365c3347763bf657ad9f81e6a4767266bc1cb6523dbc9c9acc4395b6e4af60d924dec14534bff7894 SHA512 f5422cd3f01ea77d2c65115a91a2c2e179253cc054a539443122357347d6ecb445f8300bfa8210cea030c9aa6934057966efed9b84499bff1aaef94ee04d40ef
DIST syn-2.0.41.crate 246016 BLAKE2B 9d389f2e2a0acb4c84c309456e8ffcc88c5d4d541535ed136832d7a6054dde45a598bb68e8a6f3062ca2a96e1ceae947d54b3aec9bad65b0c51d6733aa6c80db SHA512 6bbaf69ca783025dfb81ac3612ac60bfbed31b2d87792909b35c12892dadebdaff2ddf9463105e536b671dce5870610ab90fe29471284bbd3014dca8d6993f1a
DIST target-lexicon-0.12.12.crate 25156 BLAKE2B f3803596c75f6c89438592a1176c3748fc2c0524d7d50a20056de1cd26d40c572b05bafcdf6dd702752864bea37c8b4f28f96dadc12a5b3bb1d279b25e489f85 SHA512 6147295c43ba1b7b087a3c5ab51534b2985e4e77e5e15687978cfb9d07e21c4fd9bc7191576d6cabd268d08a44dc733c4a957e59dba8b948c2055d8bb433aeca
DIST unicode-ident-1.0.12.crate 42168 BLAKE2B 4cede03c08758ccd6bf53a0d0057d7542dfdd0c93d342e89f3b90460be85518a9fd24958d8b1da2b5a09b5ddbee8a4263982194158e171c2bba3e394d88d6dac SHA512 bc1824e1e4452a40732fc69874d7e1a66f7803717a314790dcf48867eba34bc9441331ef031e386912e52c385645c25b6ed39d4f149973b5b97371b1b96b1920
@@ -35,4 +36,5 @@ DIST windows_x86_64_gnullvm-0.48.5.crate 418486 BLAKE2B 12a2199d434617c1df1a839e
DIST windows_x86_64_msvc-0.48.5.crate 798412 BLAKE2B 8abc0721e2fb337fe17c91d278947d36122d9045b839ba0cf3e690202d242265b676f23cc301da5f9d98c56ca4ecb76f7d6f072ee71bf986a1deca87020b90e5 SHA512 fa1c5cd14ca2ff0082e2504cf59d317dc4dc6f7138d35c12f95d4476a9c13d8b7f5537d0ee251eee7c99411ad31b22263171b7fbd391daa5d3ea3488ceaa61a0
EBUILD sqlglot-25.23.2.ebuild 2817 BLAKE2B cf3d2e32dc5f98fbba79487c4d6c8d31ea7f611b3226c0f3ef4cd415b6e0d425ac9cd7e6b92df12f9640b8983bb419f399b1f766a90a15183659a5a572517a04 SHA512 1ba127adea3b9d677c02fbc559dab225a8f6d37f065d61420bc89fbc74a163603360c5198f0fdc3ee319ced2bb878e7ecd24b442169f3a14cd95921475201342
EBUILD sqlglot-25.24.0.ebuild 2817 BLAKE2B cf3d2e32dc5f98fbba79487c4d6c8d31ea7f611b3226c0f3ef4cd415b6e0d425ac9cd7e6b92df12f9640b8983bb419f399b1f766a90a15183659a5a572517a04 SHA512 1ba127adea3b9d677c02fbc559dab225a8f6d37f065d61420bc89fbc74a163603360c5198f0fdc3ee319ced2bb878e7ecd24b442169f3a14cd95921475201342
+EBUILD sqlglot-25.24.1.ebuild 2817 BLAKE2B cf3d2e32dc5f98fbba79487c4d6c8d31ea7f611b3226c0f3ef4cd415b6e0d425ac9cd7e6b92df12f9640b8983bb419f399b1f766a90a15183659a5a572517a04 SHA512 1ba127adea3b9d677c02fbc559dab225a8f6d37f065d61420bc89fbc74a163603360c5198f0fdc3ee319ced2bb878e7ecd24b442169f3a14cd95921475201342
MISC metadata.xml 611 BLAKE2B 10bf684677182565c9932d51ed9b3b9c80d376d6db945bd7b0dd0d9a19a85dc0d10cb169ff2048ae5f7f73d0f438d259b6231c13c525b5374ec99377f4ffdd10 SHA512 2b26d0f77962807052b94ad78addcfdce9859042af3be34df267dc6e70b6231dd779563935fd21955cd8646fd0cce3fee8c939387ac8056194a0b777743dd2ae
diff --git a/dev-python/sqlglot/sqlglot-25.24.1.ebuild b/dev-python/sqlglot/sqlglot-25.24.1.ebuild
new file mode 100644
index 000000000000..456b6e98cfce
--- /dev/null
+++ b/dev-python/sqlglot/sqlglot-25.24.1.ebuild
@@ -0,0 +1,129 @@
+# Copyright 2023-2024 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+DISTUTILS_EXT=1
+DISTUTILS_USE_PEP517=setuptools
+PYTHON_COMPAT=( python3_{10..13} )
+
+CARGO_OPTIONAL=1
+CRATES="
+ autocfg@1.1.0
+ bitflags@1.3.2
+ cfg-if@1.0.0
+ heck@0.4.1
+ indoc@2.0.4
+ libc@0.2.150
+ lock_api@0.4.11
+ memoffset@0.9.0
+ once_cell@1.19.0
+ parking_lot@0.12.1
+ parking_lot_core@0.9.9
+ proc-macro2@1.0.70
+ pyo3-build-config@0.20.0
+ pyo3-ffi@0.20.0
+ pyo3-macros-backend@0.20.0
+ pyo3-macros@0.20.0
+ pyo3@0.20.0
+ quote@1.0.33
+ redox_syscall@0.4.1
+ scopeguard@1.2.0
+ smallvec@1.11.2
+ syn@2.0.41
+ target-lexicon@0.12.12
+ unicode-ident@1.0.12
+ unindent@0.2.3
+ windows-targets@0.48.5
+ windows_aarch64_gnullvm@0.48.5
+ windows_aarch64_msvc@0.48.5
+ windows_i686_gnu@0.48.5
+ windows_i686_msvc@0.48.5
+ windows_x86_64_gnu@0.48.5
+ windows_x86_64_gnullvm@0.48.5
+ windows_x86_64_msvc@0.48.5
+"
+
+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? (
+ ${CARGO_CRATE_URIS}
+ )
+"
+
+LICENSE="MIT"
+LICENSE+=" native-extensions? ("
+# Dependent crate licenses
+LICENSE+=" 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"
+
+src_unpack() {
+ cargo_src_unpack
+}
+
+src_prepare() {
+ # remove fragile timing check
+ sed -i -e '/assertLessEqual(time\.time/d' tests/test_parser.py || die
+ distutils-r1_src_prepare
+}
+
+python_compile() {
+ distutils-r1_python_compile
+
+ if use native-extensions; then
+ local DISTUTILS_USE_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
+}