[Catalog-sig] How to determine if archive is an sdist or bdist

PJ Eby pje at telecommunity.com
Thu Mar 28 21:36:22 CET 2013


On Thu, Mar 28, 2013 at 3:57 PM, James Carpenter <nawkboy at gmail.com> wrote:
> Is there an easy way to programmatically tell if an archive (tar.gz, zip,
> etc.) in the dist directory is a binary or sdist? I would like to
> post-process the contents of a dist directory and classify each build
> artifact there (egg, sdist, bdist, etc.).

An sdist always has a single subdirectory in the archive's root
directory, named for the package+version, and containing a PKG-INFO
and setup.py (plus a bunch of other stuff).

A bdist_dumb will not have such a subdirectory in the archive root;
instead it will have one or more directories like /usr, /opt, /Program
Files.

Other bdist formats?  Hard to say.


More information about the Catalog-SIG mailing list