1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-21 08:42:23 +00:00

Fix RUN_DEPENDS

- Bump PORTREVISION for dependency change

devel/py-importlib-metadata is not required for python 3.8+.
This commit is contained in:
Sunpoet Po-Chuan Hsieh 2020-07-11 18:10:59 +00:00
parent ea87bb6325
commit ff5bf8c5b4
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=542025
3 changed files with 37 additions and 2 deletions

View File

@ -3,6 +3,7 @@
PORTNAME= signedjson
PORTVERSION= 1.1.1
PORTREVISION= 1
CATEGORIES= security devel python
MASTER_SITES= CHEESESHOP
PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX}
@ -15,7 +16,6 @@ LICENSE_FILE= ${WRKSRC}/LICENSE
BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools_scm>=0:devel/py-setuptools_scm@${PY_FLAVOR}
RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}canonicaljson>=1.0.0:devel/py-canonicaljson@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}importlib-metadata>=0:devel/py-importlib-metadata@${PY_FLAVOR} \
${PYTHON_PKGNAMEPREFIX}pynacl>=0.3.0:security/py-pynacl@${PY_FLAVOR} \
${PY_TYPING} \
${PYTHON_PKGNAMEPREFIX}typing-extensions>=3.5:devel/py-typing-extensions@${PY_FLAVOR} \
@ -27,7 +27,13 @@ USE_PYTHON= autoplist concurrent distutils
NO_ARCH= yes
.include <bsd.port.pre.mk>
.if ${PYTHON_REL} < 3800
RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}importlib-metadata>=0:devel/py-importlib-metadata@${PY_FLAVOR}
.endif
do-test:
@(cd ${WRKSRC} && ${PYTHON_CMD} -m pytest tests)
.include <bsd.port.mk>
.include <bsd.port.post.mk>

View File

@ -0,0 +1,13 @@
Obtained from: https://github.com/matrix-org/python-signedjson/commit/c40c83f844fee3c1c7b0c5d1508f87052334b4e5
--- setup.py.orig 2020-03-27 19:41:34 UTC
+++ setup.py
@@ -41,7 +41,7 @@ setup(
"pynacl>=0.3.0",
"typing_extensions>=3.5",
'typing>=3.5;python_version<"3.5"',
- "importlib_metadata",
+ 'importlib_metadata;python_version<"3.8"',
],
long_description=read_file(("README.rst",)),
keywords="json",

View File

@ -0,0 +1,16 @@
Obtained from: https://github.com/matrix-org/python-signedjson/commit/c40c83f844fee3c1c7b0c5d1508f87052334b4e5
--- signedjson/__init__.py.orig 2020-03-27 19:41:34 UTC
+++ signedjson/__init__.py
@@ -12,7 +12,10 @@
# See the License for the specific language governing permissions and
# limitations under the License.
-from importlib_metadata import version, PackageNotFoundError
+try:
+ from importlib.metadata import version, PackageNotFoundError
+except ImportError: # pragma: nocover
+ from importlib_metadata import version, PackageNotFoundError
try:
__version__ = version(__name__)