Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 13 Jan 2020 07:07:36 +0000 (UTC)
From:      Kubilay Kocak <koobs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-branches@freebsd.org
Subject:   svn commit: r522862 - in branches/2020Q1/net/py-suds-jurko: . files
Message-ID:  <202001130707.00D77an5098256@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: koobs
Date: Mon Jan 13 07:07:36 2020
New Revision: 522862
URL: https://svnweb.freebsd.org/changeset/ports/522862

Log:
  MFH: r522860 r522861
  
  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[ "<package-glob>" ]).
  
  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)
  
  net/py-suds-jurko: Bump PORTREVISION missed in ports r522860
  
  PR:	226077
  
  Approved by:	ports-secteam (blanket(s): ports compliance, port bugfixes)

Added:
  branches/2020Q1/net/py-suds-jurko/files/
     - copied from r522860, head/net/py-suds-jurko/files/
Modified:
  branches/2020Q1/net/py-suds-jurko/Makefile
  branches/2020Q1/net/py-suds-jurko/pkg-descr
Directory Properties:
  branches/2020Q1/   (props changed)

Modified: branches/2020Q1/net/py-suds-jurko/Makefile
==============================================================================
--- branches/2020Q1/net/py-suds-jurko/Makefile	Mon Jan 13 07:03:57 2020	(r522861)
+++ branches/2020Q1/net/py-suds-jurko/Makefile	Mon Jan 13 07:07:36 2020	(r522862)
@@ -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 <bsd.port.mk>

Modified: branches/2020Q1/net/py-suds-jurko/pkg-descr
==============================================================================
--- branches/2020Q1/net/py-suds-jurko/pkg-descr	Mon Jan 13 07:03:57 2020	(r522861)
+++ branches/2020Q1/net/py-suds-jurko/pkg-descr	Mon Jan 13 07:07:36 2020	(r522862)
@@ -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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202001130707.00D77an5098256>