I'm brand new to paver. I've tried to follow along with this tutorial
http://www.blueskyonmars.com/projects/paver/getting_started.html, but
when I try to run a user defined task, I get the error: "NameError:
name 'task' is not defined"
--
You received this message because you are subscribed to the Google Groups "paver" group.
To post to this group, send email to pa...@googlegroups.com.
To unsubscribe from this group, send email to paver+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/paver?hl=en.
AttributeError: 'module' object has no attribute 'user_options'
--
You received this message because you are subscribed to the Google Groups "paver" group.
To post to this group, send email to pa...@googlegroups.com.
To unsubscribe from this group, send email to paver+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/paver?hl=en.
That is to say version 0.6c11 of setuptools.
from paver.setuputils import setupThe setup function in that module calls a function in there to install the distutils/setuptools commands as proper tasks.
from paver.setuputils import setup
from paver.easy import *
@task
@needs(['generate_setup', 'minilib', 'setuptools.command.sdist.sdist'])
def sdist():
"""Overrides sdist to make sure that our setup.py is generated."""
pass
@task
def unit_test():
"""Run the fizzbuzz unit tests."""
from fizzbuzz.test import all_tests
all_tests.main()
C:\Users\robertstackhouse\Desktop\KitchenSink>paver sdist
Traceback (most recent call last):
File "C:\Python26\Scripts\paver-script.py", line 8, in <module>
load_entry_point('paver==1.0.3', 'console_scripts', 'paver')()
File "C:\Python26\lib\site-packages\paver-1.0.3-py2.6.egg\paver\tasks.py", lin
e 621, in main
_launch_pavement(args)
File "C:\Python26\lib\site-packages\paver-1.0.3-py2.6.egg\paver\tasks.py", lin
e 604, in _launch_pavement
_process_commands(args, auto_pending=auto_pending)
File "C:\Python26\lib\site-packages\paver-1.0.3-py2.6.egg\paver\tasks.py", lin
e 557, in _process_commands
task, args = _parse_command_line(args)
File "C:\Python26\lib\site-packages\paver-1.0.3-py2.6.egg\paver\tasks.py", lin
e 496, in _parse_command_line
args = task.parse_args(args)
File "C:\Python26\lib\site-packages\paver-1.0.3-py2.6.egg\paver\tasks.py", lin
e 316, in parse_args
parser = self.parser
File "C:\Python26\lib\site-packages\paver-1.0.3-py2.6.egg\paver\tasks.py", lin
e 293, in parser
self.option_names.add((task.shortname, longname))
AttributeError: class sdist has no attribute 'shortname'
I changed my pavement to:from paver.setuputils import setupfrom paver.easy import *@task@needs(['generate_setup', 'minilib', 'setuptools.command.sdist.sdist'])def sdist():"""Overrides sdist to make sure that our setup.py is generated."""pass@taskdef unit_test():"""Run the fizzbuzz unit tests."""from fizzbuzz.test import all_testsall_tests.main()
--
You received this message because you are subscribed to the Google Groups "paver" group.
To post to this group, send email to pa...@googlegroups.com.
To unsubscribe from this group, send email to paver+un...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/paver?hl=en.
# <== include("started/oldway/setup.py", "setup")==>
...
# <==end==>
from paver.easy import *#import paver.doctoolsfrom paver.setuputils import setupsetup(name="KitchenSink",packackes=['fizzbuzz', 'test_web_ic3'],version="0.1",url="http://notarealurl",author="Robert Stackhouse",author_email="robertst...@gmail.com")@task@needs(['generate_setup', 'minilib', 'setuptools.command.sdist'])
def sdist():"""Overrides sdist to make sure that our setup.py is generated."""pass@taskdef unit_test():"""Run the fizzbuzz unit tests."""
if not 'BASEDIR' in globals():import sysimport inspectimport osglobal BASEDIRFRAME_INFO = inspect.getframeinfo(inspect.currentframe())BASEDIR = os.path.realpath(os.path.join(os.path.dirname(FRAME_INFO.filename),'src\\')) #should always point to srcsys.path.append(BASEDIR)
from fizzbuzz.test import all_testsall_tests.main()
Ok. I've discovered the source of my problem.I did not get the meaning of the mark up a la:# <== include("started/oldway/setup.py", "setup")==>...# <==end==>Going back over the tutorial, I discovered these snippets are supposed to be strung together in order.
Is this a common python documentation convention? I have never seen this before. Admittedly, I am really new to python. It may seem silly to you, but it would have really helped me to see the tutorial pavement.py all in one place.