Commits

Travis Shirk committed b9f43c0

doc package, removed tests from sdist, conditional tests on DATA_D, etc.

Comments (0)

Files changed (4)

 include COPYING
 include AUTHORS
 include etc/config.ini
-graft src
+graft src/eyed3
 include bin/eyeD3
 URL = "http://eyeD3.nicfit.net"
 AUTHOR = "Travis Shirk"
 AUTHOR_EMAIL = "travis@pobox.com"
+SRC_DIST = "%s-%s.tgz" % (PROJECT, VERSION)
+DOC_DIST = "%s_docs-%s.tgz" % (PROJECT, VERSION)
+DOC_BUILD_D = "docs/.build"
 
 PACKAGE_DATA = paver.setuputils.find_package_data("src/eyed3",
                                                   package="eyed3",
                                                   only_in_packages=True,
                                                   )
 
+print "packages:", setuptools.find_packages("src",
+                                          exclude=["test", "test.*"])
 options(
     setup=Bunch(
         name=PROJECT, version=VERSION,
         author=AUTHOR, maintainer=AUTHOR,
         author_email=AUTHOR_EMAIL, maintainer_email=AUTHOR_EMAIL,
         url=URL,
-        download_url="%s/%s-%s.tar.gz" % (URL, PROJECT, VERSION),
+        download_url="%s/releases/%s" % (URL, SRC_DIST),
         license=license,
         package_dir={"": "src" },
         packages=setuptools.find_packages("src",
    ),
 
    sphinx=Bunch(
-        docroot='docs',
-        builddir='.build',
+        docroot=os.path.split(DOC_BUILD_D)[0],
+        builddir=os.path.split(DOC_BUILD_D)[1],
         builder='html',
         template_args = {},
    ),
     pass
 
 @task
-@needs("test_clean")
+@needs("test_clean", "uncog")
 def clean():
     '''Cleans mostly everything'''
     path("build").rmtree()
 def docs_clean(options):
     '''Clean docs'''
     for d in ["html", "doctrees"]:
-        path("docs/.build/%s" % d).rmtree()
+        path("%s/%s" % (DOC_BUILD_D, d)).rmtree()
 
 @task
 @needs("distclean", "docs_clean")
        )
 def sdist(options):
     '''Make a source distribution'''
-    sh("cd dist && md5sum eyeD3-%s.tar.gz > eyeD3-%s.md5" % ((VERSION,) * 2))
+    cwd = os.getcwd()
+    dist_name = os.path.splitext(SRC_DIST)[0]
+    try:
+        os.chdir("dist")
+        sh("mv %s.tar.gz %s" % (dist_name, SRC_DIST))
+        sh("md5sum %s > %s.md5" % (SRC_DIST, dist_name))
+    finally:
+        os.chdir(cwd)
 
 
 @task
 def changelog():
     '''Update changelog, and commit it'''
     sh("hg log --style=changelog . >| ChangeLog")
-    sh("hg commit -m updated ChangeLog")
 
 
 @task
 
 
 @task
-@needs("all")
+@needs("build")
 @cmdopts([("debug", u"",
            u"Run with all output and launch pdb for errors and failures")])
 def test(options):
     path(".coverage").remove()
 
 @task
-@needs("distclean", "sdist")
+@needs("sdist")
 def test_dist():
     '''Makes a dist package, unpacks it, and tests it.'''
     cwd = os.getcwd()
+    pkg_d = os.path.splitext(SRC_DIST)[0]
     try:
         os.chdir("./dist")
-        sh("tar xzf eyeD3-%s.tar.gz" % VERSION)
+        sh("tar xzf %s" % SRC_DIST)
 
-        os.chdir("eyeD3-%s" % VERSION)
+        os.chdir(pkg_d)
         sh("python setup.py build")
         sh("python setup.py test")
 
         os.chdir("..")
-        path("eyeD3-%s").rmtree()
+        path(pkg_d).rmtree()
     finally:
         os.chdir(cwd)
 
+@task
+@needs("distclean", "test_dist", "docdist", "changelog")
+def release():
+    checklist()
+
+@task
+@needs("docs")
+def docdist():
+    path("./dist").exists() or os.mkdir("./dist")
+    cwd = os.getcwd()
+    try:
+        os.chdir(DOC_BUILD_D)
+        sh("tar czvf ../../dist/%s html" % DOC_DIST)
+        os.chdir("%s/dist" % cwd)
+        sh("md5sum %s > %s.md5" % (DOC_DIST, os.path.splitext(DOC_DIST)[0]))
+    finally:
+        os.chdir(cwd)
+
+    pass
 
 @task
 def checklist():
 Release Procedure
 =================
 
+- clean working copy / use sandbox
 - Set version in ``version`` file.
-- Update docs/changelog.rst
-- hg commit -m 'prep for release'
-- paver changelog
+- paver release
 - hg commit -m 'prep for release'
 
-- clean working copy / use sandbox
-- paver test_sdist
-- paver distclean
-- paver sdist
+- hg tag
+- hg merge to 'default'
 
-- hg tag
-- (hg branch for for major releases)
-
-- Upload source dist to releases
-- Upload docs
-- Upload to Python Index (paver upload?)
+- Upload source dist to http://eyed3.nicfit.net/releases
+- Upload docs to http://eyed3.nicfit.net/
 - Announce to mailing list
 - Announce to FreshMeat
+- Upload to Python Index (paver upload?)
 
-- new ebuild
+- ebuild
 """)
 
 def cog_pluginHelp(name):

src/test/mp3/test_mp3.py

 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 ################################################################################
-import os, StringIO
+import os, StringIO, unittest
 from nose.tools import *
+from .. import DATA_D
 
 import eyed3
 
 
 
 
-# FIXME: requires data file
-'''
-def testBasicVbrMp3(self):
-    audio_file = eyeD3.load(os.path.join(self.data_dir, "notag-vbr.mp3"))
-    assert_true(isinstance(audio_file, eyeD3.mp3.Mp3AudioFile))
+@unittest.skipIf(not os.path.exists(DATA_D), "test requires data files")
+def testBasicVbrMp3():
+    audio_file = eyed3.load(os.path.join(DATA_D, "notag-vbr.mp3"))
+    assert_true(isinstance(audio_file, eyed3.mp3.Mp3AudioFile))
 
     assert_true(audio_file.info is not None)
     assert_equal(audio_file.info.time_secs, 262)
     assert_true(audio_file.info.vbri_header is None)
 
     assert_true(audio_file.tag is None)
-'''

src/test/test_classic_plugin.py

                     assert_not_equal(
                             sout.find("Plugin options:\n  Classic eyeD3"), -1)
 
+@unittest.skipIf(not os.path.exists(DATA_D), "test requires data files")
 def testReadEmptyMp3():
     with RedirectStdStreams() as out:
-        args, _, config = main.parseCommandLine([os.path.join(DATA_D, "test.mp3")])
+        args, _, config = main.parseCommandLine([os.path.join(DATA_D,
+                                                              "test.mp3")])
         retval = main.main(args, config)
         assert_equal(retval, 0)
     assert_not_equal(out.stderr.read().find("No ID3 v1.x/v2.x tag found"), -1)
         self.orig_test_file = "%s/test.mp3" % DATA_D
         self.test_file = "/tmp/test.mp3"
 
+    @unittest.skipIf(not os.path.exists(DATA_D), "test requires data files")
     def setUp(self):
         shutil.copy(self.orig_test_file, self.test_file)
 
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.