[BACK]Return to Makefile CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / devel / py-importlib-metadata

File: [cvs.NetBSD.org] / pkgsrc / devel / py-importlib-metadata / Makefile (download)

Revision 1.31, Sat Nov 5 22:24:39 2022 UTC (15 months, 2 weeks ago) by joerg
Branch: MAIN
CVS Tags: pkgsrc-2023Q1-base, pkgsrc-2023Q1, pkgsrc-2022Q4-base, pkgsrc-2022Q4
Changes since 1.30: +10 -2 lines

Instead of depending on setuptools_scm, copy the version number of
PKG-INFO to setup.cfg directly.

# $NetBSD: Makefile,v 1.31 2022/11/05 22:24:39 joerg Exp $

DISTNAME=	importlib_metadata-4.12.0
PKGNAME=	${PYPKGPREFIX}-${DISTNAME:S/_/-/}
CATEGORIES=	devel python
MASTER_SITES=	${MASTER_SITE_PYPI:=i/importlib-metadata/}

MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	https://importlib-metadata.readthedocs.io/
COMMENT=	Read metadata from Python packages
LICENSE=	apache-2.0

BUILD_DEPENDS+=	${PYPKGPREFIX}-wheel-[0-9]*:../../devel/py-wheel
DEPENDS+=	${PYPKGPREFIX}-zipp>=0.5:../../archivers/py-zipp
TEST_DEPENDS+=	${PYPKGPREFIX}-importlib-resources-[0-9]*:../../devel/py-importlib-resources
TEST_DEPENDS+=	${PYPKGPREFIX}-fakefs-[0-9]*:../../devel/py-fakefs
TEST_DEPENDS+=	${PYPKGPREFIX}-packaging-[0-9]*:../../devel/py-packaging
TEST_DEPENDS+=	${PYPKGPREFIX}-test>=6:../../devel/py-test

USE_LANGUAGES=	# none

PYTHON_VERSIONS_INCOMPATIBLE=	27

.include "../../lang/python/pyversion.mk"

.if ${_PYTHON_VERSION} < 38
DEPENDS+=	${PYPKGPREFIX}-typing-extensions>=3.6.4:../../devel/py-typing-extensions
.endif

pre-build:
	${RUN} if ! ${GREP} '^version =' ${WRKSRC}/setup.cfg; then \
		cd ${WRKSRC}; \
		(${HEAD} -2 setup.cfg; \
		${GREP} 'Version:' PKG-INFO | ${SED} -e 's,^V',v, -e 's,:, = ,'; \
		${TAIL} -n +3 setup.cfg \
		) > setup.cfg.new && ${MV} setup.cfg.new setup.cfg; \
	fi

do-test:
	cd ${WRKSRC} && ${SETENV} ${TEST_ENV} pytest-${PYVERSSUFFIX} tests

# IMPORTANT: as long as there is Python 3.7, do not use wheel.mk;
# it requires devel/py-build which depends on this package.
PYSETUP=	-c 'from setuptools import setup; setup()'
.include "../../lang/python/egg.mk"
.include "../../mk/bsd.pkg.mk"