Re: How to determine if archive is an sdist or bdist

PJ Eby <[email protected]> Thu, 28 Mar 2013 16:36:22 -0400
Newsgroups gmane.comp.python.catalog
Message-ID <CALeMXf5kx++DG+LEzm3+syM_QoXS8aAiByJKycRyUbPoL8c6ag@mail.gmail.com>
On Thu, Mar 28, 2013 at 3:57 PM, James Carpenter <[email protected]> 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.