* [gentoo-commits] repo/gentoo:master commit in: dev-python/pysimdjson/, dev-python/pysimdjson/files/
@ 2021-05-23 6:32 Michał Górny
0 siblings, 0 replies; 3+ messages in thread
From: Michał Górny @ 2021-05-23 6:32 UTC (permalink / raw
To: gentoo-commits
commit: c2c7385ecf614f2803b7ef8ae207031773374ab7
Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
AuthorDate: Sun May 23 06:02:17 2021 +0000
Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
CommitDate: Sun May 23 06:30:35 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c2c7385e
dev-python/pysimdjson: Add python@ as co-maint.
Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
.../files/pysimdjson-4.0.0-unbundle.patch | 95 ++++++++++++++++++++++
dev-python/pysimdjson/metadata.xml | 4 +
dev-python/pysimdjson/pysimdjson-4.0.0.ebuild | 9 +-
3 files changed, 107 insertions(+), 1 deletion(-)
diff --git a/dev-python/pysimdjson/files/pysimdjson-4.0.0-unbundle.patch b/dev-python/pysimdjson/files/pysimdjson-4.0.0-unbundle.patch
new file mode 100644
index 00000000000..de52bc063a2
--- /dev/null
+++ b/dev-python/pysimdjson/files/pysimdjson-4.0.0-unbundle.patch
@@ -0,0 +1,95 @@
+diff --git a/setup.py b/setup.py
+index f1de675..4c23028 100644
+--- a/setup.py
++++ b/setup.py
+@@ -27,53 +27,59 @@ if system == 'Darwin':
+ os.environ.setdefault('MACOSX_DEPLOYMENT_TARGET', '10.14')
+ extra_compile_args.append('-std=c++11')
+
+-if os.getenv('BUILD_WITH_CYTHON') and not CYTHON_AVAILABLE:
++build_with_cython = os.getenv('BUILD_WITH_CYTHON')
++if build_with_cython and not CYTHON_AVAILABLE:
+ print(
+ 'BUILD_WITH_CYTHON environment variable is set, but cython'
+ ' is not available. Falling back to pre-cythonized version if'
+ ' available.'
+ )
++ build_with_cython = False
+
+-if os.getenv('BUILD_WITH_CYTHON') and CYTHON_AVAILABLE:
+- macros = []
+- compiler_directives = {
+- 'embedsignature': True
+- }
++build_with_system_lib = os.getenv('BUILD_WITH_SYSTEM_LIB')
++
++macros = []
++compiler_directives = {}
++libraries = []
++sources = [
++ 'simdjson/errors.cpp',
++]
++
++if build_with_system_lib:
++ libraries.append('simdjson')
++else:
++ sources.append('simdjson/simdjson.cpp')
++
++if build_with_cython:
++ compiler_directives['embedsignature'] = True
+
+ if os.getenv('BUILD_FOR_DEBUG'):
+ # Enable line tracing, which also enables support for coverage
+ # reporting.
+- macros = [
++ macros += [
+ ('CYTHON_TRACE', 1),
+ ('CYTHON_TRACE_NOGIL', 1)
+ ]
+ compiler_directives['linetrace'] = True
+
+- extensions = cythonize([
+- Extension(
+- 'csimdjson',
+- [
+- 'simdjson/simdjson.cpp',
+- 'simdjson/errors.cpp',
+- 'simdjson/csimdjson.pyx'
+- ],
+- define_macros=macros,
+- extra_compile_args=extra_compile_args
+- )
+- ], compiler_directives=compiler_directives)
++ sources.append('simdjson/csimdjson.pyx')
+ else:
+- extensions = [
+- Extension(
+- 'csimdjson',
+- [
+- 'simdjson/simdjson.cpp',
+- 'simdjson/errors.cpp',
+- 'simdjson/csimdjson.cpp'
+- ],
+- extra_compile_args=extra_compile_args,
+- language='c++'
+- )
+- ]
++ sources.append('simdjson/csimdjson.cpp')
++
++
++extensions = [
++ Extension(
++ 'csimdjson',
++ sources,
++ define_macros=macros,
++ extra_compile_args=extra_compile_args,
++ libraries=libraries,
++ language='c++',
++ )
++]
++
++if build_with_cython:
++ extensions = cythonize(extensions, compiler_directives=compiler_directives)
+
+ setup(
+ name='pysimdjson',
diff --git a/dev-python/pysimdjson/metadata.xml b/dev-python/pysimdjson/metadata.xml
index bbbada85c7e..0fbbf43703c 100644
--- a/dev-python/pysimdjson/metadata.xml
+++ b/dev-python/pysimdjson/metadata.xml
@@ -5,6 +5,10 @@
<email>chutzpah@gentoo.org</email>
<name>Patrick McLean</name>
</maintainer>
+ <maintainer type="project">
+ <email>python@gentoo.org</email>
+ <name>Python</name>
+ </maintainer>
<upstream>
<remote-id type="pypi">pysimdjson</remote-id>
</upstream>
diff --git a/dev-python/pysimdjson/pysimdjson-4.0.0.ebuild b/dev-python/pysimdjson/pysimdjson-4.0.0.ebuild
index 67405c43dc7..3400cda568d 100644
--- a/dev-python/pysimdjson/pysimdjson-4.0.0.ebuild
+++ b/dev-python/pysimdjson/pysimdjson-4.0.0.ebuild
@@ -23,13 +23,20 @@ BDEPEND="
"
distutils_enable_tests pytest
+PATCHES=(
+ "${FILESDIR}"/${P}-unbundle.patch
+)
+
src_prepare() {
# benchmarks aren't run
sed -i -e 's:pytest-benchmark::' setup.cfg || die
# force regen
-# rm simdjson/csimdjson.cpp || die
+ rm simdjson/csimdjson.cpp || die
+ # bundled lib :-(
+ rm simdjson/simdjson.{cpp,h} || die
distutils-r1_src_prepare
export BUILD_WITH_CYTHON=1
+ export BUILD_WITH_SYSTEM_LIB=1
}
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pysimdjson/, dev-python/pysimdjson/files/
@ 2021-05-24 18:21 Patrick McLean
0 siblings, 0 replies; 3+ messages in thread
From: Patrick McLean @ 2021-05-24 18:21 UTC (permalink / raw
To: gentoo-commits
commit: 60eb1d1b367b61eb73875ef5fbb380079e7ce5c0
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Mon May 24 18:21:31 2021 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Mon May 24 18:21:31 2021 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=60eb1d1b
dev-python/pysimdjson-4.0.0-r1: revbump, add patch to fix issue #82
Package-Manager: Portage-3.0.19, Repoman-3.0.3
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
.../files/pysimdjson-4.0.0-error-types.patch | 53 ++++++++++++++++++++++
...son-4.0.0.ebuild => pysimdjson-4.0.0-r1.ebuild} | 3 +-
2 files changed, 55 insertions(+), 1 deletion(-)
diff --git a/dev-python/pysimdjson/files/pysimdjson-4.0.0-error-types.patch b/dev-python/pysimdjson/files/pysimdjson-4.0.0-error-types.patch
new file mode 100644
index 00000000000..34b8f4aa9e2
--- /dev/null
+++ b/dev-python/pysimdjson/files/pysimdjson-4.0.0-error-types.patch
@@ -0,0 +1,53 @@
+commit 1145be6cac70ed065f2053977d470f3f771ac6a0
+Author: Tyler Kennedy <tk@tkte.ch>
+Date: Sun May 23 15:55:28 2021 -0400
+
+ Empty buffers now raise identical error to empty bytes. Closes #81.
+
+diff --git a/simdjson/csimdjson.pyx b/simdjson/csimdjson.pyx
+index 095a183..c278e08 100644
+--- a/simdjson/csimdjson.pyx
++++ b/simdjson/csimdjson.pyx
+@@ -478,6 +478,13 @@ cdef class Parser:
+ # type-specific APIs, but gives much greater compatibility.
+ data = src
+
++ if data.size == 0:
++ # If we were given a completely empty buffer, trying to access
++ # a stride in the next step will cause a (potentially
++ # confusing) IndexError. This isn't a very good error message,
++ # but it's identical to the one simdjson would have raised.
++ raise ValueError('Empty: no JSON found')
++
+ return element_to_primitive(
+ self,
+ dereference(self.c_parser).parse(
+diff --git a/tests/test_parser.py b/tests/test_parser.py
+index 88e7207..d3a28c7 100644
+--- a/tests/test_parser.py
++++ b/tests/test_parser.py
+@@ -1,3 +1,4 @@
++import io
+ import pathlib
+
+ import pytest
+@@ -32,6 +33,19 @@ def test_parse_str(parser):
+ assert doc.as_dict() == {'hello': 'world'}
+
+
++def test_parse_empty_buffer(parser):
++ """Ensure trying to parse an empty buffer returns an error consistent
++ with attempting to parse an empty bytestring."""
++ # Issue #81
++ with pytest.raises(ValueError) as bytes_exc:
++ parser.parse(b'')
++
++ with pytest.raises(ValueError) as buffer_exc:
++ parser.parse(io.BytesIO(b'').getbuffer())
++
++ assert str(bytes_exc.value) == str(buffer_exc.value)
++
++
+ def test_unicode_decode_error(parser):
+ """Ensure the parser raises encoding issues."""
+ with pytest.raises(UnicodeDecodeError):
diff --git a/dev-python/pysimdjson/pysimdjson-4.0.0.ebuild b/dev-python/pysimdjson/pysimdjson-4.0.0-r1.ebuild
similarity index 89%
rename from dev-python/pysimdjson/pysimdjson-4.0.0.ebuild
rename to dev-python/pysimdjson/pysimdjson-4.0.0-r1.ebuild
index 3400cda568d..165fcadc252 100644
--- a/dev-python/pysimdjson/pysimdjson-4.0.0.ebuild
+++ b/dev-python/pysimdjson/pysimdjson-4.0.0-r1.ebuild
@@ -24,7 +24,8 @@ BDEPEND="
distutils_enable_tests pytest
PATCHES=(
- "${FILESDIR}"/${P}-unbundle.patch
+ "${FILESDIR}"/pysimdjson-4.0.0-unbundle.patch
+ "${FILESDIR}"/pysimdjson-4.0.0-error-types.patch
)
src_prepare() {
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [gentoo-commits] repo/gentoo:master commit in: dev-python/pysimdjson/, dev-python/pysimdjson/files/
@ 2022-05-24 18:27 Patrick McLean
0 siblings, 0 replies; 3+ messages in thread
From: Patrick McLean @ 2022-05-24 18:27 UTC (permalink / raw
To: gentoo-commits
commit: 72844100caf45fecd471a6783ee3a27d3cbc3069
Author: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
AuthorDate: Tue May 24 18:26:47 2022 +0000
Commit: Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue May 24 18:26:47 2022 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=72844100
dev-python/pysimdjson: Revbump, simdjson dep <1.1 (bug #846905)
Closes: https://bugs.gentoo.org/846905
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>
dev-python/pysimdjson/Manifest | 1 -
.../files/pysimdjson-4.0.0-unbundle.patch | 95 ----------------------
dev-python/pysimdjson/pysimdjson-4.0.2.ebuild | 42 ----------
...son-4.0.3.ebuild => pysimdjson-4.0.3-r1.ebuild} | 2 +-
4 files changed, 1 insertion(+), 139 deletions(-)
diff --git a/dev-python/pysimdjson/Manifest b/dev-python/pysimdjson/Manifest
index 1009245d53eb..b08669c08034 100644
--- a/dev-python/pysimdjson/Manifest
+++ b/dev-python/pysimdjson/Manifest
@@ -1,2 +1 @@
-DIST pysimdjson-4.0.2.tar.gz 3740054 BLAKE2B 379c8637096074615f2045171e0950af0190e8485db6a1734f4fcd19d9eeeebd91cb79c18abd2fe6256287f15aa6a3c12c1283e4affa131db14f9948ab2f0d63 SHA512 537b7958dd3429831ee201b6a4fc5fa8fca50ad14def016b472d3f234f81175441152c1823eed0bcad06f59e274e2b6b036f26a3af8f6977ceea5807471de4a5
DIST pysimdjson-4.0.3.gh.tar.gz 3783913 BLAKE2B 74c186e87540c4806ec311e7a6ca05bf28b2a2060ba078919c68d92812a1bc34efd9f0deb30b85dba134af9ce99dbfa2b8fa33c1b14926915e284f262a7ac4f1 SHA512 eb2cd8b96eed8985674fbcfeafc21b58c9985c46c7f46b72ee78fbf91ef659acd5139fa56c251bae22418007b3da6ff7e5cdd2d28b2ba22cf19771f2f74880e3
diff --git a/dev-python/pysimdjson/files/pysimdjson-4.0.0-unbundle.patch b/dev-python/pysimdjson/files/pysimdjson-4.0.0-unbundle.patch
deleted file mode 100644
index de52bc063a24..000000000000
--- a/dev-python/pysimdjson/files/pysimdjson-4.0.0-unbundle.patch
+++ /dev/null
@@ -1,95 +0,0 @@
-diff --git a/setup.py b/setup.py
-index f1de675..4c23028 100644
---- a/setup.py
-+++ b/setup.py
-@@ -27,53 +27,59 @@ if system == 'Darwin':
- os.environ.setdefault('MACOSX_DEPLOYMENT_TARGET', '10.14')
- extra_compile_args.append('-std=c++11')
-
--if os.getenv('BUILD_WITH_CYTHON') and not CYTHON_AVAILABLE:
-+build_with_cython = os.getenv('BUILD_WITH_CYTHON')
-+if build_with_cython and not CYTHON_AVAILABLE:
- print(
- 'BUILD_WITH_CYTHON environment variable is set, but cython'
- ' is not available. Falling back to pre-cythonized version if'
- ' available.'
- )
-+ build_with_cython = False
-
--if os.getenv('BUILD_WITH_CYTHON') and CYTHON_AVAILABLE:
-- macros = []
-- compiler_directives = {
-- 'embedsignature': True
-- }
-+build_with_system_lib = os.getenv('BUILD_WITH_SYSTEM_LIB')
-+
-+macros = []
-+compiler_directives = {}
-+libraries = []
-+sources = [
-+ 'simdjson/errors.cpp',
-+]
-+
-+if build_with_system_lib:
-+ libraries.append('simdjson')
-+else:
-+ sources.append('simdjson/simdjson.cpp')
-+
-+if build_with_cython:
-+ compiler_directives['embedsignature'] = True
-
- if os.getenv('BUILD_FOR_DEBUG'):
- # Enable line tracing, which also enables support for coverage
- # reporting.
-- macros = [
-+ macros += [
- ('CYTHON_TRACE', 1),
- ('CYTHON_TRACE_NOGIL', 1)
- ]
- compiler_directives['linetrace'] = True
-
-- extensions = cythonize([
-- Extension(
-- 'csimdjson',
-- [
-- 'simdjson/simdjson.cpp',
-- 'simdjson/errors.cpp',
-- 'simdjson/csimdjson.pyx'
-- ],
-- define_macros=macros,
-- extra_compile_args=extra_compile_args
-- )
-- ], compiler_directives=compiler_directives)
-+ sources.append('simdjson/csimdjson.pyx')
- else:
-- extensions = [
-- Extension(
-- 'csimdjson',
-- [
-- 'simdjson/simdjson.cpp',
-- 'simdjson/errors.cpp',
-- 'simdjson/csimdjson.cpp'
-- ],
-- extra_compile_args=extra_compile_args,
-- language='c++'
-- )
-- ]
-+ sources.append('simdjson/csimdjson.cpp')
-+
-+
-+extensions = [
-+ Extension(
-+ 'csimdjson',
-+ sources,
-+ define_macros=macros,
-+ extra_compile_args=extra_compile_args,
-+ libraries=libraries,
-+ language='c++',
-+ )
-+]
-+
-+if build_with_cython:
-+ extensions = cythonize(extensions, compiler_directives=compiler_directives)
-
- setup(
- name='pysimdjson',
diff --git a/dev-python/pysimdjson/pysimdjson-4.0.2.ebuild b/dev-python/pysimdjson/pysimdjson-4.0.2.ebuild
deleted file mode 100644
index aea670752664..000000000000
--- a/dev-python/pysimdjson/pysimdjson-4.0.2.ebuild
+++ /dev/null
@@ -1,42 +0,0 @@
-# Copyright 2020-2021 Gentoo Authors
-# Distributed under the terms of the GNU General Public License v2
-
-EAPI=7
-
-PYTHON_COMPAT=( python3_{8..10} )
-inherit distutils-r1
-
-DESCRIPTION="Python bindings for simdjson"
-HOMEPAGE="https://github.com/TkTech/pysimdjson"
-SRC_URI="https://github.com/TkTech/${PN}/archive/v${PV}.tar.gz -> ${P}.tar.gz"
-
-LICENSE="MIT Apache-2.0"
-SLOT="0"
-KEYWORDS="amd64 ~x86"
-
-RDEPEND="
- dev-libs/simdjson:=
-"
-DEPEND=${RDEPEND}
-BDEPEND="
- dev-python/cython[${PYTHON_USEDEP}]
-"
-distutils_enable_tests pytest
-
-PATCHES=(
- "${FILESDIR}"/pysimdjson-4.0.0-unbundle.patch
-)
-
-src_prepare() {
- # benchmarks aren't run
- sed -i -e 's:pytest-benchmark::' setup.cfg || die
- # force regen
- rm simdjson/csimdjson.cpp || die
- # bundled lib :-(
- rm simdjson/simdjson.{cpp,h} || die
-
- distutils-r1_src_prepare
-
- export BUILD_WITH_CYTHON=1
- export BUILD_WITH_SYSTEM_LIB=1
-}
diff --git a/dev-python/pysimdjson/pysimdjson-4.0.3.ebuild b/dev-python/pysimdjson/pysimdjson-4.0.3-r1.ebuild
similarity index 97%
rename from dev-python/pysimdjson/pysimdjson-4.0.3.ebuild
rename to dev-python/pysimdjson/pysimdjson-4.0.3-r1.ebuild
index 303773b7087e..0668ba9725c8 100644
--- a/dev-python/pysimdjson/pysimdjson-4.0.3.ebuild
+++ b/dev-python/pysimdjson/pysimdjson-4.0.3-r1.ebuild
@@ -23,7 +23,7 @@ SLOT="0"
KEYWORDS="~amd64 ~x86"
DEPEND="
- dev-libs/simdjson:=
+ <dev-libs/simdjson-1.1:=
"
RDEPEND="
${DEPEND}
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-05-24 18:27 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-05-24 18:21 [gentoo-commits] repo/gentoo:master commit in: dev-python/pysimdjson/, dev-python/pysimdjson/files/ Patrick McLean
-- strict thread matches above, loose matches on Subject: below --
2022-05-24 18:27 Patrick McLean
2021-05-23 6:32 Michał Górny
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox