diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 13877aa..03c401c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,6 +4,8 @@ Changelog 1.6.0 ----- +* Update to jq 1.7. + * Add support for building with Cython 3. * Add support for building with the system libjq and libonig instead of building diff --git a/README.rst b/README.rst index 9058b30..9e90d73 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ jq.py: a lightweight and flexible JSON processor ================================================ This project contains Python bindings for -`jq `_. +`jq `_ 1.7. Installation ------------ @@ -15,7 +15,7 @@ On these platforms, you should be able to install jq with a normal pip install: pip install jq If a wheel is not available, -the source for jq 1.6 is built. +the source for jq 1.7 is built. This requires: * Autoreconf diff --git a/deps/jq-1.6.tar.gz b/deps/jq-1.6.tar.gz deleted file mode 100644 index b2ee039..0000000 Binary files a/deps/jq-1.6.tar.gz and /dev/null differ diff --git a/deps/jq-1.7.tar.gz b/deps/jq-1.7.tar.gz new file mode 100644 index 0000000..07e6d39 Binary files /dev/null and b/deps/jq-1.7.tar.gz differ diff --git a/deps/onig-6.9.4.tar.gz b/deps/onig-6.9.4.tar.gz deleted file mode 100644 index e6ec060..0000000 Binary files a/deps/onig-6.9.4.tar.gz and /dev/null differ diff --git a/deps/onig-6.9.8.tar.gz b/deps/onig-6.9.8.tar.gz new file mode 100644 index 0000000..fea0f0e Binary files /dev/null and b/deps/onig-6.9.8.tar.gz differ diff --git a/setup.py b/setup.py index 27ec8a9..63f1ee0 100644 --- a/setup.py +++ b/setup.py @@ -24,10 +24,10 @@ def _read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() -jq_lib_tarball_path = _dep_source_path("jq-1.6.tar.gz") -jq_lib_dir = _dep_build_path("jq-1.6") +jq_lib_tarball_path = _dep_source_path("jq-1.7.tar.gz") +jq_lib_dir = _dep_build_path("jq-1.7") -oniguruma_version = "6.9.4" +oniguruma_version = "6.9.8" oniguruma_lib_tarball_path = _dep_source_path("onig-{}.tar.gz".format(oniguruma_version)) oniguruma_lib_build_dir = _dep_build_path("onig-{}".format(oniguruma_version)) oniguruma_lib_install_dir = _dep_build_path("onig-install-{}".format(oniguruma_version)) diff --git a/tests/jq_old_tests.py b/tests/jq_old_tests.py index f7e1f0d..9393cce 100644 --- a/tests/jq_old_tests.py +++ b/tests/jq_old_tests.py @@ -74,8 +74,13 @@ def test_value_error_is_raised_if_program_is_invalid(): jq("!") assert False, "Expected error" except ValueError as error: - expected_error_str = "jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at , line 1:\n!\njq: 1 compile error" - assert_equal(str(error), expected_error_str) + expected_error_strs = [ + # jq 1.6 + "jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at , line 1:\n!\njq: 1 compile error", + # jq 1.7 + "jq: error: syntax error, unexpected INVALID_CHARACTER, expecting end of file (Unix shell quoting issues?) at , line 1:\n!\njq: 1 compile error", + ] + assert str(error) in expected_error_strs def test_value_error_is_raised_if_input_cannot_be_processed_by_program(): diff --git a/tests/jq_tests.py b/tests/jq_tests.py index bf40679..c911ef5 100644 --- a/tests/jq_tests.py +++ b/tests/jq_tests.py @@ -23,7 +23,7 @@ def test_can_add_one_to_each_element_of_an_array(): def test_nan_is_outputted_as_null(): assert_equal( None, - jq.compile("0/0").input(0).first(), + jq.compile("nan").input(0).first(), ) @@ -194,8 +194,13 @@ def test_value_error_is_raised_if_program_is_invalid(): jq.compile("!") assert False, "Expected error" except ValueError as error: - expected_error_str = "jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at , line 1:\n!\njq: 1 compile error" - assert_equal(str(error), expected_error_str) + expected_error_strs = [ + # jq 1.6 + "jq: error: syntax error, unexpected INVALID_CHARACTER, expecting $end (Unix shell quoting issues?) at , line 1:\n!\njq: 1 compile error", + # jq 1.7 + "jq: error: syntax error, unexpected INVALID_CHARACTER, expecting end of file (Unix shell quoting issues?) at , line 1:\n!\njq: 1 compile error", + ] + assert str(error) in expected_error_strs def test_value_error_is_raised_if_input_cannot_be_processed_by_program():