Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

setuptools_behave.py Subprocess call failing #310

Closed
kenr opened this issue Apr 13, 2015 · 8 comments
Closed

setuptools_behave.py Subprocess call failing #310

kenr opened this issue Apr 13, 2015 · 8 comments

Comments

@kenr
Copy link

kenr commented Apr 13, 2015

I'm not able to run the behave tests from setup.py and I think it is because of a bug in the behave_test.behave method;

The call return subprocess.call([sys.executable, behave] + shlex.split(cmd_options)) tries to call python.exe subprocess (and the rest of the arguments). Should it not be python -m behave (and the rest of the arguments) ?

@jenisys
Copy link
Member

jenisys commented Apr 13, 2015

Which platform (Windows, Linux, …) and which python version are you using ?

@jenisys
Copy link
Member

jenisys commented Apr 16, 2015

I will fix it, but:
If the installed Python scripts are not found, you have setup the the Python installation incorrectly. Because other installed Python scripts will also not be found, like pip, …

For example on Windows, your search-path for Python should look like:
PATH="C:\Python27;C:\Python27\Scripts;…"

On Windows, the search is not automatically set up like that by the Python installer. Therefore, the user should normally correct it in its environment setup. Similar problems may exist on MACOSX if you use an own installation (not the system installation).

@jenisys
Copy link
Member

jenisys commented Apr 16, 2015

INTEGRATED INTO: behave-1.2.6.dev0

@jenisys jenisys closed this as completed Apr 16, 2015
@kenr
Copy link
Author

kenr commented Apr 16, 2015

Sorry for the late reply. Thank you for looking into and fixing the issue. I'm on Windows with Python version 2.7.6. I've already set the PATH variable to include c:\python27\scripts.

@memee
Copy link
Contributor

memee commented Jun 4, 2015

Problem is line behave = os.path.join("bin", "behave") - it won't exist.
Working directory is the place where you call setup.py.

@jenisys
Copy link
Member

jenisys commented Jun 8, 2015

@memee
Why should that be the problem?
If that does not exists, it is assumed that behave is in the python search path (or installed).

@memee
Copy link
Contributor

memee commented Jun 11, 2015

Ok, steps to reproduce

$ mkvirtualenv -p /usr/local/bin/python3.4 test_behave
$ pip install pyramid
$ pcreate -s starter .
$ pip install behave
$ python setup.py behave_test
/Users/macio/.virtualenvs/test_behave/bin/python: can't open file 'behave': [Errno 2] No such file or directory
FAILED

It checks for relative 'bin/behave' in working directory, doesn't it?

$ python -c 'import os; print(os.path.exists(os.path.join("bin", "behave")))'
False

But behave is installed

which behave
/Users/macio/.virtualenvs/test_behave/bin/behave

jenisys added a commit that referenced this issue Jun 14, 2015
@jenisys
Copy link
Member

jenisys commented Jun 14, 2015

@memee
You seem to be talking about behave-1.2.5. As you can see this problem is already fixed in the Git repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants