seanfisk / python-project-template

A template Python project with a focus on best practices.
Other
544 stars 168 forks source link

issue while running tests #28

Closed ric03uec closed 10 years ago

ric03uec commented 10 years ago

I cloned the repo and trying to run the tests for which i'm getting the following error. can you please help me out here.

Here i'm trying to run it from a virtualenv

 Traceback (most recent call last):
  File "/home/someuser/virtualenvs/python/2.7/bin/tox", line 9, in <module>
    load_entry_point('tox==1.6.1', 'console_scripts', 'tox')()
  File "/home/someuser/virtualenvs/python/2.7/local/lib/python2.7/site-packages/tox/_cmdline.py", line 26, in main
    retcode = Session(config).runcommand()
  File "/home/someuser/virtualenvs/python/2.7/local/lib/python2.7/site-packages/tox/_cmdline.py", line 301, in runcommand
    return self.subcommand_test()
  File "/home/someuser/virtualenvs/python/2.7/local/lib/python2.7/site-packages/tox/_cmdline.py", line 433, in subcommand_test
    if self.setupenv(venv):
  File "/home/someuser/virtualenvs/python/2.7/local/lib/python2.7/site-packages/tox/_cmdline.py", line 358, in setupenv
    status = venv.update(action=action)
  File "/home/someuser/virtualenvs/python/2.7/local/lib/python2.7/site-packages/tox/_venv.py", line 142, in update
    self.install_deps(action)
  File "/home/someuser/virtualenvs/python/2.7/local/lib/python2.7/site-packages/tox/_venv.py", line 272, in install_deps
    self._install(deps, action=action)
  File "/home/someuser/virtualenvs/python/2.7/local/lib/python2.7/site-packages/tox/_venv.py", line 334, in _install
    extraenv=extraenv)
  File "/home/someuser/virtualenvs/python/2.7/local/lib/python2.7/site-packages/tox/_venv.py", line 303, in run_install_command
    extraenv=env, action=action)
  File "/home/someuser/virtualenvs/python/2.7/local/lib/python2.7/site-packages/tox/_venv.py", line 382, in _pcall
    return action.popen(args, cwd=cwd, env=env, redirect=redirect)
  File "/home/someuser/virtualenvs/python/2.7/local/lib/python2.7/site-packages/tox/_cmdline.py", line 96, in popen
    popen = self._popen(args, cwd, env=env, stdout=f, stderr=STDOUT)
  File "/home/someuser/virtualenvs/python/2.7/local/lib/python2.7/site-packages/tox/_cmdline.py", line 153, in _popen
    stdout=stdout, stderr=stderr, env=env)
  File "/usr/lib/python2.7/subprocess.py", line 679, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1249, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory

I also tried to install tox and run the tests but same error is occurring again.

seanfisk commented 10 years ago

This looks like it errored before even getting to any Python Project Template-related code. A few questions:

ric03uec commented 10 years ago

Sorry for not being very clear earlier. I went through all the steps and paver test_all run correctly with all builds passing, the tox command produced the error i provided, the following lines were output before the one I had earlier mentioned.

I'm trying to run automated builds using the travis.yml file but tox command is failing.

Successfully installed tox virtualenv py
Cleaning up...

Executing python internal/generate.py
Completed python internal/generate.py with output 
Substituting ./setup.py.tpl -> ./setup.py
Substituting ./pavement.py.tpl -> ./pavement.py
Substituting ./LICENSE.tpl -> ./LICENSE
Substituting ./tests/test_main.py.tpl -> ./tests/test_main.py
Substituting ./docs/Makefile.tpl -> ./docs/Makefile
Substituting ./docs/make.bat.tpl -> ./docs/make.bat
Substituting ./docs/source/index.rst.tpl -> ./docs/source/index.rst
Substituting ./docs/source/conf.py.tpl -> ./docs/source/conf.py
Substituting ./docs/source/README.tpl -> ./docs/source/README
Substituting ./my_module/__init__.py.tpl -> ./my_module/__init__.py
Substituting ./my_module/main.py.tpl -> ./my_module/main.py
Renaming the package: my_module -> my_module
Making main script executable...
Removing internal Travis-CI test file...
Revising `LICENSE' file...
Removing internal directory...

To finish project setup:

1. Change the `classifiers' keyword in `setup.py' as necessary.
2. Change the license in `setup.py' and replace the generated `LICENSE' file
with the one of your choice. If you would like to use the MIT license, no
change is necessary.
3. Install `argparse' package when developing on Python 2.6.
4. Change `README.rst' to your own text.

Executing tox
GLOB sdist-make: /home/someuser/virtualenvs/python/2.7/projects/pytemplate/workspace/setup.py                                                                                                                                                   
py27 create: /home/someuser/virtualenvs/python/2.7/pytemplate/workspace/.tox/py27                                                                                                                                                      
py27 installdeps: --no-deps, --requirement, /home/someuser/virtualenvs/python/2.7/projects/pytemplate/workspace/requirements-dev.txt   
seanfisk commented 10 years ago

I still don't completely understand the problem, but I can guess based on the output. A couple more questions:

More specifically, each clone of PPT that you are using for a project should "destroy itself" to become your project. That's why the internal files (the .travis.yml file and the internal/ directory) are removed at generation. The generation script should only be run once -- manually, by you. Automated runs of the generation script are for testing PPT itself.

Let me know and we'll hopefully get it resolved :)

ric03uec commented 10 years ago

Got it fixed. Thanks for help. I was trying to run it on shippable.com which is a build platform(much like travis). The issue seemed to be somewhere in directory structure with too deep nesting resulting in unexpected errors and builds failing without giving any information. We changed the implementation and its working fine now.

seanfisk commented 10 years ago

OK, great! Let me know how PPT works out for you.