Page MenuHomePhabricator

Release a new version of pywikibot
Closed, ResolvedPublic

Assigned To
Authored By
nichtich
Dec 11 2016, 2:05 PM
Referenced Files
F7220262: Photo le 04-04-2017 à 22.22.jpg
Apr 4 2017, 8:23 PM
Tokens
"Party Time" token, awarded by Lokal_Profil."Manufacturing Defect?" token, awarded by hashar."The World Burns" token, awarded by Framawiki."Love" token, awarded by zhuyifei1999."Love" token, awarded by Pintoch."Like" token, awarded by Dalba."Pterodactyl" token, awarded by nichtich."100" token, awarded by Magul.

Description

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 (?)

Event Timeline

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:

git+git://github.com/wikimedia/pywikibot-core.git@COMMITHASH

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.

Yep,

git+git://github.com/wikimedia/pywikibot-core.git@COMMITHASH

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.

Thanks, I ended up using 2.0rc5 and adding SPARQL capabilities to my own code. For my use case this issue can be closed but a new release of pywikibot is required anyway.

Dalba added subscribers: Pintoch, Legoktm, valhallasw and 5 others.
Dalba subscribed.

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.
Dalba triaged this task as High priority.Jan 2 2017, 11:51 PM

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.

I don't think I ever released anything on Pypi. I would not mind giving it a try but I cannot get access to my Pypi credentials and their recovery system fails for my account :/

Change 346342 had a related patch set uploaded (by Merlijn van Deen):
[pywikibot/core@master] Allow date-versioned pypi releases from setup.py

https://gerrit.wikimedia.org/r/346342

I have pushed pywikibot-3.0.20170403.tar.gz to PyPI.

Change 346342 merged by jenkins-bot:
[pywikibot/core@master] Allow date-versioned pypi releases from setup.py

https://gerrit.wikimedia.org/r/346342

I have pushed pywikibot-3.0.20170403.tar.gz to PyPI.

Thanks!!

Dalba claimed this task.
Dalba reassigned this task from Dalba to valhallasw.