denisenkom / pytds

Python DBAPI driver for MSSQL using pure Python TDS (Tabular Data Stream) protocol implementation
MIT License
192 stars 53 forks source link

Cannot build 1.8.0 with python-3.4 from pypi zip #54

Closed g1itch closed 8 years ago

g1itch commented 8 years ago

Got following

$ python3.4 setup.py build
Traceback (most recent call last):
  File "setup.py", line 8, in <module>
    version=version.get_git_version(),
  File "/tmp/python-tds-1.8.0/version.py", line 90, in get_git_version
    raise ValueError("Cannot find the version number!")
ValueError: Cannot find the version number!

I think the problem is that there is no .git directory in pypi zip:

>>> from subprocess import Popen, PIPE
>>> p = Popen(['git', 'describe', '--abbrev=%d' % 4],stdout=PIPE, stderr=PIPE)
>>> p.stdout.readlines()
[]
>>> p.stderr.readlines()
[b'fatal: Not a git repository (or any of the parent directories): .git\n']

In read_release_version()

>>> f = open("RELEASE-VERSION", "r")
>>> version = f.readlines()[0]
>>> version
'1.8.0\n'
>>> version.strip().decode('utf8')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
AttributeError: 'str' object has no attribute 'decode'
denisenkom commented 8 years ago

Fixed in v 1.8.1