Commits

Travis Shirk committed 7617bb4

Make sphinxcontrib.paverutils not needed for build/install, etc.

Comments (0)

Files changed (1)

 import re
 from paver.easy import *
 from paver.path import path
-import paver.doctools
 import paver.setuputils
 paver.setuputils.install_distutils_tasks()
 import setuptools
 import setuptools.command
-from sphinxcontrib import paverutils
+try:
+    from sphinxcontrib import paverutils
+except:
+    paverutils = None
 
 PROJECT = "eyeD3"
 VERSION = open("version", "r").read().strip('\n')
 )
 
 @task
+@no_help
 def eyed3_info():
+    '''Convert src/eyed3/info.py.in to src/eyed3/info.py'''
     src = path("./src/eyed3/info.py.in")
     target = path("./src/eyed3/info.py")
     if target.exists() and not src.exists():
         target_file.close()
 
 @task
-@needs("setuptools.command.build_py")
-@needs("eyed3_info")
+@needs("eyed3_info", "setuptools.command.build_py")
 def all():
+    '''Build the code'''
     pass
 
 ## Clean targets ##
 
 @task
-@needs("docs_clean")
-@needs("test_clean")
+@needs("test_clean", "docs_clean")
 def clean():
+    '''Cleans mostly everything'''
     path("build").rmtree()
 
     for d in [path("src"), path("bin")]:
 
 @task
 def docs_clean(options):
+    '''Clean docs'''
     for d in ["html", "doctrees"]:
         path("docs/.build/%s" % d).rmtree()
 
 @task
 @needs("clean")
 def distclean():
+    '''Like 'clean' but also everything else'''
     path("src/eyed3/info.py").remove()
     path("tags").remove()
     path("dist").rmtree()
 @task
 @needs("cog")
 def docs(options):
+    '''Sphinx documenation'''
+    if not paverutils:
+        raise RuntimeError("Sphinxcontib.paverutils needed to make docs")
     paverutils.html(options)
     print("Docs: file://%s/%s/%s/html/index.html" %
           (os.getcwd(), options.docroot, options.builddir))
        )
 def sdist(options):
     '''Make a source distribution'''
+    sh("cd dist && md5sum eyeD3-%s.tar.gz > eyeD3-%s.md5" % ((VERSION,) * 2))
 
 
 @task
 def changelog():
+    '''Update changelog, and commit it'''
     sh("hg log --style=changelog . >| ChangeLog")
+    sh("hg commit -m updated ChangeLog")
 
 
 @task
+@no_help
 def tags():
+    '''ctags for development'''
     path("tags").remove()
     sh("ctags -R --exclude='tmp/*' --exclude='build/*'")
 
 @task
 @needs("all")
 def test():
+    '''Runs all tests'''
     sh("nosetests --verbosity=3 --detailed-errors "
        "--cover-erase --with-coverage --cover-tests --cover-inclusive "
        "--cover-package=eyed3 --cover-branches --cover-html "
 
 @task
 def test_clean():
+    '''Clean tests'''
     path("built/test/html").rmtree()
     path(".coverage").remove()
 
 @task
-@needs("sdist")
-@needs("distclean")
+@needs("distclean", "sdist")
 def test_dist():
+    '''Makes a dist package, unpacks it, and tests it.'''
     cwd = os.getcwd()
     try:
         os.chdir("./dist")
 - paver distclean
 - paver sdist
 
+- hg tag
+- (hg branch for for major releases)
+
 - Upload source dist to releases
 - Upload docs
 - Upload to Python Index (paver upload?)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.