From 6ec2a882b0cd90a72272554ca6348b7a8d9e1d8d Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 8 Jun 2024 12:10:11 +0100 Subject: Drop support for Python 3.5 --- .github/workflows/build.yml | 2 +- CHANGELOG.rst | 5 +++++ setup.py | 3 +-- tox.ini | 2 +- 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index c544db7..1ab2ddd 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -9,7 +9,7 @@ jobs: strategy: matrix: os: [ubuntu-20.04, macos-13] - python-version: [3.5, 3.6, 3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "pypy-3.7"] + python-version: [3.6, 3.7, 3.8, 3.9, "3.10", "3.11", "3.12", "pypy-3.7"] use-system-libs: [false] include: - os: ubuntu-20.04 diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 1e14bde..c99ec69 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,11 @@ Changelog ========= +1.8.0 +----- + +* Drop support for Python 3.5. + 1.7.0 ----- diff --git a/setup.py b/setup.py index 9eaa51f..6f04aba 100644 --- a/setup.py +++ b/setup.py @@ -97,7 +97,7 @@ setup( long_description=_read("README.rst"), author='Michael Williamson', url='https://github.com/mwilliamson/jq.py', - python_requires='>=3.5', + python_requires='>=3.6', license='BSD 2-Clause', ext_modules = [jq_extension], cmdclass={"build_ext": jq_build_ext}, @@ -107,7 +107,6 @@ setup( 'License :: OSI Approved :: BSD License', 'Programming Language :: Python', 'Programming Language :: Python :: 3', - 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', 'Programming Language :: Python :: 3.8', diff --git a/tox.ini b/tox.ini index 60226cf..c6346c7 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py35,py36,py37,py38,py39,py310,py311,pypy3 +envlist = py36,py37,py38,py39,py310,py311,pypy3 isolated_build = True [testenv] changedir = {envtmpdir} -- cgit v1.2.3 From 3fa4e4a462b57a480fb2036b1e1e599a2cad83b3 Mon Sep 17 00:00:00 2001 From: Michael Williamson Date: Sat, 8 Jun 2024 12:10:45 +0100 Subject: Add Python 3.12 to tox and classifiers --- setup.py | 1 + tox.ini | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.py b/setup.py index 6f04aba..1b1725c 100644 --- a/setup.py +++ b/setup.py @@ -113,6 +113,7 @@ setup( 'Programming Language :: Python :: 3.9', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', ], ) diff --git a/tox.ini b/tox.ini index c6346c7..2fb2492 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py36,py37,py38,py39,py310,py311,pypy3 +envlist = py36,py37,py38,py39,py310,py311,py312,pypy3 isolated_build = True [testenv] changedir = {envtmpdir} -- cgit v1.2.3 From fe19d174b69325d6791e4871f1077e17d9085cbf Mon Sep 17 00:00:00 2001 From: Nikolai Kondrashov Date: Wed, 9 Sep 2020 17:31:08 +0300 Subject: Use PyBytes_AsStringAndSize() Let Python give us the length of the "bytes" it already knows, instead of doing an strlen(). This improves performance a bit. --- jq.pyx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jq.pyx b/jq.pyx index 0f580c4..f42efdf 100644 --- a/jq.pyx +++ b/jq.pyx @@ -3,6 +3,7 @@ import json import threading from cpython.bytes cimport PyBytes_AsString +from cpython.bytes cimport PyBytes_AsStringAndSize from libc.float cimport DBL_MAX from libc.math cimport INFINITY, modf @@ -335,8 +336,10 @@ cdef class _ResultIterator(object): self._slurp = slurp self._ready = False cdef jv_parser* parser = jv_parser_new(0) - cdef char* cbytes_input = PyBytes_AsString(bytes_input) - jv_parser_set_buf(parser, cbytes_input, len(bytes_input), 0) + cdef char* cbytes_input + cdef ssize_t clen_input + PyBytes_AsStringAndSize(bytes_input, &cbytes_input, &clen_input) + jv_parser_set_buf(parser, cbytes_input, clen_input, 0) self._parser = parser def __iter__(self): -- cgit v1.2.3