Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 706420

Summary: dev-python/python-jsonrpc-server-0.3.2: invalid version number (0+unknown)
Product: Gentoo Linux Reporter: phkb <phkbphkbphkb>
Component: Current packagesAssignee: Andrew Nowa Ammerlaan <andrewammerlaan>
Status: RESOLVED FIXED    
Severity: normal CC: andrewammerlaan, jj, jstein, proxy-maint
Priority: Normal Keywords: PullRequest
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: https://github.com/gentoo/gentoo/pull/14463
Whiteboard:
Package list:
Runtime testing required: ---

Description phkb 2020-01-26 10:47:17 UTC
The package version is incorrectly detected during the package build and the installed version number is incorrect (0+unknown, instead of 0.3.2). This prevent dev-python/python-language-server to work.

It seems that the package is using the following to get the version number:
version=versioneer.get_version()

Running "python3 -c "import versioneer; print(versioneer.get_version())" in the work directory after "ebuild prepare" returns 0+unknown.
Comment 1 Andrew Nowa Ammerlaan gentoo-dev 2020-01-26 16:24:49 UTC
Hmm, 'pip check' also shows this on my system. 

andrew@andrew-gentoo-pc profiles % pip check
python-language-server 0.31.2 has requirement python-jsonrpc-server>=0.3.2, but you have python-jsonrpc-server 0+unknown.

I use 'pip check' a lot to check dependencies so I'm a bit surprised that I didn't notice this before. I'm convinced pip didn't show this before, I will investigate what is causing this problem. Though, I have a hunch that this might be due to a difference between the pypi release tarball and the one on github.
Comment 2 Andrew Nowa Ammerlaan gentoo-dev 2020-01-26 19:04:00 UTC
My hunch was correct, the github release tarball does not contain a '_version.py' file like the pypi tarball does. I have just now created a pull request for the fix, also did a version bump while I was at it.
Comment 3 Jonas Jelten 2020-02-09 23:07:34 UTC
My downloaded package has a _version file. It is is scanned line-by-line for
versioneer.py(955):             if line.strip().startswith("git_refnames ="):
versioneer.py(959):             if line.strip().startswith("git_full ="):
versioneer.py(963):             if line.strip().startswith("git_date ="):
but of course nothing is found, since it's the git-version-detector's source code.

Can we please just patch out that versioneer stuff and just use ${PV}?

versioneer wins my overengineering award of the month.
Comment 4 Andrew Nowa Ammerlaan gentoo-dev 2020-02-11 09:57:17 UTC
> Can we please just patch out that versioneer stuff and just use ${PV}?

We could do that, but switching the SRC_URI to the pypi tarballs instead of the github ones also fixes this and is less work. And probably more stable long term, patches tend to break on version bumps. So unless there is a good reason to keep using the github tarballs, I suggest we just switch to pypi.

> versioneer wins my overengineering award of the month.

Definitely, this whole versioneer thing seems needlessly complicated :(
Comment 5 phkb 2020-02-13 07:37:19 UTC
I agree that it is a mess.

I can confirm the newer ebuild in your PR works. Thanks!
Comment 6 Larry the Git Cow gentoo-dev 2020-02-15 20:43:02 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4807704fd4dd65b3133dc886652ed6d480d8b4e

commit a4807704fd4dd65b3133dc886652ed6d480d8b4e
Author:     Andrew Ammerlaan <andrewammerlaan@riseup.net>
AuthorDate: 2020-01-26 18:54:51 +0000
Commit:     Matt Turner <mattst88@gentoo.org>
CommitDate: 2020-02-15 20:37:59 +0000

    dev-python/python-jsonrpc-server: Version bump 0.3.4
    
    Bug fix, github release tarball does not contain
    correct version info
    
    Bug: https://bugs.gentoo.org/706420
    Package-Manager: Portage-2.3.85, Repoman-2.3.20
    Signed-off-by: Andrew Ammerlaan <andrewammerlaan@riseup.net>
    Signed-off-by: Matt Turner <mattst88@gentoo.org>

 dev-python/python-jsonrpc-server/Manifest          |  2 +-
 ...sonrpc-server-0.3.4-remove-pytest-cov-dep.patch | 15 ++++++++++++++
 ...2.ebuild => python-jsonrpc-server-0.3.4.ebuild} | 23 +++++++++++-----------
 3 files changed, 27 insertions(+), 13 deletions(-)