Package: whipper
Severity: normal
Version: 0.9.0-1+b1
Tag: patch

Hi!

Running whipper reports the wrong version:

$ whipper --version
> whipper 0.0.0

This is pretty annoying, since it messes up the log files and we can't
modify them manually since they include a checksum :(

Looking at the upstream code, __init.py__ is where the version gets decided:

```
try:
    __version__ = get_distribution(__name__).version
except (DistributionNotFound, RequirementParseError):
    # not installed as package or is being run from source/git checkout
    from setuptools_scm import get_version
    __version__ = get_version()
```

So `get_distribution(__name__).version` looks at
whipper-0.0.0.egg-info/PKG-INFO and read the version there, which is 0.0.0

Looking at the upstream issue tracker[1], it seems what should be done
is set SETUPTOOLS_SCM_PRETEND_VERSION during build.

Anyways, all this to say, here's a patch: I've built the package
successfully and it seems to fix the issue.

Cheers!

[1]: https://github.com/whipper-team/whipper/issues/428

-- 
  ⢀⣴⠾⠻⢶⣦⠀
  ⣾⠁⢠⠒⠀⣿⡁  Louis-Philippe Véronneau
  ⢿⡄⠘⠷⠚⠋   po...@debian.org / veronneau.org
  ⠈⠳⣄
diff --git a/debian/control b/debian/control
index 74ef5b4..4be5225 100644
--- a/debian/control
+++ b/debian/control
@@ -9,6 +9,7 @@ Build-Depends:
  python3-dev,
  python3-musicbrainzngs,
  python3-setuptools,
+ python3-setuptools-scm,
 ## tests
 # cd-paranoia,
 # cdrdao,
diff --git a/debian/patches/dont-require-setuptools-scm.diff b/debian/patches/dont-require-setuptools-scm.diff
index b9e69ef..dde5589 100644
--- a/debian/patches/dont-require-setuptools-scm.diff
+++ b/debian/patches/dont-require-setuptools-scm.diff
@@ -2,15 +2,6 @@ diff --git a/setup.py b/setup.py
 index 96bebf5..464cbeb 100644
 --- a/setup.py
 +++ b/setup.py
-@@ -2,7 +2,7 @@ from setuptools import setup, find_packages, Extension
- 
- setup(
-     name="whipper",
--    use_scm_version=True,
-+#    use_scm_version=True,
-     description="a secure cd ripper preferring accuracy over speed",
-     author=['Thomas Vander Stichele', 'The Whipper Team'],
-     maintainer=['The Whipper Team'],
 @@ -10,7 +10,7 @@ setup(
      license='GPL3',
      python_requires='>=3.5',
diff --git a/debian/rules b/debian/rules
index 81fdfa0..fe8518a 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,5 +1,7 @@
 #!/usr/bin/make -f
 
+export SETUPTOOLS_SCM_PRETEND_VERSION=$(DEB_VERSION_UPSTREAM)
+
 %:
 	dh $@ --with python3 --buildsystem=pybuild
 

Attachment: signature.asc
Description: OpenPGP digital signature

  • Bug#961770: whipper reports being version 0.0.0 Louis-Philippe Véronneau

Reply via email to