cobrateam/splinter — Issue #121: Splinter leaves "tests" folder in site-packages
Author: hugobr
Created: 2011-11-08 20:18:25+00:00
State: open

After installing splinter, it puts "tests" in /path/to/env/lib/python-{VERSION}/site-packages.

I just found it because I need to import a tests module, and it was in the wrong path. Look:

>>> import tests
Traceback (most recent call last):
File "", line 1, in
File "/private/tmp/splinter-bug/lib/python2.7/site-packages/tests/__init__.py", line 2, in
from fake_webapp import start_server, stop_server
File "/private/tmp/splinter-bug/lib/python2.7/site-packages/tests/fake_webapp.py", line 1, in
from flask import Flask
ImportError: No module named flask

The fix is super easy, if I am not wrong, it just needs to exclude "tests" folder in setup.py. Maybe the change is the following:

--- setup.py	2011-11-08 18:16:09.000000000 -0200
+++ setup.py.fixed	2011-11-08 18:16:40.000000000 -0200
@@ -9,9 +9,8 @@
long_description=README,
author='CobraTeam',
author_email='andrewsmedina@gmail.com',
- packages=find_packages(),
+ packages=find_packages(exclude=["tests"]),
include_package_data=True,
install_requires=['selenium==2.8.1', 'lxml==2.3.1'],
tests_require=['coverage', 'flask'],
)

If someone could fix it before me, please do it :-)