Page MenuHomePhabricator

Drop support of python 2.7
Open, LowestPublic

Description

Python 2.7 as reached his EOL release and will not be maintained after January 1st, 2020 [1] due to PEP 373 [2]. More and more projects withdraw support of python 2.7 [3] including test packages [4]

I propose to use the full potental for python 3 and to cleanup code from old stuff. This hasn't to be immediately but bot owners should be conducted to Switch so python 3 soon.

What can be the steps to proceed?

  • Abandon support for Python 2.6 (T154771)
  • Drop support for Python 3.3 (T184508)
  • Drop support for python 2.7.2 and 2.7.3 now (T191192)
  • Drop support for Python 2.7.6 and lower in few months (T203471)
  • Drop support for Python 2.7.8 and lower in few months due to InsecureWarning of urllib3 [5]
  • Withdraw Python 2.7.2/2.7.3 from appveyor test
  • Add python 3.7 to test matrix gerrit:433554
  • Add python 3.8 to test matrix gerrit:482532
  • New functionalities for python 3 only
  • Drop support for python 2.7 in 2020

If someone cannot upgrade to Python 3.0, the older Pywikibot releases are still available either via pypi package or the corresponding tag in our repository but one should be aware that these issues may still lead to problems.

Newest test packages using Python 3 only

  • irc
  • pydocstyle (also used by other packages)
  • pytest (from version 5.0)
  • Pillow (from Version 7.0)

packages needed for Python 2.7 compatibility

  • ipaddr
  • mock
  • pathlib2
  • requests[security] (for 2.7.4 - 2.7.8)
  • six
  • unicodecsv

[1] https://pythonclock.org/
[2] https://www.python.org/dev/peps/pep-0373/
[3] https://python3statement.org/
[4] https://pypi.org/project/pydocstyle/#description, T215874
[5] https://www.franzoni.eu/python-requests-ssl-and-insecureplatformwarning/

Event Timeline

Xqt created this task.Jan 9 2019, 2:37 PM
Restricted Application added subscribers: pywikibot-bugs-list, Aklapper. · View Herald TranscriptJan 9 2019, 2:37 PM
Dvorapa added a subscriber: Dvorapa.Jan 9 2019, 3:11 PM
Xqt updated the task description. (Show Details)Jan 9 2019, 3:47 PM
Xqt triaged this task as Lowest priority.Jan 11 2019, 8:25 AM
Dalba awarded a token.Jan 14 2019, 5:56 AM
Xqt updated the task description. (Show Details)Jan 15 2019, 12:05 PM

What about py3.4? It's EOL is planned to 3/2019

Xqt added a comment.Jan 15 2019, 1:41 PM

What about py3.4? It's EOL is planned to 3/2019

Sure but we should drop py2 first which is hard enough ;)
I fear we will get some compatibility problems with py3.4 and py3.5 when py3.8 is released at the end of this year and guess what py 2.7 does.

What about py3.4? It's EOL is planned to 3/2019

Sure but we should drop py2 first which is hard enough ;)
I fear we will get some compatibility problems with py3.4 and py3.5 when py3.8 is released at the end of this year and guess what py 2.7 does.

Yeah, seems logic. Do we have now some warning, that py2.7 will be dropped in a year?

BTW what blocks dropping of py2.7.3 and py3.7 testing?

Xqt added a comment.Jan 15 2019, 2:02 PM

BTW what blocks dropping of py2.7.3 and py3.7 testing?

I made the patch. feel free to merge it.
But T213518 should be merged first to enable test for Travis and Appveyor and solve the known test bug.

Xqt updated the task description. (Show Details)Feb 12 2019, 10:50 AM
Xqt updated the task description. (Show Details)
Xqt added a comment.EditedFeb 12 2019, 11:09 AM

Yeah, seems logic. Do we have now some warning, that py2.7 will be dropped in a year?

Our framework has warning when using it with python <= 2.7.3:

warn(
    'Pywikibot will soon drop support for Python 2.7.2 and 2.7.3, '
    'please update your Python.',
    FutureWarning,

There are some warnings on tests:

and more and more test packages doesn't support Python 2 anymore (pythest is dropping 3.4 with 5.0.0 soon)

Xqt updated the task description. (Show Details)Feb 13 2019, 3:28 PM
Xqt changed the status of subtask T203471: Drop support for Python 2.7.6 and lower from Stalled to Open.
Dvorapa added a comment.EditedFeb 13 2019, 4:41 PM

We could make a plan Pywikibot users could rely on. Like dropping 2.7.6 in 2 months, 2.7.9 in 4 months, some space for another potential deprecation, 2.7 in 8 months, 3.4 in 10 months (just an idea, not an actual proposal).

Xqt updated the task description. (Show Details)Feb 18 2019, 3:50 PM
Xqt updated the task description. (Show Details)Feb 18 2019, 4:05 PM
Xqt updated the task description. (Show Details)Thu, Apr 4, 1:54 PM