Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 897690 - dev-python/pyocr-0.8.3 compile failure: packaging.version.InvalidVersion: Invalid version: 'None'
Summary: dev-python/pyocr-0.8.3 compile failure: packaging.version.InvalidVersion: Inv...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-25 13:32 UTC by Ulrich Müller
Modified: 2023-02-28 17:16 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
build.log (build.log,5.90 KB, text/plain)
2023-02-25 13:33 UTC, Ulrich Müller
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ulrich Müller gentoo-dev 2023-02-25 13:32:28 UTC
>>> Compiling source in /tmp/portage/dev-python/pyocr-0.8.3/work/pyocr-0.8.3 ...
 * python3_10: running distutils-r1_run_phase distutils-r1_python_compile
 *   Building the wheel for pyocr-0.8.3 via setuptools.build_meta:__legacy__
gpep517 build-wheel --backend setuptools.build_meta:__legacy__ --output-fd 3 --wheel-dir /tmp/portage/dev-python/pyocr-0.8.3/work/pyocr-0.8.3-python3_10/wheel
2023-02-25 14:27:46,814 gpep517 INFO Building wheel via backend setuptools.build_meta:__legacy__
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/setuptools/_normalization.py", line 62, in safe_version
    return str(packaging.version.Version(v))
  File "/usr/lib/python3.10/site-packages/packaging/version.py", line 197, in __init__
    raise InvalidVersion(f"Invalid version: '{version}'")
packaging.version.InvalidVersion: Invalid version: 'None'

During handling of the above exception, another exception occurred:
[...]
Comment 1 Ulrich Müller gentoo-dev 2023-02-25 13:33:31 UTC
Created attachment 854602 [details]
build.log
Comment 2 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2023-02-25 13:48:14 UTC
So apparently the problem is that setup.py is passing:

  version=version

to setup().  In the setuptools_scm code branch, this resolves to:

  version=None

If I remove that line, everything seems to work fine.  I suspect either setuptools or setuptools_scm changed something and now version must not be passed at all when using SCM version.

The easy workaround is `/version=version/d`.  Upstream could probably achieve something similar to the current behavior by passing `version` override **kwargs style.
Comment 3 Larry the Git Cow gentoo-dev 2023-02-26 15:25:16 UTC
The bug has been closed via the following commit(s):

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

commit bda2d1aa7515f101dcdde4f37a8807889e7142b8
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2023-02-26 15:20:03 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2023-02-26 15:25:11 +0000

    dev-python/pyocr: Fix version-related build failure
    
    Closes: https://bugs.gentoo.org/897690
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 dev-python/pyocr/pyocr-0.8.3.ebuild | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
Comment 4 Bernard Cafarelli gentoo-dev 2023-02-28 17:16:15 UTC
Thanks for the fix! And nice to see it merged upstream already too