unhandled PBR Exception "Versioning for this project requires either an sdist tarball" with older (<0.7.2) setuptools
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
PBR |
Won't Fix
|
High
|
Unassigned | ||
python-swiftclient |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
Recent versions (>=2.2.0) of swiftclient have been observed to die with the puzzling message "Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?" E.g., the stack trace excerpt below is from a Django project I have (but, perhaps surprisingly, although this error prevents the site from functioning at all, I can successfully import swiftclient at the Python REPL):
```
31. import swiftclient
File "/usr/local/
20. from .client import *
File "/usr/local/
34. from swiftclient import version as swiftclient_version
File "/usr/local/
28. version_string = str(pbr.
File "/usr/local/
39. return self.version_
File "/usr/local/
78. for part in self.release_
File "/usr/local/
70. self.release = self._get_
File "/usr/local/
62. return packaging.
File "/usr/local/
864. raise Exception(
Exception Type: Exception at /
Exception Value: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?
```
It turns out that this can be fixed by upgrading setuptools (thanks to notmyname in #openstack-swift on Freenode for help debugging this the other month), and binary-searching the versions of setuptools available to install via Pip, I observe that the error occurs with setuptools 0.6c9 but not setuptools 0.7.2.
This is perhaps not the most important bug, since it has such an easy fix ("pip install --upgrade setuptools"), but it is really confusing if you happen to have old Python packages and run into it.
I'm not sure if this needs to be better messages in swiftclient or if something needs to be added to pbr.