Skip to content

Commit

Permalink
In prerelease recommend the user to add a MANIFEST.in file.
Browse files Browse the repository at this point in the history
  • Loading branch information
mauritsvanrees committed Mar 8, 2012
1 parent fe20d88 commit 6129e1b
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 1 deletion.
5 changes: 4 additions & 1 deletion CHANGES.txt
Expand Up @@ -4,7 +4,10 @@ Changelog for zest.releaser
3.32 (unreleased)
-----------------

- Nothing changed yet.
- In prerelease recommend the user to add a MANIFEST.in file.
See http://docs.python.org/distutils/sourcedist.html for
more info.
[maurits]


3.31 (2012-02-23)
Expand Down
3 changes: 3 additions & 0 deletions zest/releaser/prerelease.py
Expand Up @@ -52,6 +52,9 @@ def prepare(self):
if not utils.sanity_check(self.vcs):
logger.critical("Sanity check failed.")
sys.exit(1)
if not utils.check_recommended_files(self.data):
logger.debug("Recommended files check failed.")
sys.exit(1)
self._grab_version()
self._grab_history()

Expand Down
26 changes: 26 additions & 0 deletions zest/releaser/utils.py
Expand Up @@ -337,3 +337,29 @@ def sanity_check(vcs):
if not ask(q, default=False):
return False
return True


def check_recommended_files(data):
"""Do check for recommended files.
Returns True when all is fine.
"""
main_files = os.listdir(data['workingdir'])
if not 'setup.py' in main_files and not 'setup.cfg' in main_files:
# Not a python package. We have no recommendations.
return True
if not 'MANIFEST.in'in main_files:
q = """This package is missing a MANIFEST.in file. This file is
recommended. See http://docs.python.org/distutils/sourcedist.html for
more info. Sample contents:
recursive-include main_directory *
recursive-include docs *
include *
global-exclude *.pyc
Are you sure you want to continue without this file?"""

if not ask(q, default=True):
return False
return True

0 comments on commit 6129e1b

Please sign in to comment.