From owner-svn-ports-head@freebsd.org Mon Jan 13 07:02:36 2020 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 411E01F9785; Mon, 13 Jan 2020 07:02:36 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47x4KS0kK0z46Tq; Mon, 13 Jan 2020 07:02:36 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 144A3B11; Mon, 13 Jan 2020 07:02:36 +0000 (UTC) (envelope-from koobs@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 00D72Zfk097519; Mon, 13 Jan 2020 07:02:35 GMT (envelope-from koobs@FreeBSD.org) Received: (from koobs@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 00D72ZhE097516; Mon, 13 Jan 2020 07:02:35 GMT (envelope-from koobs@FreeBSD.org) Message-Id: <202001130702.00D72ZhE097516@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: koobs set sender to koobs@FreeBSD.org using -f From: Kubilay Kocak Date: Mon, 13 Jan 2020 07:02:35 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r522860 - in head/net/py-suds-jurko: . files X-SVN-Group: ports-head X-SVN-Commit-Author: koobs X-SVN-Commit-Paths: in head/net/py-suds-jurko: . files X-SVN-Commit-Revision: 522860 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Jan 2020 07:02:36 -0000 Author: koobs Date: Mon Jan 13 07:02:35 2020 New Revision: 522860 URL: https://svnweb.freebsd.org/changeset/ports/522860 Log: net/py-suds-jurko: Fix tests installed into shared location [1] This package installs its 'tests' module into a non-package-specific location in the root site-packages directory. Python packages should/usually address this by excluding tests from installation using setup.py: find_packages(exclude[ "" ]). Unfortunately the above 'simple' change cannot be used because it doesn't allow the package to be tested on Python 3.x, as the tests package is not processed by 2to3, and the tests need to be run on the processed (by 2to3) sources. This may be the original reason upstream didn't remove them from the build, not grokking the ramifications. Accordingly, this change moves the tests into the main package namespace and runs the tests on the processed sources in the resulting build/* directory. Remove CONFLICTS_INSTALL (to py-suds) accordingly. While I'm here: Patch the tests to support pytest > 4 and hack around the inability to reference parametrized tests (test[foo]) in pytests -k expressions. [1][2] Level up ports compliance: LICENSE_FILE, USE{S} ordering, match COMMENT to setup.py:description, match pkg-descr WWW URL to setup.py:homepage QA: All tests pass on Python 2.7-3.8 [1] https://github.com/pytest-dev/pytest/issues/5881 [2] https://github.com/pytest-dev/pytest/issues/6177 PR: 226077 Reported by: yuri [1] Approved by: portmgr (blanket: ports compliance) MFH: 2020Q1 (blanket: ports compliance, port bugfixes) Added: head/net/py-suds-jurko/files/ head/net/py-suds-jurko/files/patch-setup.cfg (contents, props changed) head/net/py-suds-jurko/files/patch-tests_indirect__parametrize.py (contents, props changed) Modified: head/net/py-suds-jurko/Makefile head/net/py-suds-jurko/pkg-descr Modified: head/net/py-suds-jurko/Makefile ============================================================================== --- head/net/py-suds-jurko/Makefile Mon Jan 13 06:37:02 2020 (r522859) +++ head/net/py-suds-jurko/Makefile Mon Jan 13 07:02:35 2020 (r522860) @@ -8,15 +8,57 @@ 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 Added: head/net/py-suds-jurko/files/patch-setup.cfg ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/py-suds-jurko/files/patch-setup.cfg Mon Jan 13 07:02:35 2020 (r522860) @@ -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] Added: head/net/py-suds-jurko/files/patch-tests_indirect__parametrize.py ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/net/py-suds-jurko/files/patch-tests_indirect__parametrize.py Mon Jan 13 07:02:35 2020 (r522860) @@ -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} Modified: head/net/py-suds-jurko/pkg-descr ============================================================================== --- head/net/py-suds-jurko/pkg-descr Mon Jan 13 06:37:02 2020 (r522859) +++ head/net/py-suds-jurko/pkg-descr Mon Jan 13 07:02:35 2020 (r522860) @@ -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