1. Tarek Ziadé
  2. distribute
Issue #37 wontfix

"setup.py sdisk_check" to verify the generated sdist

Sridhar Ratnakumar
created an issue

Presently a significant amount of packages in PyPI do not even install properly. They fail mainly due to missing files in the tarball. For example, one packages fails at "import ez_setup" because ez_setup.py was not distributed in the tarball. Some other packages fail due to missing README.txt that is used to set the long_description in setup.py (open('README.txt').read()).

I suggest that we implement a sdist_check command that would do a check on the generated a sdist using virtualenv (if installed). Packages authors can then use it before uploading their untested, low-quality tarballs to PyPI.

If required, I can dig into the PyPM build logs and provide more details about the failing packages.

Comments (6)

  1. Tarek Ziadé repo owner

    Sounds good,

    although, there's a "check" command now in distutils trunk, we can backport and extend for our needs, by adding extra checks. I don't think we really need to build a sdist though, since all theses QA checks could be done within the source tree.

  2. Sridhar Ratnakumar reporter

    I don't think we really need to build a sdist though, since all theses QA checks could be done within the source tree.

    Consider a scenario that this 'check' command runs 'python setup.py install --root=env1/'. Now this command cannot be run with the source tree as the PWD; otherwise, we cannot catch errors related to `missing files in sdist`.

  3. Tarek Ziadé repo owner

    In the scenario your are describing, you "just" need to use the Distribute command that generates the list of files by reading the MANIFEST.in template and other options, then check what you want to see in that list.

    In other words, I don't see the need to do it for real by doing a system call. (at least in the scenario you have talked about)

  4. Sridhar Ratnakumar reporter

    In the scenario your are describing, you "just" need to use the Distribute command that generates the list of files by reading the MANIFEST.in template and other options, then check what you want to see in that list.

    Evidently package developers don't do that (which is why I see a lot of `file not found` kind of errors in setup.py).

    When the 'friendly API' work happens, perhaps a distribute extension could be written (elsewhere, not part of official distribute) that can make use of the sandbox API (combined with virtualenv) to do a check of the sdist. If significant amount of users find it useful, then one may consider the possibility of including it in Distribute.

    BTW, I was not referring to any 'system call' - I was referring to letting virtualenv handle the underlying sandbox test installation.

    Heck, I now think that this is better done by the testing frameworks like py.test and nose. Yet that may not address my original concern of encouraging package authors to verify their tarballs before releasing something to PyPI that does not even install.

  5. Log in to comment