Issue 83: setup.py sdist does not include source files in generated tarball
Status:  Complete
Owner: ----
Closed:  Sep 2010
Reported by bs1...@gmail.com, Jan 8, 2010
The "sdist" target for distutils seems to be failing on Linux systems at least 
(not tested in Win32).  This prevents us from being able to upload to our 
private PyPI repository.


Using 
http://github.com/mkleehammer/pyodbc/commit/eb545758079a743b2e
809e2e219c8848bc6256b2

What steps will reproduce the problem?
1. python setup.py sdist
2. tar ztf dist/pyodbc*tar

What is the expected output? What do you see instead?

Should see the contents of the source directory.  Instead, the source 
distribution contains no "src" directory.

What version of the product are you using? On what operating system?

Linux x86_64, Python 2.4, 2.6

Please provide any additional information below.

I believe the problem occurs because the file list given to the Extension 
constructor contains a list of absolute paths.  In the Extension 
documentation [1], sources is specified to be "list of source filenames, 
relative to the distribution root (where the setup script lives)...".  If you 
remove the wrapper function abspath(), the source tarball is buildable.



[1] http://docs.python.org/distutils/apiref.html#distutils.core.Extension


Jan 8, 2010
#2 bs1...@gmail.com
Proposed fix at:

github.com/bshi/pyodbc/commit/810d25d4c248f52c2797dce39e426badc0b90aff
Jan 25, 2010
#3 bs1...@gmail.com
Hrm, above patch didn't quite do the trick.

The other issue looks like it's in the MANIFEST.in file.  Currently, this file uses "\" path 
separators which are windows only.  I think the solution is to change them to "/"... on 
win32 systems, I think the resulting MANIFEST file generated via parsing MANIFEST.in 
should correctly convert the slashes and, of course, the other setup commands will 
work on other systems (need to find myself a win32 system and verify).
Sep 6, 2010
Project Member #4 mkleehammer
Fixed in 2.1.8
Status: Fixed
Nov 12, 2010
#5 szybal...@gmail.com
Not sure if related but in Debian Lenny I get:

easy_install pyodbc
Searching for pyodbc
Reading http://pypi.python.org/simple/pyodbc/
Reading https://code.google.com/p/pyodbc
Reading https://code.google.com/p/pyodbc/downloads/list
Best match: pyodbc 2.1.8
Downloading http://pyodbc.googlecode.com/files/pyodbc-2.1.8.zip
Processing pyodbc-2.1.8.zip
Running pyodbc-2.1.8/setup.py -q bdist_egg --dist-dir /tmp/easy_install-WwrQ7E/pyodbc-2.1.8/egg-dist-tmp-LIPnCi
cc1plus: warning: command line option "-Wstrict-prototypes" is valid for Ada/C/ObjC but not for C++
In file included from /tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/buffer.cpp:12:
/tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/pyodbc.h:76:17: error: sql.h: No such file or directory
/tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/pyodbc.h:77:20: error: sqlext.h: No such file or directory
In file included from /tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/buffer.cpp:12:
/tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/pyodbc.h:93: error: ‘IsSet’ declared as an ‘inline’ variable
/tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/pyodbc.h:93: error: ‘DWORD’ was not declared in this scope
/tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/pyodbc.h:93: error: ‘DWORD’ was not declared in this scope
/tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/pyodbc.h:93: error: initializer expression list treated as compound expression
/tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/pyodbc.h:94: error: expected ‘,’ or ‘;’ before ‘{’ token
In file included from /tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/buffer.cpp:13:
/tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/buffer.h:44: error: ‘SQLLEN’ has not been declared
In file included from /tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/buffer.cpp:14:
/tmp/easy_install-WwrQ7E/pyodbc-2.1.8/src/pyodbcmodule.h:43: error: ‘HENV’ does not name a type
/usr/include/python2.5/datetime.h:186: warning: ‘PyDateTimeAPI’ defined but not used
error: Setup script exited with error: command 'gcc' failed with exit status 1

Thanks,
Lucas


Nov 12, 2010
#6 szybal...@gmail.com
I figured it out, sorry for posting.
On Debian Lenny you need this package as well:
aptitude install unixodbc-dev

So in general the documentation should say:
aptitude install python-dev
aptitude install unixodbc
aptitude install unixodbc-dev

Thanks,
Lucas





Nov 21, 2010
Project Member #7 mkleehammer
(No comment was entered for this change.)
Status: Complete
Nov 21, 2010
Project Member #8 mkleehammer
 Issue 88  has been merged into this issue.