Closed spooning closed 9 years ago
Originally submitted to Google Code by @yanne on 14 Oct 2010
Due to the way Robot Framework library imports work, the class SeleniumLibrary actually needs to be in init.py (Otherwise, it would have be imported like seleniumlibrary.SeleniumLibrary)
A third alternative solution would be a separate src/SeleniumLibrary/version.py, which could be imported from setup and init
Originally submitted to Google Code by ownersci... on 19 Oct 2010
You wouldn't be able to import a version.py, but would instead need to do:
execfile('src/SeleniumLibrary/version.py')
inside of setup.py. Otherwise, the import will cause init.py to be loaded, with the same results.
Originally submitted to Google Code by @yanne on 12 Nov 2010
Implemented the solution proposed by the.real.pjeby in r8c265e1f4faf, thanks a lot for the hint.
I'd like to be able to install robotframework-seleniumlibrary via setuptools (more specifically inside my zc.buildout setup).
Here's what happens if I try to do that (I don't have any global packages installed on my machine, not even robotframework):
user@box $> easy_install http://robotframework-seleniumlibrary.googlecode.com/files/robotframework-seleniumlibrary-2.4.tar.gz install_dir /Library/Python/2.6/site-packages/ Downloading http://robotframework-seleniumlibrary.googlecode.com/files/robotframework-seleniumlibrary-2.4.tar.gz Processing robotframework-seleniumlibrary-2.4.tar.gz Running robotframework-seleniumlibrary-2.4/setup.py -q bdist_egg --dist-dir /var/folders/am/amvgZGWsGOiqK+2kOSmf4k+++TI/-Tmp-/easy_install-IF9W8h/robotframework-seleniumlibrary-2.4/egg-dist-tmp-mBX1pR Traceback (most recent call last): File "/usr/local/bin/easy_install", line 8, in <module> load_entry_point('distribute==0.6.14', 'console_scripts', 'easy_install')() File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 1855, in main
File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 1836, in with_ei_usage
File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 1859, in <lambda>
File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/core.py", line 152, in setup dist.run_commands() File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 975, in run_commands self.run_command(cmd) File "/System/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/distutils/dist.py", line 995, in run_command cmd_obj.run() File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 342, in run
File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 557, in easy_install
File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 612, in install_item
File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 802, in install_eggs
File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 1079, in build_and_install
File "build/bdist.macosx-10.6-universal/egg/setuptools/command/easy_install.py", line 1068, in run_setup
File "build/bdist.macosx-10.6-universal/egg/setuptools/sandbox.py", line 29, in run_setup File "build/bdist.macosx-10.6-universal/egg/setuptools/sandbox.py", line 70, in run File "build/bdist.macosx-10.6-universal/egg/setuptools/sandbox.py", line 31, in <lambda> File "setup.py", line 25, in <module> File "/var/folders/am/amvgZGWsGOiqK+2kOSmf4k+++TI/-Tmp-/easy_install-IF9W8h/robotframework-seleniumlibrary-2.4/src/SeleniumLibrary/init.py", line 25, in <module> ImportError: No module named robot.errors
This is because of this line: https://code.google.com/p/robotframework-seleniumlibrary/source/browse/setup.py?r=6e6650df15f171118295457b3396be1cc59e9c47#25
from SeleniumLibrary import version
I propose
(a) moving the actual code (except the version declaration) from src/SeleniumLibrary/init.py to src/SeleniumLibrary/seleniumlibrary.py
or
(b) duplicating the version information to setup.py (not very DRY)