security/py-merkletools: Refactor

Before python 3.6 version pysha3 was required as a runtime dependency
however after the import of sha3 this can be skipped. Additionally this
port has not been updated since 2019 and should be deprecated.

Approved by:	portmgr (blanket)
This commit is contained in:
Muhammad Moinur Rahman 2024-01-16 18:45:26 +01:00
parent da7ccecae7
commit 9aca78ddf6
No known key found for this signature in database
GPG Key ID: BDB9B5A617C0BC91
2 changed files with 19 additions and 3 deletions

View File

@ -1,6 +1,6 @@
PORTNAME= merkletools
DISTVERSION= 1.0.3
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= security python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -11,8 +11,6 @@ WWW= https://github.com/Tierion/pymerkletools
LICENSE= MIT
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}pysha3>0:security/py-pysha3@${PY_FLAVOR}
USES= python
USE_PYTHON= distutils autoplist
@ -20,6 +18,10 @@ NO_ARCH= yesA
POST_PLIST= rm-tests-from-plist
post-patch:
@${RM} ${WRKSRC}/requirements.txt ${WRKSRC}/merkletools.egg-info/requires.txt
@${REINPLACE_CMD} -e '/pysha3/d' ${WRKSRC}/setup.py
post-install:
@${RM} -r ${STAGEDIR}${PYTHON_SITELIBDIR}/tests

View File

@ -0,0 +1,14 @@
--- merkletools/__init__.py.orig 2024-01-16 17:39:29 UTC
+++ merkletools/__init__.py
@@ -1,11 +1,5 @@ import binascii
import hashlib
import binascii
-try:
- import sha3
-except:
- from warnings import warn
- warn("sha3 is not working!")
-
class MerkleTools(object):
def __init__(self, hash_type="sha256"):