On Mon, May 09, 2016 at 08:23:48PM +0200, Daniel Jakots wrote:
> Hi,
>
> Here's a diff to add a py3 flavour to py-jsonschema. Tests are slightly
> better than with py2 :)
>
> Comments ? OK ?
>
> Cheers,
> Daniel
>
> Index: Makefile
> ===================================================================
> RCS file: /cvs/ports/devel/py-jsonschema/Makefile,v
> retrieving revision 1.3
> diff -u -p -r1.3 Makefile
> --- Makefile 29 Sep 2015 10:51:54 -0000 1.3
> +++ Makefile 9 May 2016 18:15:23 -0000
> @@ -5,7 +5,7 @@ COMMENT = implementation of JSON Schema
> MODPY_EGG_VERSION = 2.5.1
> DISTNAME = jsonschema-${MODPY_EGG_VERSION}
> PKGNAME = py-${DISTNAME}
> -REVISION = 0
> +REVISION = 1
>
> CATEGORIES = devel
>
> @@ -24,8 +24,14 @@ MODULES = lang/python
> MODPY_PI = Yes
> MODPY_SETUPTOOLS = Yes
>
> +FLAVORS = python3
> +FLAVOR ?=
> +
> +post-install:
> + mv ${PREFIX}/bin/jsonschema ${PREFIX}/bin/jsonschema${MODPY_BIN_SUFFIX}
Any reason not to do this only for the python3 FLAVOR?
> +
> do-test:
> cd ${WRKSRC}/jsonschema && \
> - ${LOCALBASE}/bin/py.test
> + ${LOCALBASE}/bin/py.test${MODPY_BIN_SUFFIX}
>
> .include <bsd.port.mk>
> Index: pkg/PLIST
> ===================================================================
> RCS file: /cvs/ports/devel/py-jsonschema/pkg/PLIST,v
> retrieving revision 1.1.1.1
> diff -u -p -r1.1.1.1 PLIST
> --- pkg/PLIST 16 Aug 2015 19:46:22 -0000 1.1.1.1
> +++ pkg/PLIST 9 May 2016 18:15:23 -0000
> @@ -1,5 +1,5 @@
> @comment $OpenBSD: PLIST,v 1.1.1.1 2015/08/16 19:46:22 edd Exp $
> -bin/jsonschema
> +bin/jsonschema${MODPY_BIN_SUFFIX}
> lib/python${MODPY_VERSION}/site-packages/jsonschema/
>
> lib/python${MODPY_VERSION}/site-packages/jsonschema-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/
>
> lib/python${MODPY_VERSION}/site-packages/jsonschema-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/PKG-INFO
> @@ -10,42 +10,44 @@ lib/python${MODPY_VERSION}/site-packages
>
> lib/python${MODPY_VERSION}/site-packages/jsonschema-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/requires.txt
>
> lib/python${MODPY_VERSION}/site-packages/jsonschema-${MODPY_EGG_VERSION}-py${MODPY_VERSION}.egg-info/top_level.txt
> lib/python${MODPY_VERSION}/site-packages/jsonschema/__init__.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/__init__.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/__main__.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/__main__.pyc
> +${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/jsonschema/${MODPY_PYCACHE}/
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/${MODPY_PYCACHE}__main__.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/${MODPY_PYCACHE}_format.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/${MODPY_PYCACHE}_reflect.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/${MODPY_PYCACHE}_utils.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/${MODPY_PYCACHE}_validators.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/${MODPY_PYCACHE}_version.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/${MODPY_PYCACHE}cli.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/${MODPY_PYCACHE}compat.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/${MODPY_PYCACHE}exceptions.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/${MODPY_PYCACHE}validators.${MODPY_PYC_MAGIC_TAG}pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/_format.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/_format.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/_reflect.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/_reflect.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/_utils.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/_utils.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/_validators.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/_validators.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/_version.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/_version.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/cli.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/cli.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/compat.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/compat.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/exceptions.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/exceptions.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/schemas/
> lib/python${MODPY_VERSION}/site-packages/jsonschema/schemas/draft3.json
> lib/python${MODPY_VERSION}/site-packages/jsonschema/schemas/draft4.json
> lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/
> lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/__init__.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/__init__.pyc
> +${MODPY_COMMENT}lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/${MODPY_PYCACHE}/
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/${MODPY_PYCACHE}__init__.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/${MODPY_PYCACHE}compat.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/${MODPY_PYCACHE}test_cli.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/${MODPY_PYCACHE}test_exceptions.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/${MODPY_PYCACHE}test_format.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/${MODPY_PYCACHE}test_jsonschema_test_suite.${MODPY_PYC_MAGIC_TAG}pyc
> +lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/${MODPY_PYCACHE}test_validators.${MODPY_PYC_MAGIC_TAG}pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/compat.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/compat.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/test_cli.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/test_cli.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/test_exceptions.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/test_exceptions.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/test_format.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/test_format.pyc
>
> lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/test_jsonschema_test_suite.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/test_jsonschema_test_suite.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/test_validators.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/tests/test_validators.pyc
> lib/python${MODPY_VERSION}/site-packages/jsonschema/validators.py
> -lib/python${MODPY_VERSION}/site-packages/jsonschema/validators.pyc
>
--
Antoine