Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 2 Feb 2016 15:09:00 +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: r407821 - in branches/2016Q1/dns/py-py3dns: . files
Message-ID:  <201602021509.u12F903V045931@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: koobs
Date: Tue Feb  2 15:08:59 2016
New Revision: 407821
URL: https://svnweb.freebsd.org/changeset/ports/407821

Log:
  MFH: r407274 dns/py-py3dns: Limit to Python 3.x, Fix dependencies
  
  py-py3dns is a Python 3.x only package, so limit USES=python
  accordingly. ipaddr is needed on <= 3.2, so add it as a conditional
  RUN_DEPENDS.
  
  While I'm here:
  
  - Add NO_ARCH
  - Add test target, TEST_DEPENDS and patch outdated unit test assertions
    that test against live domains, not mocked responses.
  - Remove unnecessary setup.py patch
  - Match COMMENT to setup.py:description
  - Sort and group USE{S} entries
  
  PR:			206645
  Reported by:		danger
  Approved by:		portmgr (blanket)
  Differential Revision:	D5083
  
  Approved by:		ports-secteam (feld)

Added:
  branches/2016Q1/dns/py-py3dns/files/patch-DNS_tests_test__base.py
     - copied unchanged from r407274, head/dns/py-py3dns/files/patch-DNS_tests_test__base.py
Deleted:
  branches/2016Q1/dns/py-py3dns/files/patch-DNS-Base.py
Modified:
  branches/2016Q1/dns/py-py3dns/Makefile
Directory Properties:
  branches/2016Q1/   (props changed)

Modified: branches/2016Q1/dns/py-py3dns/Makefile
==============================================================================
--- branches/2016Q1/dns/py-py3dns/Makefile	Tue Feb  2 15:06:55 2016	(r407820)
+++ branches/2016Q1/dns/py-py3dns/Makefile	Tue Feb  2 15:08:59 2016	(r407821)
@@ -8,22 +8,29 @@ MASTER_SITES=	CHEESESHOP
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
 MAINTAINER=	sunpoet@FreeBSD.org
-COMMENT=	DNS (Domain Name Service) library for Python 3
+COMMENT=	Python 3 DNS library
 
 LICENSE=	CNRI
 LICENSE_NAME=	CNRI LICENSE AGREEMENT
 LICENSE_FILE=	${WRKSRC}/LICENSE
 LICENSE_PERMS=	dist-mirror dist-sell pkg-mirror pkg-sell auto-accept
 
-NO_ARCH=	yes
+TEST_DEPENDS=	${PYTHON_PKGNAMEPREFIX}pytest>=0:${PORTSDIR}/devel/py-pytest
+
+USES=		python:3.2+
 USE_PYTHON=	autoplist distutils
-USES=		python
+
+NO_ARCH=	yes
 
 .include <bsd.port.pre.mk>
 
-.if ${PYTHON_REL} < 3300
-BUILD_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}ipaddress>=0:${PORTSDIR}/net/py-ipaddress
+.if ${PYTHON_REL} == 3300
 RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}ipaddress>=0:${PORTSDIR}/net/py-ipaddress
+.elif ${PYTHON_REL} <= 3200
+RUN_DEPENDS+=	${PYTHON_PKGNAMEPREFIX}ipaddr>=0:${PORTSDIR}/devel/py-ipaddr
 .endif
 
+do-test:
+	@cd ${WRKSRC} && ${PYTHON_CMD} -m pytest
+
 .include <bsd.port.post.mk>

Copied: branches/2016Q1/dns/py-py3dns/files/patch-DNS_tests_test__base.py (from r407274, head/dns/py-py3dns/files/patch-DNS_tests_test__base.py)
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ branches/2016Q1/dns/py-py3dns/files/patch-DNS_tests_test__base.py	Tue Feb  2 15:08:59 2016	(r407821, copy of r407274, head/dns/py-py3dns/files/patch-DNS_tests_test__base.py)
@@ -0,0 +1,78 @@
+--- DNS/tests/test_base.py.orig	2014-04-25 01:41:55 UTC
++++ DNS/tests/test_base.py
+@@ -33,12 +33,12 @@ class TestBase(unittest.TestCase):
+         self.assertTrue(a_response.answers)
+         # is the result vaguely ipv4 like?
+         self.assertEqual(a_response.answers[0]['data'].count('.'), 3)
+-        self.assertEqual(a_response.answers[0]['data'],'93.184.216.119')
++        self.assertEqual(a_response.answers[0]['data'],'93.184.216.34')
+ 
+         # Default result type for .qry object is an ipaddress object
+         ad_response = dnsobj.qry(qtype='A')
+         self.assertTrue(ad_response.answers)
+-        self.assertEqual(ad_response.answers[0]['data'],ipaddress.IPv4Address('93.184.216.119'))
++        self.assertEqual(ad_response.answers[0]['data'],ipaddress.IPv4Address('93.184.216.34'))
+ 
+         ab_response = dnsobj.qry(qtype='A', resulttype='binary')
+         self.assertTrue(ab_response.answers)
+@@ -46,11 +46,11 @@ class TestBase(unittest.TestCase):
+         self.assertEqual(len(ab_response.answers[0]['data']), 4)
+         for b in ab_response.answers[0]['data']:
+             assertIsByte(b)
+-        self.assertEqual(ab_response.answers[0]['data'],b']\xb8\xd8w')
++        self.assertEqual(ab_response.answers[0]['data'],b']\xb8\xd8"')
+ 
+         ai_response = dnsobj.qry(qtype='A', resulttype='integer')
+         self.assertTrue(ai_response.answers)
+-        self.assertEqual(ai_response.answers[0]['data'],1572395127)
++        self.assertEqual(ai_response.answers[0]['data'],1572395042)
+ 
+ 
+     def testDnsRequestAAAA(self):
+@@ -61,12 +61,12 @@ class TestBase(unittest.TestCase):
+         self.assertTrue(aaaa_response.answers)
+         # does the result look like an ipv6 address?
+         self.assertTrue(':' in aaaa_response.answers[0]['data'])
+-        self.assertEqual(aaaa_response.answers[0]['data'],'2606:2800:220:6d:26bf:1447:1097:aa7')
++        self.assertEqual(aaaa_response.answers[0]['data'],'2606:2800:220:1:248:1893:25c8:1946')
+ 
+         # default is returning ipaddress object
+         aaaad_response = dnsobj.qry(qtype='AAAA')
+         self.assertTrue(aaaad_response.answers)
+-        self.assertEqual(aaaad_response.answers[0]['data'],ipaddress.IPv6Address('2606:2800:220:6d:26bf:1447:1097:aa7'))
++        self.assertEqual(aaaad_response.answers[0]['data'],ipaddress.IPv6Address('2606:2800:220:1:248:1893:25c8:1946'))
+         
+         aaaab_response = dnsobj.qry(qtype='AAAA', resulttype='binary')
+         self.assertTrue(aaaab_response.answers)
+@@ -74,11 +74,11 @@ class TestBase(unittest.TestCase):
+         self.assertEqual(len(aaaab_response.answers[0]['data']) , 16)
+         for b in aaaab_response.answers[0]['data']:
+             assertIsByte(b)
+-        self.assertEqual(aaaab_response.answers[0]['data'],b'&\x06(\x00\x02 \x00m&\xbf\x14G\x10\x97\n\xa7')
++        self.assertEqual(aaaab_response.answers[0]['data'],b'&\x06(\x00\x02 \x00\x01\x02H\x18\x93%\xc8\x19F')
+         # IPv6 decimal
+         aaaai_response = dnsobj.qry(qtype='AAAA', resulttype='integer')
+         self.assertTrue(aaaai_response.answers)
+-        self.assertEqual(aaaai_response.answers[0]['data'], 50542628918019815862290244053507705511)
++        self.assertEqual(aaaai_response.answers[0]['data'], 50542628918019813867414319910101719366)
+ 
+     def testDnsRequestEmptyMX(self):
+         dnsobj = DNS.DnsRequest('example.org')
+@@ -168,7 +168,7 @@ class TestBase(unittest.TestCase):
+         self.assertTrue(ad_response.answers)
+         # is the result vaguely ipv4 like?
+         self.assertEqual(ad_response.answers[0]['data'].count('.'), 3)
+-        self.assertEqual(ad_response.answers[0]['data'],'93.184.216.119')
++        self.assertEqual(ad_response.answers[0]['data'],'93.184.216.34')
+ 
+     def testDnsRequestAAAAD(self):
+         dnsob = DNS.DnsRequest('example.org')
+@@ -180,7 +180,7 @@ class TestBase(unittest.TestCase):
+         self.assertEqual(len(aaaad_response.answers[0]['data']) , 16)
+         for b in aaaad_response.answers[0]['data']:
+             assertIsByte(b)
+-        self.assertEqual(aaaad_response.answers[0]['data'],b'&\x06(\x00\x02 \x00m&\xbf\x14G\x10\x97\n\xa7')
++        self.assertEqual(aaaad_response.answers[0]['data'],b'&\x06(\x00\x02 \x00\x01\x02H\x18\x93%\xc8\x19F')
+         
+     def testDnsRequestEmptyMXD(self):
+         dnsob = DNS.DnsRequest('example.org')



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