Help talk:Toolforge/Running Pywikibot scripts (advanced)/Archives/2021

Rendered with Parsoid
From Wikitech
Warning! Please do not post any new comments on this page. This is a discussion archive See current discussion or the archives index.

Shared PWB with venv

Pinging the last three people to touch the relevant part of this page.

Is there any particular reason you have to use a git clone of PWB inside a venv? Couldn't you equally well do:

$ python3 -m venv $HOME/pwb
$ source $HOME/pwb/bin/activate
(pwb) $ (pwb) $ cd $HOME/pywikibot-core
(pwb) $ pip3 install -e .[mwparserfromhell,mwoauth,mysql]
Finished processing dependencies for pywikibot==6.6.1

The reason I ask is I've inherited a tool that's 1) big and complex with lots of interconnected sub-tools, 2) very old, reliant on Python 2 (and thus the old PWB), and based on relevant practices ca. 2015. I'm trying to tease them apart, bring them up to Python 3 and using the shared core-stable PWB, modernise them somewhat, and take advantage of new stuff in third-party modules (e.g. prettier graphs using latest matplotlib). What I'd like to do is set up venvs for each sub-tool (so one sub-tool's matplotlib 3.x doesn't break another sub-tool's dep on matplotlib 2.x), but still use the shared PWB (which I have no need to control at the level of my own git clone, and so would rather not have to).

Similarly, shouldn't this page encourage use of the shared PWB instead of a private git clone? As it's currently written it seems to put the exceptions in primary position, instead of explaining the best practice and shunting advanced / exceptional uses to a subpage. Or I'm just hopelessly confused. Probably the latter. :) --Xover (talk) 15:18, 24 October 2021 (UTC)Reply