Search This Blog

Tuesday, May 07, 2013

error in setup.cfg: command 'nosetests' has no such option 'with_pylons'

When running nosetests, if you see error in setup.cfg: command 'nosetests' has no such option 'with_pylons' or Error reading config file 'setup.cfg': no such option 'with-pylons', it could be because you have Pylons==1.0* installed. Pylons==1.0* does not register itself as a nose plugin ( Use following work arounds:
  1. For "python nosetests":
    Add the following to your projects " -> entry_points" and ".egg-info/entry_points.txt"
        pylons = pylons.test:PylonsPlugin
  2. For "nosetests --version":
    sudo vim `which nosetests`
    Make it look something like:
    # EASY-INSTALL-ENTRY-SCRIPT: 'nose==1.3.0','console_scripts','nosetests'
    __requires__ = 'nose==1.3.0'
    import sys
    from pkg_resources import load_entry_point
    addplugins = []
        import pylons
        if pylons.__version__[0] == '1':
            from pylons.test import PylonsPlugin
    except ImportError:
    if __name__ == '__main__':
            load_entry_point('nose==1.3.0', 'console_scripts', 'nosetests')(addplugins=addplugins)
    now you should be able to run it as nosetests --version

No comments: