diff --git a/net/py-suds-jurko/Makefile b/net/py-suds-jurko/Makefile index 35112a1969f35..4c83dca6da381 100644 --- a/net/py-suds-jurko/Makefile +++ b/net/py-suds-jurko/Makefile @@ -3,20 +3,63 @@ PORTNAME= suds-jurko PORTVERSION= 0.6 +PORTREVISION= 1 CATEGORIES= net python MASTER_SITES= CHEESESHOP PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} MAINTAINER= alexander.nusov@nfvexpress.com -COMMENT= Lightweight SOAP client (jurko's fork) +COMMENT= Lightweight SOAP client (Jurko's fork) LICENSE= LGPL3 +LICENSE_FILE= ${WRKSRC}/LICENSE.txt + +TEST_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pytest>0:devel/py-pytest@${PY_FLAVOR} + +USES= dos2unix python tar:bz2 +USE_PYTHON= autoplist distutils NO_ARCH= yes -CONFLICTS_INSTALL= ${PYTHON_PKGNAMEPREFIX}suds-[0-9]* +post-patch: + # Move the tests into the main package so + # they are processed by 2to3 so we can test Python 3 + ${MV} ${WRKSRC}/tests ${WRKSRC}/suds/tests + # Compensate for the package/module name change + ${REINPLACE_CMD} -e 's|import tests|import suds.tests|g' \ + ${WRKSRC}/suds/tests/test_argument_parser.py \ + ${WRKSRC}/suds/tests/test_date_time.py \ + ${WRKSRC}/suds/tests/test_input_parameters.py \ + ${WRKSRC}/suds/tests/test_reply_handling.py \ + ${WRKSRC}/suds/tests/test_request_construction.py \ + ${WRKSRC}/suds/tests/test_suds.py \ + ${WRKSRC}/suds/tests/test_timezone.py + ${REINPLACE_CMD} -e 's|tests.|suds.tests.|g' \ + ${WRKSRC}/suds/tests/conftest.py \ + ${WRKSRC}/suds/tests/test_reply_handling.py \ + ${WRKSRC}/suds/tests/test_suds.py \ + ${WRKSRC}/suds/tests/test_request_construction.py \ + ${WRKSRC}/suds/tests/test_input_parameters.py \ + ${WRKSRC}/suds/tests/test_argument_parser.py -USES= python tar:bz2 -USE_PYTHON= autoplist distutils +# lambda: foo needed due to wanting to exclude parametrized tests +# https://github.com/pytest-dev/pytest/issues/5881 +# https://github.com/pytest-dev/pytest/issues/6177 +# +# Must call tests from the build/ dir because the source dir +# hasn't been processed by 2to3, so tests fail to start on Python 3 +# +# Must call the tests from build/lib/suds/tests because +# Defining 'pytest_plugins' in a non-top-level conftest is no longer supported +# https://docs.pytest.org/en/latest/deprecations.html#pytest-plugins-in-non-top-level-conftest-files + +do-test: + cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -v -rs -o addopts= \ + -k "not test_document_literal_request_for_single_element_input \ + and not (lambda: locals)()()['test_binding_uses_argument_parsing[binding_style1]'] \ + and not (lambda: locals)()()['test_choice_containing_an_empty_sequence[test_args_required0]'] \ + and not (lambda: locals)()()['test_choice_explicitly_marked_as_optional[choice0]'] \ + and not test_sending_unicode_data" \ + build/lib/suds/tests .include diff --git a/net/py-suds-jurko/files/patch-setup.cfg b/net/py-suds-jurko/files/patch-setup.cfg new file mode 100644 index 0000000000000..c5227b4b0380b --- /dev/null +++ b/net/py-suds-jurko/files/patch-setup.cfg @@ -0,0 +1,14 @@ +# [pytest] section in setup.cfg files is no longer supported +# TODO: Upstream + +--- setup.cfg.orig 2020-01-13 04:27:33 UTC ++++ setup.cfg +@@ -4,7 +4,7 @@ optimize = 1 + [sdist] + formats = bztar,zip + +-[pytest] ++[tool:pytest] + norecursedirs = .git .hg .svn build dist + + [egg_info] diff --git a/net/py-suds-jurko/files/patch-tests_indirect__parametrize.py b/net/py-suds-jurko/files/patch-tests_indirect__parametrize.py new file mode 100644 index 0000000000000..69b0073e50a79 --- /dev/null +++ b/net/py-suds-jurko/files/patch-tests_indirect__parametrize.py @@ -0,0 +1,23 @@ +# pytest_namespace() was removed in 4.x +# See: https://docs.pytest.org/en/latest/deprecations.html#pytest-namespacehttps://docs.pytest.org/en/latest/deprecations.html#pytest-namespace +# TODO: Upstream + +--- tests/indirect_parametrize.py.orig 2014-01-21 19:06:03 UTC ++++ tests/indirect_parametrize.py +@@ -112,6 +112,7 @@ def pytest_configure(config): + "argument list and keyword argument dictionary) based on the received " + "input data. For more detailed information see the " + "indirect_parametrize pytest plugin implementation module.") ++ pytest.indirect_parametrize = indirect_parametrize + + + def pytest_generate_tests(metafunc): +@@ -123,8 +124,3 @@ def pytest_generate_tests(metafunc): + return + args, kwargs = mark.args[0](*mark.args[1:], **mark.kwargs) + metafunc.parametrize(*args, **kwargs) +- +- +-def pytest_namespace(): +- """pytest hook publishing references in the toplevel pytest namespace.""" +- return {'indirect_parametrize': indirect_parametrize} diff --git a/net/py-suds-jurko/pkg-descr b/net/py-suds-jurko/pkg-descr index 898b522cf8109..a77ac9d247627 100644 --- a/net/py-suds-jurko/pkg-descr +++ b/net/py-suds-jurko/pkg-descr @@ -1,3 +1,6 @@ -Lightweight SOAP client written in Python (jurko's fork). +Based on the original 'suds' project by Jeff Ortel (jortel at redhat +dot com) hosted at 'http://fedorahosted.org/suds'. -WWW: https://pypi.org/project/suds-jurko/ +'Suds' is a lightweight SOAP-based web service client for Python + +WWW: https://bitbucket.org/jurko/suds