From nobody Sun Aug 21 20:16:10 2022 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4M9mwB5vxdz4ZfmZ; Sun, 21 Aug 2022 20:16:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4M9mwB5QMzz3b4J; Sun, 21 Aug 2022 20:16:10 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661112970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5r8d6fwcT0c6NYZPl7R40R8l9sCs2e8TP9kl0JUbKuE=; b=gBYibCo/qHiQQ4qH/rV+6FBd53UPW4IemhNMetbDvSjXoMzdfsqUjHhTsLpq58JGPXbQug w06VxVsSAZVflTtrnar6uHUTuhz6EvMpDWKwwhXg3mw+18gskL2g64p80tIRekwxG2LZ+e Gxe/f/DToZt9TN6oRQ0i+IV/BrHWMkXHvMsYh4sBQmwHU/D3PyjI2ZbwTJF+mObSXVivTs IxGR6lozLygCF1bMyZaVqkEkIbLGuz+/7F05coKBC10Hb/xHZP0ar5j+Qwh8nN7hXRo+Hb FA49Alizf3TKC24SakE3jHvxgzhjQv2UjCN2Cbg3nhZFRsdZEaHYKsUFb2i6jQ== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4M9mwB4F21zNZJ; Sun, 21 Aug 2022 20:16:10 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 27LKGASr050820; Sun, 21 Aug 2022 20:16:10 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 27LKGAYJ050818; Sun, 21 Aug 2022 20:16:10 GMT (envelope-from git) Date: Sun, 21 Aug 2022 20:16:10 GMT Message-Id: <202208212016.27LKGAYJ050818@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Yuri Victorovich Subject: git: 600312a9118b - main - Mk/Uses/python.mk: Add USE_PYTHON=build to support pyproject.toml based projects List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: yuri X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 600312a9118bc7b9c5bb7decbefe706f9046507b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1661112970; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=5r8d6fwcT0c6NYZPl7R40R8l9sCs2e8TP9kl0JUbKuE=; b=xSidQ0JiU2kTqpp3T2n/6pP0G20he/zXQoH80SxNsOwpsWZZlvJeHtnThGkyBsGhY5m3NK fHeEt9Q+mLIoOJmvprKfrBYWyVj1E3NUEG/mvjHb2Mt6EtHFM7VATI1yU21s5WuUE1Uayh gFSPga4U2jowFhk8NLijNqiYn06wqdyTsY5JFnn9AjRDwQTHRfNx/HAtLskeSO7HOhEKdd iITBpj+Lo5mkBd21EV+jEgpYE6SJW7LVNRufdHND3XQWXWLKQJPlTgQAw/yc+6z65bTTRY 93m1K/w8cAWbILH73/dXJppZJsZWTbudhzFCWRivx68BF1q3ZFEZiRL6QCmPUQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1661112970; a=rsa-sha256; cv=none; b=EdTaH0vLkBLGOMcRZiHXQvAfqQVDWgvhTDouorTiewTYYTSQQN6LBHVGIy7zttYgFsiKh2 Ld9Ea26n228iWEojXjtSz+9A/I+yjU6piZgHXYcp0vFB1rjNI1LmXfj8R28B0cqUYU7EHL WntrDQSveu8ZC6wErKvlLDoXcC7bv7JWZhBSDa83pUAANnuWrsa1Qn8ZFMABNS7EMH4Vor XHdcHKOe0h6w2DCMe7ZrUvz9pTeDyQ3dI6ekUMs+owFHpQY/Bm29FT5yKJvMDFjLtowVnZ C7mhnyh5H13QYMxOhQjooKpiOZi6TURE2SpPaL5PtjGOLSiJM9zkgjFntixvTQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by yuri: URL: https://cgit.FreeBSD.org/ports/commit/?id=600312a9118bc7b9c5bb7decbefe706f9046507b commit 600312a9118bc7b9c5bb7decbefe706f9046507b Author: Yuri Victorovich AuthorDate: 2022-08-21 19:46:39 +0000 Commit: Yuri Victorovich CommitDate: 2022-08-21 20:16:06 +0000 Mk/Uses/python.mk: Add USE_PYTHON=build to support pyproject.toml based projects USE_PYTHON=build supports PEP-517 at the level of individual ports. Global support (making PEP-517 be used for all ports) is outside of the scope of this patch. PR: 255722 Approved by: python (maintainer's timeout; 14 days) Differential Revision: https://reviews.freebsd.org/D36061 --- Mk/Uses/python.mk | 48 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 47 insertions(+), 1 deletion(-) diff --git a/Mk/Uses/python.mk b/Mk/Uses/python.mk index fa7c7b7b7084..492cfe055773 100644 --- a/Mk/Uses/python.mk +++ b/Mk/Uses/python.mk @@ -103,6 +103,9 @@ # distutils - Use distutils as do-configure, do-build and # do-install targets. implies flavors. # +# build - Use build/installer as do-build and +# do-install targets. implies flavors. +# # autoplist - Automatically generates the packaging list for a # port that uses distutils when defined. # requires: distutils @@ -281,7 +284,7 @@ _PYTHON_BASECMD= ${LOCALBASE}/bin/python _PYTHON_RELPORTDIR= lang/python # List all valid USE_PYTHON features here -_VALID_PYTHON_FEATURES= allflavors autoplist concurrent cython cython_run \ +_VALID_PYTHON_FEATURES= allflavors autoplist build concurrent cython cython_run \ distutils flavors noegginfo noflavors nose nose2 \ optsuffix py3kplist pytest pytest4 pythonprefix \ unittest unittest2 @@ -309,6 +312,12 @@ IGNORE= uses either USE_PYTHON=pytest or USE_PYTHON=pytest4, not both of them _PYTHON_FEATURE_FLAVORS= yes . endif +# build automatically generates flavors depending on the supported +# versions. +. if defined(_PYTHON_FEATURE_BUILD) +_PYTHON_FEATURE_FLAVORS= yes +. endif + . if defined(_PYTHON_FEATURE_NOFLAVORS) .undef _PYTHON_FEATURE_FLAVORS . endif @@ -595,6 +604,26 @@ RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}setuptools>=63.1.0:devel/py-setuptools@${P . endif . endif +. if defined(_PYTHON_FEATURE_BUILD) +. if ${PYTHON_VER} == 2.7 +DEV_ERROR+= "USES=python:2.7 is incompatible with USE_PYTHON=build" +. endif +. if defined(_PYTHON_FEATURE_DISTUTILS) +DEV_ERROR+= "USE_PYTHON=distutils is incompatible with USE_PYTHON=build" +. endif +. if defined(_PYTHON_FEATURE_AUTOPLIST) +DEV_ERROR+= "USE_PYTHON=autoplist is incompatible with USE_PYTHON=build" +. endif +. if defined(_PYTHON_FEATURE_PY3KPLIST) +DEV_ERROR+= "USE_PYTHON=py3kplist is incompatible with USE_PYTHON=build" +. endif +. if defined(_PYTHON_FEATURE_NOEGGINFO) +DEV_ERROR+= "USE_PYTHON=noegginfo is incompatible with USE_PYTHON=build" +. endif +BUILD_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}build>0:devel/py-build@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}installer>0:devel/py-installer@${PY_FLAVOR} +. endif + # distutils support PYSETUP?= setup.py PYDISTUTILS_SETUP?= -c \ @@ -790,6 +819,23 @@ do-install: . endif . endif # defined(_PYTHON_FEATURE_DISTUTILS) +. if defined(_PYTHON_FEATURE_BUILD) +. if !target(do-configure) +do-configure: + @${DO_NADA} +. endif + +. if !target(do-build) +do-build: + @cd ${BUILD_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} -m build --wheel --no-isolation --outdir ${WRKDIR} +. endif + +. if !target(do-install) +do-install: + @cd ${INSTALL_WRKSRC} && ${SETENV} ${MAKE_ENV} ${PYTHON_CMD} -m installer ${WRKDIR}/*.whl --destdir ${STAGEDIR} +. endif +. endif # defined(_PYTHON_FEATURE_BUILD) + . if defined(_PYTHON_FEATURE_NOSE) . if !target(do-test) do-test: