Opened 2 years ago

Closed 23 months ago

#29141 closed task (worksforme)

Meta-ticket: Remove Python 2 support for Sage 9.2; upgrades enabled by the removal

Reported by: mkoeppe Owned by:
Priority: major Milestone: sage-duplicate/invalid/wontfix
Component: python3 Keywords: sd109
Cc: chapoton, embray, jdemeyer, slelievre, arojas, fbissey, gh-timokau, jhpalmieri, tscrim, isuruf, nbruin, mjo, vbraun, dimpase, vdelecroix, gh-kliem Merged in:
Authors: Reviewers: Dima Pasechnik
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Status badges

Description (last modified by gh-mwageringel)

From https://groups.google.com/forum/#!topic/sage-devel/vYlbnAwKATM "drop python2 compatibility in 9.1" (thread Jan 5-22, 2020).

Removal of Python 2 support in Sage 9.2 has been announced at https://wiki.sagemath.org/Python3-Switch and https://wiki.sagemath.org/ReleaseTours/sage-9.1

Removal tickets:

  • #28000 For Sage 9.2: Remove python 2 support from sagelib
  • #29669 For Sage 9.2: Remove Python 2 support from the build system and CI scripts
  • #27826 - remove long hack for Python 3 in doctest/forker.py, remove all calls to long()
  • #29754 - remove Python 2 package and packages which backports various parts of Python

Upgrade tickets:

Please check that upgraded packages are compatible with Python >= 3.6 (and note this on the upgrade ticket) because we may wish to support Python 3.6 venv (#29033).

Other:

  • compatibility with python 3.8... needs details
    • "at this point the major issues are python 3.8 and ipython 7, and I don't see how one could support several versions of them without forking hundreds of doctests. Both updates require multi-thousand-lines patches, due to changes in dict sorting and hashes."
  • remove src/sage/cpython/_py2_random.py
    • This was added in #24508 and is only used during doctesting in order to ensure consistent random results between Python 2 and 3.

Reference: Tickets that kept Python 2 compatibility but introduced a performance penalty for Python 2:

  • #29103 (get rid of part of itervalues)

See also:

  • #29756 Meta-ticket: Review of Python 3 features that sagelib should use systematically

Change History (28)

comment:1 Changed 2 years ago by arojas

python 3.8 update is tracked in #27754, there is a list of issues that need fixing. rpy3 support is merged already in 9.1.beta2 (#28988), as well as networkx 2.4, which is also py3-only (#28450). IMO #28190 is no longer worth the effort at this point, provided that python2 support is to be dropped at 9.2 in the worst case.

comment:2 Changed 2 years ago by mkoeppe

Please feel free to update the ticket description.

comment:3 Changed 2 years ago by arojas

  • Description modified (diff)

comment:4 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:5 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:6 Changed 2 years ago by mkoeppe

  • Cc dimpase added
  • Description modified (diff)

comment:7 Changed 2 years ago by mkoeppe

  • Cc vdelecroix added
  • Description modified (diff)

comment:8 Changed 2 years ago by mkoeppe

I have just updated https://wiki.sagemath.org/Python3-Switch to say that the upcoming 9.1 will still support Python 2

comment:9 Changed 2 years ago by jhpalmieri

  • Description modified (diff)

comment:10 Changed 2 years ago by mkoeppe

  • Description modified (diff)
  • Summary changed from Meta-ticket: Upgrades and other changes that require dropping py2 support or separate package versions for py2/py3 to Meta-ticket: Remove Python 2 support for Sage 9.2; upgrades enabled by the removal

comment:11 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:12 Changed 2 years ago by fbissey

I am working on #29042 and I noticed that neither #28000 or #29669 remove # py2 and # py3 for doctesting. Is there a ticket for that which should then be in the summary, or is it something that is planned to be removed on the longer term?

comment:13 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:14 Changed 2 years ago by jhpalmieri

  • Description modified (diff)

comment:15 Changed 2 years ago by jhpalmieri

@fbissey: I don't know of any ticket for removing py2 and py3 tags.

comment:16 follow-up: Changed 2 years ago by fbissey

Another thing that I spotted scanning stuff in #29633. We have a lot python feature backport packages in our tree. We may want to get rid of them as we get rid of python 2.7 and anything older than python 3.7 in fact. Look at enum34 if you don't get what I mean.

comment:17 Changed 2 years ago by slelievre

Another thing that I spotted scanning stuff in #29633. We have a lot of Python feature backport packages in our tree. We may want to get rid of them as we get rid of Python 2.7 and anything older than Python 3.7 in fact. Look at enum34 if you don't get what I mean.

Consider keeping support Python 3.6, whose official support is till 2021-12-23. See #29033.

Python 3.5 support ends in 2020-09, so fine to drop it. See life cycle of Python versions:

comment:18 Changed 2 years ago by mkoeppe

  • Keywords sd109 added

comment:19 in reply to: ↑ 16 ; follow-up: Changed 2 years ago by jhpalmieri

Replying to fbissey:

Another thing that I spotted scanning stuff in #29633. We have a lot python feature backport packages in our tree. We may want to get rid of them as we get rid of python 2.7 and anything older than python 3.7 in fact. Look at enum34 if you don't get what I mean.

I'm working on this. I'll open up a ticket and post a link here some time soon.

comment:20 in reply to: ↑ 19 Changed 2 years ago by jhpalmieri

Replying to jhpalmieri:

I'm working on this. I'll open up a ticket and post a link here some time soon.

See #29754.

comment:21 Changed 2 years ago by jhpalmieri

  • Description modified (diff)

comment:22 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:23 Changed 2 years ago by mkoeppe

  • Description modified (diff)

comment:24 Changed 2 years ago by mkoeppe

  • Cc gh-kliem added
  • Description modified (diff)

comment:25 Changed 2 years ago by gh-mwageringel

  • Description modified (diff)

comment:26 Changed 23 months ago by mkoeppe

  • Milestone changed from sage-9.2 to sage-duplicate/invalid/wontfix
  • Status changed from new to needs_review

We can close this ticket as completed.

Last edited 23 months ago by slelievre (previous) (diff)

comment:27 Changed 23 months ago by dimpase

  • Reviewers set to Dima Pasechnik
  • Status changed from needs_review to positive_review

comment:28 Changed 23 months ago by chapoton

  • Resolution set to worksforme
  • Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.