JJMC89 added a comment.
> - My first issue was with the location of the pwb.py wrapper. Following step 5 <https://wikitech.wikimedia.org/wiki/Help:Toolforge/Pywikibot#Using_the_shared_Pywikibot_files_(recommended_setup):~:text=5.%20Configure%20Pywikibot,scripts/generate_user_files.py> doesn't work, even when using release 7.0.0 scripts location <https://wikitech.wikimedia.org/wiki/Help:Toolforge/Pywikibot#Using_the_shared_Pywikibot_files_(recommended_setup):~:text=Caution%3A%20Script%20path,utilities/scripts.html>. What worked for me was calling `python3 /data/project/shared/pywikibot/core/pwb.py generate_user_files`. Since the files' location has changed and that's where new users will find them, should there still be a caution alert or should step 5 be updated with the new path and recommend calling `pwb.py` with arguments rather than the utility scripts directly? The doc now uses `pwb`. > - What is the difference between `/stable/` and `/core/`? The caution alert points to `core` whereas the rest of the guide to points to `stable` stable is the git branch that corresponds to the latest released version, and core is the git development branch. Both locations are updated daily from the corresponding git branch. > - The guide states that using the shared files is recommended whenever possible, but the examples for setting a virtual environment use the local installation scenario. This is where I had the most trouble with: how to install custom dependencies //and// use the shared files? Or anyone with extra dependencies should install `pywikibot` locally? In the virtual environment bash script <https://wikitech.wikimedia.org/wiki/Help:Toolforge/Pywikibot#Using_the_virtual_environment_on_Kubernetes:~:text=pwb_venv.sh,mwoauth%2Cmysql%5D> example one `cd`s to `$HOME/pywikibot` and `pip3 install`s their dependencies with the `-e` flag. What if the user does not have the local `pywikibot` folder? What worked for me was simply install all my dependencies together in the first `pip3 install` line, and ignore the change of directory and `editable` installs. Should there be two extra dependencies examples, one for local installation and one for shared files? At this point, there is less value in using the shared files since you will still have to install pywikibot's dependencies. These are available globally on the grid but aren't in k8s. Generally, T249787 <https://phabricator.wikimedia.org/T249787> is the solution. If the local install directions were followed from the beginning, the first step was to git clone pywikibot into `$HOME/pywikibot`. > - Does one still need the `.pywikibot` folder? Running `generate_user_files` creates them in the `$HOME` directory, should they be moved? Not necessarily. The configuration files can go in multiple locations, including `.pywikibot`. See Manual:Pywikibot/user-config.py <https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Pywikibot/user-config.py>. > - If step 2 won't work with Kubernetes <https://wikitech.wikimedia.org/wiki/Help:Toolforge/Pywikibot#Setup_job_submission:~:text=this%20step%20will%20not%20work> and that's the recommended way of running jobs now, should the step be updated with the path file <https://wikitech.wikimedia.org/wiki/Help:Toolforge/Pywikibot#Setup_job_submission:~:text=tools.mytool%40tools%2Dsgebastion%2D11%3A~%24%20cd%20pwbvenv/lib/python3.9/site%2Dpackages%0Atools.mytool%40tools%2Dsgebastion%2D11%3A~/pwbvenv/lib/python3.9/site%2Dpackages%24%20cat%20%3E%20pywikibot.pth%0A/data/project/shared/pywikibot/stable%0A/data/project/shared/pywikibot/stable/scripts%0A%5ED> approach? I do not recommend using a `.pth` file. > - What does the -start:! <https://wikitech.wikimedia.org/wiki/Help:Toolforge/Pywikibot#Using_the_virtual_environment_on_Kubernetes:~:text=pwb.py%20script_name-,%2Dstart%3A!,-%22%20%2D%2Dimage%20tf> flag do? I just ignored it, there's no mention to it in the jobs framework page <https://wikitech.wikimedia.org/wiki/Help:Toolforge/Jobs_framework> It is for pywikibot. See Manual:Pywikibot/Page Generators <https://www.mediawiki.org/wiki/Manual:Pywikibot/Page_Generators>. > Furthermore, I ended up here after understanding PAWS isn't appropriated for long-running scripts, but have tried using Pywikibot locally on WSL2 and Docker without success. Does documentation for either exist? I found a WSL hack <https://river.me/blog/pywikibot-windows-subsystem-linux/> but it looks outdated. I don't use docker, but I do my development in Ubuntu 22.04 in WSL2. I'm guessing you are running into issues with the user-config.py file. It must be owned by the user running the script and not writable by other users. WSL used to have issues with default file permissions - not sure if that is still the case. I have the below in my `~/.profile` plus I remember making some other adjustment for file permissions (don't recall if that was just for WSL1). https://learn.microsoft.com/en-us/windows/wsl/file-permissions has information about other ways to adjust file permissions. if [[ "$(umask)" = "0000" ]]; then umask 0022 fi TASK DETAIL https://phabricator.wikimedia.org/T134495 EMAIL PREFERENCES https://phabricator.wikimedia.org/settings/panel/emailpreferences/ To: JJMC89 Cc: Martimpassos, Xqt, Jhernandez, MJL, Paucabot, srodlund, Ameisenigel, JJMC89, Pavithraes, Ninjastrikers, JoKalliauer, Wenyi, binbot, Dvorapa, pywikibot-bugs-list, Framawiki, Xephyr826, tom29739, Vaishnav980123, zhuyifei1999, Mattias_Ostmar-WMSE, jayvdb, Aklapper, bd808, Zppix, PotsdamLamb, Devnull, Jyoo1011, JohnsonLee01, SHEKH, Dijkstra, Khutuck, Nintendofan885, Zkhalido, apaskulin, Urstrulykkr, Viztor, Namenlos314, skpuneethumar, Zylc, Bstorm, Cpaulf30, 1978Gage2001, Operator873, Bsandipan, Ivana_Isadora, DSquirrelGM, Chicocvenancio, Tbscho, MayS, Freddy2001, Mdupont, Altostratus, Avicennasis, Luke081515, mys_721tx, Jitrixis, Dinoguy1000, Gryllida, -jem-, Masti, scfc, Alchimista, coren, Jay8g, Krenair
_______________________________________________ pywikibot-bugs mailing list -- [email protected] To unsubscribe send an email to [email protected]
