From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5CF7E158087 for ; Wed, 26 Jan 2022 08:28:58 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 326012BC008; Wed, 26 Jan 2022 08:28:56 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (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) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id C609E2BC004 for ; Wed, 26 Jan 2022 08:28:55 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (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) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 8C33A342EC5 for ; Wed, 26 Jan 2022 08:28:54 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id F16F22A0 for ; Wed, 26 Jan 2022 08:28:52 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1643185722.3d8f12eae3c3f8996068e05aaa65cb97f0abaeb1.mgorny@gentoo> Subject: [gentoo-commits] proj/gentoo-syntax:master commit in: plugin/ X-VCS-Repository: proj/gentoo-syntax X-VCS-Files: plugin/newebuild.vim X-VCS-Directories: plugin/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: 3d8f12eae3c3f8996068e05aaa65cb97f0abaeb1 X-VCS-Branch: master Date: Wed, 26 Jan 2022 08:28:52 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: b1544984-4624-4bfd-a8b5-4da7275ff222 X-Archives-Hash: 91ce87aabc8059bd58b4aa692dfc5757 commit: 3d8f12eae3c3f8996068e05aaa65cb97f0abaeb1 Author: Michał Górny gentoo org> AuthorDate: Tue Jan 25 10:51:05 2022 +0000 Commit: Michał Górny gentoo org> CommitDate: Wed Jan 26 08:28:42 2022 +0000 URL: https://gitweb.gentoo.org/proj/gentoo-syntax.git/commit/?id=3d8f12ea newebuild: Modernize the Python template Use PEP517 build. It defaults to setuptools but the eclass will detect if this is incorrect. Add a default pypi HOMEPAGE based on the package name. Skip DEPEND. Python packages rarely need this class of dependencies, RDEPEND + BDEPEND are much more common. Add empty "test?" block in BDEPEND, as this is often necessary. If it is not, it is easy to yank it. Add distutils_enable_tests. It defaults to pytest, as the most common variant. It will also trigger explicit failure if the package has no tests. Signed-off-by: Michał Górny gentoo.org> plugin/newebuild.vim | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/plugin/newebuild.vim b/plugin/newebuild.vim index 36db2dd..bd80712 100644 --- a/plugin/newebuild.vim +++ b/plugin/newebuild.vim @@ -21,6 +21,8 @@ fun! MakeNewEbuild() let l:filename = expand("%:p") let l:category = substitute(l:filename, \ "^.*/\\([^/]\\+\\)/[^/]\\+/[^/]\\+\\.ebuild", "\\1", "g") + let l:package = substitute(l:filename, + \ "^.*/\\([^/]\\+\\)/[^/]\\+\\.ebuild", "\\1", "g") " use empty keywords for live ebuilds if l:filename =~# "-9999\\+.ebuild\$" @@ -155,6 +157,7 @@ fun! MakeNewEbuild() " {{{ standard default setup " {{{ extra inherits for some categories if l:category ==# "dev-python" + put ='DISTUTILS_USE_PEP517=setuptools' put ='PYTHON_COMPAT=( ' . GentooGetPythonTargets() . ' )' put ='inherit distutils-r1' put ='' @@ -162,7 +165,9 @@ fun! MakeNewEbuild() " }}} put ='DESCRIPTION=\"\"' - put ='HOMEPAGE=\"\"' + put ='HOMEPAGE=\"' + put =' https://pypi.org/project/' . l:package . '/' + put ='\"' put ='SRC_URI=\"\"' put ='' put ='LICENSE=\"\"' @@ -171,9 +176,19 @@ fun! MakeNewEbuild() put ='' " {{{ extra deps for some categories - put ='DEPEND=\"\"' - put ='RDEPEND=\"${DEPEND}\"' - put ='BDEPEND=\"\"' + if l:category ==# "dev-python" + put ='RDEPEND=\"\"' + put ='BDEPEND=\"' + put =' test? (' + put =' )' + put ='\"' + put ='' + put ='distutils_enable_tests pytest' + else + put ='DEPEND=\"\"' + put ='RDEPEND=\"${DEPEND}\"' + put ='BDEPEND=\"\"' + endif " }}} endif