diff --git a/textproc/py-jq/Makefile b/textproc/py-jq/Makefile index e7d812b6a0c0..ebfcc3da58c9 100644 --- a/textproc/py-jq/Makefile +++ b/textproc/py-jq/Makefile @@ -1,49 +1,46 @@ PORTNAME= jq -PORTVERSION= 1.5.0 +PORTVERSION= 1.6.0 CATEGORIES= textproc python MASTER_SITES= PYPI LOCAL/mandree:mandree PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} -DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} jq-1.2.1-tests${EXTRACT_SUFX}:mandree +DISTFILES= ${PORTNAME}-${PORTVERSION}${EXTRACT_SUFX} MAINTAINER= mandree@FreeBSD.org COMMENT= jq.py: a lightweight and flexible JSON processor WWW= https://github.com/mwilliamson/jq.py LICENSE= BSD2CLAUSE LICENSE_FILE= ${WRKSRC}/LICENSE BUILD_DEPENDS= ${RUN_DEPENDS} LIB_DEPENDS= libjq.so:textproc/jq \ libonig.so:devel/oniguruma RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}certifi>=0:security/py-certifi@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} \ ${PYTHON_PKGNAMEPREFIX}requests>0:www/py-requests@${PY_FLAVOR} \ ${PY_SETUPTOOLS} \ ${PYTHON_PKGNAMEPREFIX}wheel>0:devel/py-wheel@${PY_FLAVOR} +MAKE_ENV+= JQPY_USE_SYSTEM_LIBS=1 USES= localbase python USE_PYTHON= autoplist distutils -post-extract: - # move tests into place - ${MV} ${WRKDIR}/jq-1.2.1/* ${WRKSRC} - -post-patch: - ${REINPLACE_CMD} -e 's/\$$end/end of file/' ${WRKSRC}/tests/*.py - post-install: ${STRIP_CMD} ${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}/jq*.so .if defined(_MANDREE_FORCE_POUDRIERE_TEST_) BUILD_DEPENDS+= ${TEST_DEPENDS} pre-package: ${MAKE} test .endif +pre-test: + ${CP} ${FILESDIR}/tox.ini ${WRKSRC} + do-test: cd ${WRKSRC} && ${SETENV} \ PYTHONPATH=${STAGEDIR}${PYTHON_SITELIBDIR} \ ${PYTHON_CMD} -m pytest -v tests/ .include diff --git a/textproc/py-jq/distinfo b/textproc/py-jq/distinfo index ce5322805a70..07e6bc57f943 100644 --- a/textproc/py-jq/distinfo +++ b/textproc/py-jq/distinfo @@ -1,5 +1,3 @@ -TIMESTAMP = 1694367159 -SHA256 (jq-1.5.0.tar.gz) = 47695d97c300b6a5c36731d9cab12f6bf1cee35f01b3374063b87f868f2131d1 -SIZE (jq-1.5.0.tar.gz) = 2716575 -SHA256 (jq-1.2.1-tests.tar.gz) = 7648084f434896eda31bb5e09a4f6d32ebb561660c95655e08346c33be9b3ece -SIZE (jq-1.2.1-tests.tar.gz) = 2856 +TIMESTAMP = 1697574722 +SHA256 (jq-1.6.0.tar.gz) = c7711f0c913a826a00990736efa6ffc285f8ef433414516bb14b7df971d6c1ea +SIZE (jq-1.6.0.tar.gz) = 2913373 diff --git a/textproc/py-jq/files/patch-setup.py b/textproc/py-jq/files/patch-setup.py deleted file mode 100644 index 650d559096ed..000000000000 --- a/textproc/py-jq/files/patch-setup.py +++ /dev/null @@ -1,24 +0,0 @@ ---- setup.py.orig 2022-09-19 15:51:09 UTC -+++ setup.py -@@ -36,8 +36,6 @@ class jq_build_ext(build_ext): - def run(self): - if not os.path.exists(_dep_build_path(".")): - os.makedirs(_dep_build_path(".")) -- self._build_oniguruma() -- self._build_libjq() - build_ext.run(self) - - def _build_oniguruma(self): -@@ -87,11 +85,7 @@ jq_extension = Extension( - "jq", - sources=["jq.c"], - include_dirs=[os.path.join(jq_lib_dir, "src")], -- extra_link_args=["-lm"], -- extra_objects=[ -- os.path.join(jq_lib_dir, ".libs/libjq.a"), -- os.path.join(oniguruma_lib_install_dir, "lib/libonig.a"), -- ], -+ extra_link_args=["-lm", "-ljq", "-lonig"], - ) - - setup( diff --git a/textproc/py-jq/files/tox.ini b/textproc/py-jq/files/tox.ini new file mode 100644 index 000000000000..5295e5901382 --- /dev/null +++ b/textproc/py-jq/files/tox.ini @@ -0,0 +1,15 @@ +# https://raw.githubusercontent.com/mwilliamson/jq.py/1.6.0/tox.ini +# https://github.com/mwilliamson/jq.py/issues/96 + +[tox] +envlist = py35,py36,py37,py38,py39,py310,py311,pypy3 +isolated_build = True +[testenv] +changedir = {envtmpdir} +deps=-r{toxinidir}/test-requirements.txt +commands= + py.test {toxinidir}/tests +passenv = JQPY_USE_SYSTEM_LIBS + +[pytest] +python_files = *_tests.py