# HG changeset patch # User Jeff Hammel # Date 1295575086 28800 # Node ID 908e9a65366868d761803b3569a79fa3d318f9b7 # Parent 7dbc3cdadffe89794fbf52b0d6e2a0ee0a5d49a4 fix a syntax error in the python template thanks to some friendly tests diff -r 7dbc3cdadffe -r 908e9a653668 examples/doctest.txt --- a/examples/doctest.txt Tue Jan 18 07:51:50 2011 -0800 +++ b/examples/doctest.txt Thu Jan 20 17:58:06 2011 -0800 @@ -8,7 +8,9 @@ >>> import makeitso >>> import os >>> import shutil + >>> import sys >>> import tempfile + >>> from subprocess import call >>> from StringIO import StringIO Basic functionality:: @@ -147,5 +149,23 @@ ['author', 'description', 'email', 'repo', 'url'] >>> tempdir = tempfile.mkdtemp() >>> variables = dict([(i, i) for i in missing]) - >>> template.substitute(variables, output=tempdir) + >>> projdir = os.path.join(tempdir, 'MyProject') + >>> template.substitute(variables, output=projdir) + +Make sure this actually worked:: + + >>> cwd = os.getcwd() + >>> os.chdir(projdir) + >>> os.path.exists('setup.py') + True + >>> call([sys.executable, 'setup.py', 'egg_info']) + 0 + >>> call([sys.executable, 'setup.py', 'sdist']) + 0 + >>> os.path.exists('dist') and os.path.isdir('dist') + True + >>> len(os.listdir('dist')) > 0 + True + >>> os.chdir(cwd) >>> shutil.rmtree(tempdir) + diff -r 7dbc3cdadffe -r 908e9a653668 makeitso/python.py --- a/makeitso/python.py Tue Jan 18 07:51:50 2011 -0800 +++ b/makeitso/python.py Thu Jan 20 17:58:06 2011 -0800 @@ -60,7 +60,7 @@ # get package name from project # XXX could have looser restrictions with transforms - assert variables['project'].isalpha(), 'Project name must be just letters' + assert variables['project'].isalnum(), 'Project name must be just letters, you gave %s' % variables['project'] variables['package'] = variables['project'].lower() # dependencies diff -r 7dbc3cdadffe -r 908e9a653668 makeitso/python_package/setup.py --- a/makeitso/python_package/setup.py Tue Jan 18 07:51:50 2011 -0800 +++ b/makeitso/python_package/setup.py Thu Jan 20 17:58:06 2011 -0800 @@ -9,7 +9,7 @@ version = "0.0" -depdendencies = {{dependencies}} +dependencies = {{dependencies}} setup(name='{{project}}', version=version,