It sounds like you're trying to package an entire application, not a python package. If thats the case, maintaining and distributing it may be simplest to do with a git repository.
162 karma · joined August 18, 2012
Additionally, there's no point checking that the script is the main file, as there's only ever one use-case for the script, and that's to call setuptools.