User:Legoktm/pywikibot on tools lab

From Wikitech
Jump to navigation Jump to search

Warning Caution: This page may contain inaccuracies. It is currently being edited and redesigned for better readability. For further information, please see T134495.

A simple guide to setting up pywikibot-core (fka rewrite) on tools lab.

become tooluser
git clone https://github.com/wikimedia/pywikibot-core.git
virtualenv pwb # You can call it whatever you want, I like using pwb since it's short
source ~/pwb/bin/activate
cd pywikibot-core
python setup.py develop # This basically installs pwb-core as a symlink so if you modify the directory, you don't need to install it again
#It also will call python generate_user_files.py so you don't have to

Ta-da!. Now when you submit jobs to the grid engine, do it like:

jsub -N job_name /data/project/tooluser/pwb/bin/python /data/project/tooluser/path/to/script.py

If you want to run a script in interactive mode to debug, you'll need to run source ~/pwb/bin/activate first.