Commits

Travis Shirk committed 5633ff2

Python 2.6 fixes and testing with tox

Comments (0)

Files changed (9)

 src/eyed3/info.py
 tags
 src/test/data
+.tox/*
+.pip-download-cache/*

dev-requirements-26.txt

+paver==1.2.1
+nose
+coverage
+unittest2
+cogapp
+tox
+argparse
+ordereddict

dev-requirements.txt

-paver==1.1.1
+paver==1.2.1
 nose
 coverage
-Sphinx
-sphinxcontrib-bitbucket
-sphinxcontrib-paverutils
+cogapp
+tox
 #!/bin/bash
 
-_ENV=${1:-eyeD3}
 _PYTHON=${2:-python2.7}
+_PYTHON_VERSION=$($_PYTHON -c 'import sys; print ".".join([str(v) for v in sys.version_info[:2]])')
+_ENV=${1:-eyeD3-${_PYTHON_VERSION}}
 
 source /usr/bin/virtualenvwrapper.sh
 
 mkvirtualenv -a $(pwd) --python=${_PYTHON} --distribute ${_ENV}
 workon $_ENV
 
+# FIXME
 PKGS_OPTS=
-if test -d ./packages; then
-    PKGS_OPTS="--no-index --find-links=packages"
+if test -d ./.pip-download-cache; then
+    export PIP_DOWNLOAD_CACHE=./.pip-download-cache    
 fi
-pip install $PKG_OPTS -r dev-requirements.txt
-if test ${_PYTHON} = "python2.6"; then
-    pip install argparse
-    pip install ordereddict
-    pip install unittest2
+
+if test $_PYTHON_VERSION = "2.6"; then
+    pip install $PKG_OPTS -r requirements-26.txt
+    pip install $PKG_OPTS -r dev-requirements-26.txt
+else
+    pip install $PKG_OPTS -r dev-requirements.txt
 fi
 
 cat /dev/null >| $VIRTUAL_ENV/bin/postactivate
     '''Make a source distribution'''
     cwd = os.getcwd()
     try:
+        name = os.path.splitext(SRC_DIST_TGZ)[0]
         os.chdir(options.sdist.dist_dir)
-        # Rename to .tgz
-        sh("mv %s.tar.gz %s" % (os.path.splitext(SRC_DIST_TGZ)[0],
-                                SRC_DIST_TGZ))
-        sh("md5sum %s >> %s" % (SRC_DIST_TGZ, MD5_DIST))
-        sh("md5sum %s >> %s" % (SRC_DIST_ZIP, MD5_DIST))
+        # Caller of sdist can select the type of output, so existence checks...
+        if os.path.exists("%s.tar.gz" % name):
+            # Rename to .tgz
+            sh("mv %s.tar.gz %s" % (os.path.splitext(SRC_DIST_TGZ)[0],
+                                    SRC_DIST_TGZ))
+            sh("md5sum %s >> %s" % (SRC_DIST_TGZ, MD5_DIST))
+        if os.path.exists(SRC_DIST_ZIP):
+            sh("md5sum %s >> %s" % (SRC_DIST_ZIP, MD5_DIST))
     finally:
         os.chdir(cwd)
 
 
 @task
+def tox(options):
+    path(".tox").rmtree()
+    sh("tox")
+
+
+@task
 def changelog():
     '''Update changelog, and commit it'''
     sh("hg log --style=changelog . >| ChangeLog")
         sh("hg commit -m 'prep for release'")
 
     test()
+    tox()
 
     distclean()
     sdist()

release-requirements.txt

+cogapp
+Sphinx
+sphinxcontrib-bitbucket
+sphinxcontrib-paverutils

requirements-26.txt

+argparse
+ordereddict

src/test/id3/test_tag.py

 #  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 ################################################################################
+import sys
 import os
-import unittest
+if sys.version_info[:2] == (2, 6):
+    import unittest2 as unittest
+else:
+    import unittest
+
 from nose.tools import *
 import eyed3
 from eyed3.core import Date
+
+[tox]
+envlist = py26, py27
+
+[testenv]
+deps = -r{toxinidir}/dev-requirements.txt
+downloadcache = .pip-download-cache
+commands = python setup.py test
+
+[testenv:py26]
+deps = -r{toxinidir}/dev-requirements-26.txt
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.