diff --git a/MANIFEST.in b/MANIFEST.in index 8030beb46c41e..2d3d927bed7c8 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,10 +1,13 @@ prune * -global-include build/webdriver-extension.zip +recursive-include common/src/web *.dll *.js *.gif *.html *.cs *.xhtml +recursive-include common/src/web *.txt *.Config recursive-include common/src/py *.py recursive-include common/test/py *.py recursive-include chrome/src/py *.py recursive-include chrome/test/py *.py recursive-include firefox/src/py *.py +recursive-include firefox/src/py *.zip +recursive-include firefox/src/py *.xpi recursive-include jobbie/src/py *.py recursive-include jobbie/test/py *.py recursive-include remote/client/src/py *.py diff --git a/Rakefile b/Rakefile index 6efbeaf66a49b..0ff9916141de1 100644 --- a/Rakefile +++ b/Rakefile @@ -631,24 +631,25 @@ task :javadocs => [:common, :firefox, :htmlunit, :jobbie, :remote, :support, :ch end task :test_firefox_py => [:firefox, :firefox_xpi] do - # This requires virtualenv - # To install virtualenv: - # easy_install virtualenv if python? then sh "virtualenv build/python", :verbose => true do |ok, res| if ! ok puts "" puts "PYTHON DEPENDENCY ERROR: Virtualenv not found." - puts "Please run '[sudo] easy_install install virtualenv' or" - puts " '[sudo] pip install virtualenv'" + puts "Please run '[sudo] pip install virtualenv'" puts "" end end - sh "build/python/bin/easy_install pip", :verbose => true - sh "build/python/bin/pip install simplejson", :verbose => true - sh "build/python/bin/pip install py", :verbose => true - sh "build/python/bin/python setup.py build install", :verbose => true - sh "build/python/bin/py.test build/lib/selenium/firefox_tests", :verbose => true + sh "build/python/bin/pip install simplejson py", :verbose => true + cp 'build/webdriver-extension.zip', "firefox/src/py/", :verbose => true + sh "build/python/bin/python setup.py build", :verbose => true + if File.exists?('build/python/bin/py.test') + py_test = 'build/python/bin/py.test' + else + py_test = 'py.test' + end + test_dir = Dir.glob('build/lib**/selenium/firefox_tests').first + sh py_test, test_dir, :verbose => true end end diff --git a/firefox/src/py/firefox_profile.py b/firefox/src/py/firefox_profile.py index 510f02104b461..9d39618f458f3 100644 --- a/firefox/src/py/firefox_profile.py +++ b/firefox/src/py/firefox_profile.py @@ -66,8 +66,7 @@ def __init__(self, name=ANONYMOUS_PROFILE_NAME, port=DEFAULT_PORT, self.name = name self.port = port if (extension_path is None): - self.extension_path = os.path.join(os.path.dirname(__file__), '..', - 'build_artifacts', 'webdriver-extension.zip') + self.extension_path = os.path.join(os.path.dirname(__file__), 'webdriver-extension.zip') else: self.extension_path = extension_path diff --git a/setup.py b/setup.py index 5320ac38d6b6d..199535bf3dfe2 100755 --- a/setup.py +++ b/setup.py @@ -14,53 +14,8 @@ # See the License for the specific language governing permissions and # limitations under the License. -from glob import glob -import os, shutil -import subprocess from setuptools import setup -from setuptools.command.install import install as _install - -class install(_install): - def run(self): - _install.run(self) - - # Ugly hack to use rake to build webdriver-extension.zip - # and put it where we're looking for it - root_dir = os.path.abspath(os.path.dirname(__file__)) - artifacts_dir = os.path.join(root_dir, 'build/lib/selenium/build_artifacts') - webdriver_extension = os.path.join(root_dir, 'build/webdriver-extension.zip') - os.chdir(root_dir) - #subprocess.call(['rake', 'firefox_xpi']) - try: - os.makedirs(artifacts_dir) - except OSError: - # Dir was already created - pass - shutil.copy(webdriver_extension, artifacts_dir) - -TEST_WEB_DIR = 'common/src/web' - -def get_extensions_list(in_dir): - files_list = [] - for dirname, subdirs, filenames in os.walk(in_dir): - if (dirname.find('.svn') == -1): - files_list.extend(filenames) - return set([t.split('.')[-1] for t in files_list if len(t.split('.')) > 0]) - -def get_dirs_list(in_dir): - ret_list = [] - for dirname, subdirs, filenames in os.walk(in_dir): - if (dirname.find('.svn') == -1): - ret_list.append(dirname.replace(TEST_WEB_DIR + '/', '')) - return ret_list - -test_web_dirs = get_dirs_list(TEST_WEB_DIR) -test_web_extensions = get_extensions_list(TEST_WEB_DIR) - -all_dirs_and_extensions = [] -for dir in test_web_dirs: - for ext in test_web_extensions: - all_dirs_and_extensions.append(dir + '/*.' + ext) +from setuptools.command.install import install setup( cmdclass={'install': install}, @@ -95,8 +50,7 @@ def get_dirs_list(in_dir): 'selenium.chrome_tests', 'selenium.remote_tests'], include_package_data=True, - package_data={'': ['*.' + t for t in test_web_extensions], - 'selenium.common_web':all_dirs_and_extensions} + install_requires=['distribute'], ) # FIXME: Do manually