Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 26 Jan 2016 14:26:01 +0000 (UTC)
From:      Kubilay Kocak <koobs@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r407274 - in head/dns/py-py3dns: . files
Message-ID:  <201601261426.u0QEQ1Lu045082@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: koobs
Date: Tue Jan 26 14:26:01 2016
New Revision: 407274
URL: https://svnweb.freebsd.org/changeset/ports/407274

Log:
  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)
  MFH:			2016Q1
  Differential Revision:	D5083

Added:
  head/dns/py-py3dns/files/patch-DNS_tests_test__base.py   (contents, props changed)
Deleted:
  head/dns/py-py3dns/files/patch-DNS-Base.py
Modified:
  head/dns/py-py3dns/Makefile

Modified: head/dns/py-py3dns/Makefile
==============================================================================
--- head/dns/py-py3dns/Makefile	Tue Jan 26 14:01:37 2016	(r407273)
+++ head/dns/py-py3dns/Makefile	Tue Jan 26 14:26:01 2016	(r407274)
@@ -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>

Added: head/dns/py-py3dns/files/patch-DNS_tests_test__base.py
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/dns/py-py3dns/files/patch-DNS_tests_test__base.py	Tue Jan 26 14:26:01 2016	(r407274)
@@ -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?201601261426.u0QEQ1Lu045082>