open-iscsi / rtslib-fb

Python library for configuring the Linux kernel-based multiprotocol SCSI target (LIO)
Apache License 2.0
73 stars 90 forks source link

`python3 setup.py install` fails if `__version__` has `.g<hash>` at end #188

Closed BrendanCunningham closed 1 year ago

BrendanCunningham commented 2 years ago

Running RHEL 8.2, using in-distro Python 3.6.

To reproduce:

  1. Starting with clone/checkout of rtslib-fb/master, working directory clean, no untracked files.
  2. make release
  3. cd dist
  4. tar xzvf <dist tarball produced in step #2>
  5. cd <dist tarball expansion directory>
  6. python3 setup.py install; command fails with the following output:
    Traceback (most recent call last):
      File "setup.py", line 33, in <module>
        raise Exception("Couldn't find version in setup.py")
    Exception: Couldn't find version in setup.py
    bcunningham@cn-priv-03:rtslib-fb-2.1.75.4.g99a6371 (master)$ echo $?
    1

Where this is my git describe --tags output:

bcunningham@cn-priv-03:rtslib-fb (master)$ git describe --tags
v2.1.75-4-g99a6371

And here's the __version__ in the dist tarball's rtslib/__init__.py: `version = '2.1.75.4.g99a6371'

If I edit that file and remove the .g99a6371, python3 setup.py install succeeds.