Skip to content

Commit

Permalink
security/py-merkletools: Refactor
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
5u623l20 committed Jan 16, 2024
1 parent da7ccec commit 9aca78d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 3 deletions.
8 changes: 5 additions & 3 deletions security/py-merkletools/Makefile
@@ -1,6 +1,6 @@
PORTNAME= merkletools
DISTVERSION= 1.0.3
PORTREVISION= 1
PORTREVISION= 2
CATEGORIES= security python
MASTER_SITES= PYPI
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
Expand All @@ -11,15 +11,17 @@ 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

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

Expand Down
14 changes: 14 additions & 0 deletions security/py-merkletools/files/patch-merkletools_____init____.py
@@ -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"):

0 comments on commit 9aca78d

Please sign in to comment.