robotframework / RIDE

Test data editor for Robot Framework
Apache License 2.0
958 stars 378 forks source link

Entry point? Proper installer? #1685

Closed SomeProgrammerX closed 1 month ago

SomeProgrammerX commented 7 years ago

I find it hard to believe that in 2017, and with such a huge and very useful software like Robot Framework, I still have to go to "Scripts" in Windows to run that ride.py manually. With all due respect, I really have to say this... seriously? I write Python since about 3 years only, and yet I know the magic concept of "entry point" that will make that "ride.py" call cross-platform on the global scope with a proper executable. Why isn't there a professional and proper entry point to RIDE? Or how about using a frozen version for Windows if you can't package RIDE properly so that I won't have to install dependencies manually?

This disappointment happened not mentioning the fact that I spent over an hour trying to get RIDE to start on my Anaconda 3.5 with 2.7 environment and never got it to start while it complains "You need to install wxPython 2.8.12.1 with unicode support to run RIDE". Why don't you just make it install automatically with the package manager? I just keep getting that I don't have wxPython (although I installed it through conda install wxpython, and whether I install wxPython through Anaconda or from its crappy 90s-looking website with the installer that fails if it doesn't find a PYTHONPATH automatically in which case it just installs half of the packages in the correct site-packages directory that I provided and the other half on the default drive C: directory.

Seriously... what happened to professionalism? I shipped better products and cared even more than what I'm seeing here when I was in academia!!!! Would someone please explain why pip install robotframework-ride or conda install robotframework-ride doesn't work like every other normal package in the Python universe? Why don't you just freeze it with something like cx_freeze or PyInstaller?

PS: I really hope I'm wrong here and everyone got it to work in two minutes. If you wanna know how to make an entry point, please go ahead and ask. If you wanna know how to use cx_freeze to freeze apps, please ask! If you wanna know how to create an NSIS installer through a script, please ask too! This is just sad, and I'm glad to help!

HelioGuilherme66 commented 7 years ago

Professionalism? This is an Open Source project, no one is getting paid to do it! This project started within Nokia Networks (before was Nokia Siemens Networks), and it was sponsored by them. It really was paid workers that had time allocated for this project. Then is was open sourced (and how thankful I am for that!). Later, sponsoring stopped, and then a new project was adopted by Nokia. It is called RED. The main author of RIDE, lost interest (or does not have time) in maintaining the code. There was some effort to modernize the code, but one year has passed since then. If you really like this project, you could propose PRs (and hope someone would use them), or you could do the changes in your own fork and advertise them to get users' adoption. In my fork, I am getting RIDE to be compatible with wxPython 3.0.2 and wxPython-Phoenix 3.0.3. I also have a Desktop Shortcut creator for Windows, Mac and Linux. I have included some PRs proposed here, and also some fixes. Would you do a concrete proposal for the installer of RIDE (we may use it)?

SomeProgrammerX commented 7 years ago

I'm actually very new to Robot Framework, and just got shocked by the amount of mess that can be easily fixed here. That's the reason for that little rant I had. The reason I'm harping on the word "professionalism" is that you're definitely a professionals. Why would a non-professional use Robot Framework? It doesn't add up! You, guys, can do a much better job than this. And apart from all this, thank you for your work.

I wouldn't wanna fork now because I'm not sure I can maintain this project by myself. After all, my experience in RIDE is very limited. Again, I'm very new to it.

Here are some suggestions to make this much better in a short time.

First thing, throw that "ride.py" away and use an "entry point". All you have to do is make the program start by calling a function. If this function is start_program(), and it's located in a package called MyPackage and a module (py file) called MyModule, then in your setup.py, add this to the setup() function call:

entry_points={ 'console_scripts': [ 'ride= MyPackage.MyModule:start_program' ]}

And done! Once you install RIDE through pip, it'll also create an executable in the Scripts directory that is independent of the operating system, and will be globally accessible. This being very simple is one of the reasons why I'm shocked it's not there already.

Second: To create an installer, first you have to convert RIDE to an executable (I would specifically do this for Windows, since Linux doesn't have binary portability between different Linux distros). You can create a special setup script for that purpose. Example:

from cx_Freeze import setup, Executable

#here include additional files, like acons
includefiles = [("MyPackage/icon.png", "MyPackage/icon.png")]

target = Executable("MyPackage/ride.py",
                    #base = "Win32GUI",  #this will remove displaying the terminal on double-click
                    icon = "SomePath/icon.ico",
                    targetName="ride.exe")

setup(
    name = "RIDE",
    version = 1.0.0,
    description = "Awesome Robot Framework editor",
    options = {'build_exe': {'include_files':includefiles, 'includes': ["sip","re","atexit"]}},
    executables = [target])

You can put this script in another file, such as setup-cxfreeze.py, and then run the command python setup-cxfreeze.py build, which will build an executable for you.

cxfreeze has the option to create an MSI installer. If you don't like that (and I don't), you can create an NSIS installer. It will cost you a few hours, but it's better than depending on that MSI installer, which is not problem-free. Eventually, people will even be happy if you just zip the output of cx_freeze. It's much better than what they do now.

Thanks. I appreciate your efforts.

pekkaklarck commented 7 years ago

The main reason that RIDE setup isn't more modern is that it has been virtually unmaintained for few years already. Back in the day when it was actively developed, Python's packaging was a total mess and, for example, setuptools wasn't universally available. There even was a not-so-friendly distribute fork but luckily that dispute was resolved and distribute merged to setuptools. Good times...

There are now some hopes for a bit bigger RIDE update but I cannot make any promises. If that happens, then RIDE should definitely be switched to use exe wrappers. They are supported by setuptools, but could check cx_Freeze and other similar alternatives too. Creating desktop shortcuts with icons like the current Windows installers do would be nice.

ttchin commented 6 years ago

I'm new to robotframework and was stuck by the RIDE either. The Windows Installer link is incorrect in the wiki page:https://github.com/robotframework/RIDE/wiki/Installation-Instructions

I wasted some time on trying to start up RIDE on my Windows 7 laptop with anancode3 but failed. But thanks to this thread, I guess I should turn to RED now.

HelioGuilherme66 commented 1 month ago

Finally, after many years later, we have setup entry points, and now since v2.1a3 we can start by using ride. It has a strange side effect, which is momentaneous restart of RIDE when we close it. If you, @SomeProgrammerX are still around and interested in investigating this, please do. We can then create a PR to improve RIDE.