I was about to use pywikibot with sparql in a project until I realized that sparql is not supported in the latest version installabe via pip (2.0rc5 from 2016-09-15). Could you please add a new release or release candidate to build on? Looks like sparql has been implemented in May but not merged into the release branch (?)
- Mentioned In
- T151783: Switch ErfgoedBot to use pywikibot master (and pin to specific commit)
T159280: Update the version of pywikibot that is available through pip
T150210: Make WbQuantity handle case without errors
T106121: RFC removing old code / code cleanup
- Mentioned Here
- T142155: Bot can't login. keyError in GetCookie
T154445: Outdated and misconfigured pywikibot PyPI package
T106121: RFC removing old code / code cleanup
Hi @nichtich for this report. First of all thanks for Your report, As You will find in ticket T106121 we have some discussion about how to release Pywikibot . I'm trying to advocate for abandoning plan for 2.0 version with full compatibility with Pywikibot-compat and instead start frequent releases from master branch (like one release a month or so).
It would be great to know, what do You think about it? BTW have You tried to install it from sources? If You could also say how it works or why haven't You try?
Sure the sources work but I want to release a tool based on pywikibot. My current requirements.txt contains pywikibot but the latest version is 2.0rc5 without SPARQL features. I don't mind which version number but new features must be releases to be usable. Having unreleased features in a developer branch makes sense but these features are deployed at PAWS and documented (?). Without releases it is hard to tell whether and how some feature are available or not.
By the way, I just found out that I can refer to a specific state of code in requirements.txt like this:
But which commit is kind of stable (according to https://travis-ci.org/wikimedia/pywikibot-core/builds the code fails since month)? Checkout is also slow this way because each user has to download the full repository instead of a single state.
My current idea to work around the lack of releases is to pin 2.0rc5 in my requirements and copy the missing pieces of code from "current" pywikibot into my project if doable. So in order to use current features of pywikibot in a reliable, distributable way I seem to be forced to include a partial fork of it.
will work, alternatively You could push whichever commit to pypi under different name (that will resolve issue about downloading whole repo). I would suggest to not copy missing pieces - it could work for now, but You will be responsible for maintaining these pieces in Your code and it looks like waste of time.
As we are talking about stability I would say, that nobody is able to say which commit could be seen as more stable. You could randomly pick one.
Quoting form T154445:
The PyPI package for pywikibot has various issues that make it unusable. The first one is that the "requests" package is not listed as a dependency, so it needs to be installed manually.virtualenv venv source venv/bin/activate pip install pywikibot python -c "import pywikibot" # fails because "requests" is not installed pip install requests python -c "import pywikibot" # succeeds
The second is that it cannot be used to perform any edit because issue T142155 was still not fixed when the package was created. To reproduce this bug, just run the following script in the virtualenv set up as above, with an appropriate user-config.py:import pywikibot site = pywikibot.Site() site.login()
which gives the following output:Password for user Pintoch on wikipedia:en (no characters will be shown): Logging in to wikipedia:en as Pintoch WARNING: API warning (login): Fetching a token via "action=login" is deprecated. Use "action=query&meta=tokens&type=login" instead. WARNING: API warning (login): Main-account login via "action=login" is deprecated and may stop working without warning. To continue login with "action=login", see [[Special:BotPasswords]]. To safely continue using main-account login, see "action=clientlogin". Traceback (most recent call last): File "test.py", line 3, in <module> site.login() File "/home/antonin/Programmation/Wikipedia/pywikibot/pywikibot/site.py", line 2004, in login if loginMan.login(retry=True): File "/home/antonin/Programmation/Wikipedia/pywikibot/pywikibot/login.py", line 277, in login cookiedata = self.getCookie() File "/home/antonin/Programmation/Wikipedia/pywikibot/pywikibot/data/api.py", line 3007, in getCookie prefix = login_result['login']['cookieprefix'] KeyError: u'cookieprefix' <type 'exceptions.KeyError'> CRITICAL: Closing network session.
Please can any of the maintainers on PyPI do this? @valhallasw, @Xqt, @jayvdb, @XZise, @Legoktm, or @hashar
Or add anybody else on PyPI to do it for them. I am happy to do it if I am given the rights to do so. This is really important! People keep reporting issues which are duplicates of this one.
I think the concerns in T106121 about compatibility with pywikibot-compat are outdated, as the current version is completely broken (totally unusable as it is not possible to log in). There's no point in maintaining compatibility with pywikibot-compat if the library cannot be used at all.
Just release the current master branch as whatever version you want, even if there are minor bugs it will still be better than what we currently have.