Skip to content

Commit

Permalink
Update to jq 1.7
Browse files Browse the repository at this point in the history
  • Loading branch information
mwilliamson committed Sep 10, 2023
1 parent e3ca074 commit 805705d
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 10 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ jq.py: a lightweight and flexible JSON processor
================================================

This project contains Python bindings for
`jq <http://stedolan.github.io/jq/>`_.
`jq <http://stedolan.github.io/jq/>`_ 1.7.

Installation
------------
Expand All @@ -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
Expand Down
Binary file removed deps/jq-1.6.tar.gz
Binary file not shown.
Binary file added deps/jq-1.7.tar.gz
Binary file not shown.
Binary file removed deps/onig-6.9.4.tar.gz
Binary file not shown.
Binary file added deps/onig-6.9.8.tar.gz
Binary file not shown.
6 changes: 3 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
9 changes: 7 additions & 2 deletions tests/jq_old_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 <top-level>, 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 <top-level>, 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 <top-level>, 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():
Expand Down
11 changes: 8 additions & 3 deletions tests/jq_tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
)


Expand Down Expand Up @@ -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 <top-level>, 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 <top-level>, 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 <top-level>, 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():
Expand Down

0 comments on commit 805705d

Please sign in to comment.