Permalink
Browse files

In prerelease recommend the user to add a MANIFEST.in file.

  • Loading branch information...
1 parent fe20d88 commit 6129e1bf11cb9980aa00ebf3f6d61e76fa08c949 @mauritsvanrees mauritsvanrees committed Mar 8, 2012
Showing with 33 additions and 1 deletion.
  1. +4 −1 CHANGES.txt
  2. +3 −0 zest/releaser/prerelease.py
  3. +26 −0 zest/releaser/utils.py
View
5 CHANGES.txt
@@ -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)
View
3 zest/releaser/prerelease.py
@@ -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()
View
26 zest/releaser/utils.py
@@ -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.