Page 1 of 2

rapid 'poweruser' interface

Posted: 29 Mar 2010, 00:41
by Tobi
May as well announce rapid: A set of two small tools (commandline and gui) to operate on your local rapid repository.

The commandline tool is mostly meant for power users as simply installing a package can also be done the GUI way. The GUI currently only allows installing single packages.

Anyway, the rapid commandline tool allows you to pin/unpin tags, install/uninstall packages, collect garbage, and rapidly create a .sdd from a .sdp package with a single command. (the latter is useful for engine development ;-))

It can be installed using:

Code: Select all

easy_install rapid-spring
Then view the possible commands by running:

Code: Select all

rapid
Or, for the GUI:

Code: Select all

rapid-gui
Thanks go to koshi for figuring how to package python stuff and for creating rapid-gui.

If you have any suggestions, find any bugs, have some patches (code is on github), etc., just post here or speak to me in Lobby.

Re: rapid 'poweruser' interface

Posted: 29 Mar 2010, 16:50
by SirMaverick
Nice tool.

Edit: this is solved (setup problem).
There is a bug in install/uninstall:

Code: Select all

$ rapid list-installed-packages | grep XTA
  XTA 9.6                                  (xta:version:9.6, xta:latest)
$ rapid install "XTA 9.5"
Already installed: XTA 9.6
$ rapid uninstall "XTA 9.5"
Not pinned: xta:version:9.6
Unpinning: xta:latest
Uninstalling: XTA 9.6
$ rapid list-installed-packages | grep XTA

$ rapid list-tags | grep 7613
  ca:stable                                (Complete Annihilation stable-7613)
  ca-1faction:stable                       (Complete Annihilation 1 faction stable-7613)
  ca:stable                                (Complete Annihilation stable-7613)
  ca-1faction:stable                       (Complete Annihilation 1 faction stable-7613)
  ca:revision:7613                         (Complete Annihilation stable-7613)
  ca-1faction:revision:7613                (Complete Annihilation 1 faction stable-7613)
$ rapid install "Complete Annihilation stable-7613"
100 or more matching names found, please narrow your search.
$ rapid install "ca:revision:7613"
No names matching ca:revision:7613 found.
It only matches against the part until first space? And only full names?

Pinning a specific version works, e.g.

Code: Select all

rapid pin ca:revision:7613
Using latest from git, atm 8d7b06e3703f075c83610137945f26d12a67ee53

Re: rapid 'poweruser' interface

Posted: 29 Mar 2010, 16:56
by SirMaverick
Other problem: I used SD before and had over time more than 1000 packages installed. I ran "rapid collect-pool". It ran for 10-15 minutes (runtime is lesser issue) and used up to 1.3GB ram.

Re: rapid 'poweruser' interface

Posted: 29 Mar 2010, 19:04
by aegis
okay, it appears to be writing pool to files... so what's the memory hog?

Re: rapid 'poweruser' interface

Posted: 29 Mar 2010, 20:46
by Tobi
Thanks for the feedback.

SirMavericks install/uninstall issue has been narrowed down to his own wrapper shell script ($@ instead of "$@").

The memory hog when using collect-pool when lots of packages are installed may be because it loads for each package the list of files in memory and keeps this list cached in memory. If each such list is 300kb (rough estimate based on 50-200kb gzipped raw data) then 1000 packages would be 300M already. Apparently the python representation is quite somewhat less compact :-)

EDIT: memory issue should be resolved (reduced usage by 95%)
(yay Flyweight pattern)

Re: rapid 'poweruser' interface

Posted: 16 Aug 2010, 05:30
by admorgan
When trying to use rapid I get the following error on Gentoo Linux with rapid-spring installed from easy_install

admorgan@alexandria ~ $ rapid-gui
Traceback (most recent call last):
File "/usr/bin/rapid-gui", line 5, in <module>
pkg_resources.run_script('rapid-spring==0.3.0', 'rapid-gui')
File "/usr/lib64/python2.6/site-packages/pkg_resources.py", line 468, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib64/python2.6/site-packages/pkg_resources.py", line 1201, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/EGG-INFO/scripts/rapid-gui", line 15, in <module>
window = RapidGUI()
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/gui.py", line 124, in __init__
self.mainWidget = MainRapidWidget(self)
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/gui.py", line 109, in __init__
self.availableWidget = AvailableRapidListWidget(self)
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/gui.py", line 95, in __init__
self.sourceModel.reload()
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/models.py", line 29, in reload
self.reloadData( lambda p: not p.installed )
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/models.py", line 18, in reloadData
for p in filter( dataFunction, main.rapid.packages ):
AttributeError: 'module' object has no attribute 'packages'

Re: rapid 'poweruser' interface

Posted: 17 Aug 2010, 20:15
by jandd
admorgan wrote:When trying to use rapid I get the following error on Gentoo Linux with rapid-spring installed from easy_install

admorgan@alexandria ~ $ rapid-gui
Traceback (most recent call last):
File "/usr/bin/rapid-gui", line 5, in <module>
pkg_resources.run_script('rapid-spring==0.3.0', 'rapid-gui')
File "/usr/lib64/python2.6/site-packages/pkg_resources.py", line 468, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib64/python2.6/site-packages/pkg_resources.py", line 1201, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/EGG-INFO/scripts/rapid-gui", line 15, in <module>
window = RapidGUI()
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/gui.py", line 124, in __init__
self.mainWidget = MainRapidWidget(self)
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/gui.py", line 109, in __init__
self.availableWidget = AvailableRapidListWidget(self)
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/gui.py", line 95, in __init__
self.sourceModel.reload()
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/models.py", line 29, in reload
self.reloadData( lambda p: not p.installed )
File "/usr/lib64/python2.6/site-packages/rapid_spring-0.3.0-py2.6.egg/rapid/models.py", line 18, in reloadData
for p in filter( dataFunction, main.rapid.packages ):
AttributeError: 'module' object has no attribute 'packages'
same error on Debian Squeeze (easy_install and built from source). Filed as http://github.com/tvo/rapid/issues#issue/3

Re: rapid 'poweruser' interface

Posted: 18 Aug 2010, 09:50
by koshi

Re: rapid 'poweruser' interface

Posted: 22 Aug 2010, 10:04
by Dragon45
argh why easy_install!?? neds moar pip... easy_install -> deviltool

Re: rapid 'poweruser' interface

Posted: 25 Aug 2010, 03:04
by lurker
Shouldn't it install the bitarray dependency by itself?





When it asks me if I meant:
1. ba:latest
2. specialba:latest

Can the correct number to enter to get ba:latest not be 0?

Re: rapid 'poweruser' interface

Posted: 25 Aug 2010, 05:04
by admorgan
I re-installed with pip instead of easy_install and now it works

Re: rapid 'poweruser' interface

Posted: 03 Sep 2010, 21:16
by Tobi
Dragon45 wrote:argh why easy_install!?? neds moar pip... easy_install -> deviltool
Is pip some kind of official replacement for easy_install? Any references? I don't seem to find much docs yet that use pip, apart from the pip docs themselves. (which obviously argue pro pip)
lurker wrote:When it asks me if I meant:
1. ba:latest
2. specialba:latest

Can the correct number to enter to get ba:latest not be 0?
Noted.



To all: if there are issues with rapid the preferred form of reporting them is on the issue tracker at github.

Re: rapid 'poweruser' interface

Posted: 03 Sep 2010, 21:21
by admorgan
According to http://pypi.python.org/pypi/pip and the python irc channel pip is the upcoming replacement to easy_install. The nice thing about pip is that it already works with everything that is easy_install compatible and in this case even made it work (although I can't explain that one).
Tobi wrote:
Dragon45 wrote:argh why easy_install!?? neds moar pip... easy_install -> deviltool
Is pip some kind of official replacement for easy_install? Any references? I don't seem to find much docs yet that use pip, apart from the pip docs themselves. (which obviously argue pro pip)
lurker wrote:When it asks me if I meant:
1. ba:latest
2. specialba:latest

Can the correct number to enter to get ba:latest not be 0?
Noted.



To all: if there are issues with rapid the preferred form of reporting them is on the issue tracker at github.

Re: rapid 'poweruser' interface

Posted: 03 Sep 2010, 21:44
by Tobi
Ok, thanks. Guess it doesn't hurt to switch the docs to pip anyway.

Re: rapid 'poweruser' interface

Posted: 04 Sep 2010, 02:21
by Tobi
Instead of doing that I fixed most open bugs / implemented the feature requests and made a new release.

Here's the git shortlog:
hide main function a bit better, and explain it
don't choke on multiple packages with same name, but different hex or dependencies
fix off-by-one error when user was asked to choose from a list
added -y/--yes option to skip confirmations
pin, unpin, install and uninstall now support arbitrary amount of arguments
sort packages and tags in list-[installed-]packages and list-[pinned-]tags
refactor: promote select to TUI
add -r/--regex option to use regex instead of substring matches
sync readme and usage, added options to readme

Re: rapid 'poweruser' interface

Posted: 04 Sep 2010, 09:35
by hoijui
woo hoo! :D
nice nice!
looks like rapid is the most mature project in the spring community now. leaves little to be desired.

Re: rapid 'poweruser' interface

Posted: 05 Sep 2010, 18:43
by Tobi
I tried both pip and easy_install and noticed that neither installs dependencies of rapid. The dependency is defined like this in setup.py, in the call to distutils.core.setup:

Code: Select all

    requires=['bitarray'],
If anyone has any clue what causes this I would appreciate it if you could put it here :-)

EDIT: solved in 0.4.1, programs that read setup.py are pretty inconsistent with each other...

Re: rapid 'poweruser' interface

Posted: 05 Nov 2010, 13:20
by jeykey
rapid pin ct:test
Traceback (most recent call last):
File "/usr/local/bin/rapid", line 5, in <module>
pkg_resources.run_script('rapid-spring==0.2.0', 'rapid')
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 467, in run_script
self.require(requires)[0].run_script(script_name, ns)
File "/usr/lib/python2.6/dist-packages/pkg_resources.py", line 1200, in run_script
execfile(script_filename, namespace, namespace)
File "/usr/local/lib/python2.6/dist-packages/rapid_spring-0.2.0-py2.6.egg/EGG-INFO/scripts/rapid", line 6, in <module>
from rapid.main import *
File "/usr/local/lib/python2.6/dist-packages/rapid_spring-0.2.0-py2.6.egg/rapid/main.py", line 41, in <module>
rapid = rapid.Rapid()
File "/usr/local/lib/python2.6/dist-packages/rapid_spring-0.2.0-py2.6.egg/rapid/rapid.py", line 297, in __init__
mkdir(spring_dir)
File "/usr/local/lib/python2.6/dist-packages/rapid_spring-0.2.0-py2.6.egg/rapid/rapid.py", line 42, in mkdir
os.mkdir(path)
OSError: [Errno 17] File exists: '/home/jeykey/.spring'


If Spring directory is a dead link, rapid crashes... I know this is a minor bug, but I wanted to share it anyway ;)

regards, jeykey

Re: rapid 'poweruser' interface

Posted: 08 Nov 2010, 20:02
by Tobi

Re: rapid 'poweruser' interface

Posted: 25 Jan 2012, 04:02
by luckywaldo7
A new Zero-K player has trouble getting rapid to work:

http://pastebin.com/CX84eBn2