commit:     bf0a50dcf5dba209c44bd676d2fe5a31c6abae06
Author:     Eli Schwartz <eschwartz93 <AT> gmail <DOT> com>
AuthorDate: Mon Jan 29 17:23:28 2024 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Jan 30 05:09:50 2024 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bf0a50dc

dev-vcs/git-filter-repo: replace crude hack with upstream version hints

setuptools-scm has a number of ways to detect the version of a package.
Of course getting it from a git repo is the base approach. For pypi
tarballs, it detects the version from the PKG-INFO file shipped in
sdists.

We have neither. But setuptools-scm also supports manually overriding it
in cases where you *know* the answer. There is no need to create a dummy
file: just export the "PRETEND_VERSION" variable and setuptools-scm will
respect it as an override.

Signed-off-by: Eli Schwartz <eschwartz93 <AT> gmail.com>
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-vcs/git-filter-repo/git-filter-repo-2.38.0-r2.ebuild | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/dev-vcs/git-filter-repo/git-filter-repo-2.38.0-r2.ebuild 
b/dev-vcs/git-filter-repo/git-filter-repo-2.38.0-r2.ebuild
index 7e7515e9e497..57e222c4e00d 100644
--- a/dev-vcs/git-filter-repo/git-filter-repo-2.38.0-r2.ebuild
+++ b/dev-vcs/git-filter-repo/git-filter-repo-2.38.0-r2.ebuild
@@ -22,15 +22,9 @@ RDEPEND="
 
 S="${S}/release"
 
-python_prepare_all() {
-       cat > PKG-INFO <<-EOF || die
-       Metadata-Version: 2.1
-       Name: git-filter-repo
-       Version: ${PV}
-       EOF
-
-       distutils-r1_python_prepare_all
-}
+# the git-archive tarball does not have version info; setuptools-scm
+# requires a valid source of version info, this one is for distros
+export SETUPTOOLS_SCM_PRETEND_VERSION=${PV}
 
 python_test() {
        cd .. || die

Reply via email to