git: 3aef29c26f68 - main - textproc/py-ntc-templates: Update to 3.1.0

From: Kai Knoblich <kai_at_FreeBSD.org>
Date: Sun, 04 Sep 2022 12:22:30 UTC
The branch main has been updated by kai:

URL: https://cgit.FreeBSD.org/ports/commit/?id=3aef29c26f68393f84226b75c6486f1f862eb7c4

commit 3aef29c26f68393f84226b75c6486f1f862eb7c4
Author:     Kai Knoblich <kai@FreeBSD.org>
AuthorDate: 2022-09-04 12:13:42 +0000
Commit:     Kai Knoblich <kai@FreeBSD.org>
CommitDate: 2022-09-04 12:20:14 +0000

    textproc/py-ntc-templates: Update to 3.1.0
    
    * Add post-patch target which sets the actual version in setup.py
      to reduce patching with future updates.
    
    Changelog:
    
    https://github.com/networktocode/ntc-templates/releases/tag/v3.1.0
---
 textproc/py-ntc-templates/Makefile             | 6 +++++-
 textproc/py-ntc-templates/distinfo             | 6 +++---
 textproc/py-ntc-templates/files/patch-setup.py | 2 +-
 3 files changed, 9 insertions(+), 5 deletions(-)

diff --git a/textproc/py-ntc-templates/Makefile b/textproc/py-ntc-templates/Makefile
index 40e60e413c59..e312f9229b14 100644
--- a/textproc/py-ntc-templates/Makefile
+++ b/textproc/py-ntc-templates/Makefile
@@ -1,6 +1,6 @@
 PORTNAME=	ntc-templates
 DISTVERSIONPREFIX=	v
-DISTVERSION=	3.0.0
+DISTVERSION=	3.1.0
 CATEGORIES=	textproc net-mgmt python
 PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 
@@ -24,6 +24,10 @@ TEST_ENV=	PYTHONPATH=${STAGEDIR}${PYTHONPREFIX_SITELIBDIR}
 
 NO_ARCH=	yes
 
+post-patch:
+	@${REINPLACE_CMD} -e 's|%%DISTVERSION%%|${DISTVERSION}|' \
+		${WRKSRC}/setup.py
+
 do-test:
 	@cd ${WRKSRC} && ${SETENV} ${TEST_ENV} ${PYTHON_CMD} -m pytest -v -rs
 
diff --git a/textproc/py-ntc-templates/distinfo b/textproc/py-ntc-templates/distinfo
index 32e85ebb0cc4..13455d188288 100644
--- a/textproc/py-ntc-templates/distinfo
+++ b/textproc/py-ntc-templates/distinfo
@@ -1,3 +1,3 @@
-TIMESTAMP = 1648157996
-SHA256 (networktocode-ntc-templates-v3.0.0_GH0.tar.gz) = d5f1148926b1b7a5929ac4896dfa6712bef840d2fb33710fbe6fe505c9f34a6f
-SIZE (networktocode-ntc-templates-v3.0.0_GH0.tar.gz) = 752785
+TIMESTAMP = 1662218002
+SHA256 (networktocode-ntc-templates-v3.1.0_GH0.tar.gz) = e6aafd7dda5a74ccd85ce49868d9a9902e6553fd4944d01b24ecaf76d81a453e
+SIZE (networktocode-ntc-templates-v3.1.0_GH0.tar.gz) = 802415
diff --git a/textproc/py-ntc-templates/files/patch-setup.py b/textproc/py-ntc-templates/files/patch-setup.py
index 9412c6341606..279ced16c65b 100644
--- a/textproc/py-ntc-templates/files/patch-setup.py
+++ b/textproc/py-ntc-templates/files/patch-setup.py
@@ -15,7 +15,7 @@
 +
 +setup_kwargs = {
 +    'name': 'ntc-templates',
-+    'version': '3.0.0',
++    'version': '%%DISTVERSION%%',
 +    'description': "TextFSM Templates for Network Devices, and Python wrapper for TextFSM's CliTable.",
 +    'author': 'Network to Code',
 +    'author_email': 'info@networktocode.com',