Opened 5 years ago

Last modified 7 months ago

#15980 needs_work task

Meta-ticket for Python 3.6+ preparation (sage library) - stage 1

Reported by: wluebbe Owned by:
Priority: major Milestone: sage-pending
Component: python3 Keywords: python3
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description (last modified by chapoton)

For progress on making all doctests pass, see #26212

This ticket tracks a number of other tickets that relate to various tasks to prepare Sage code for Python 3.
The following table lists those fixers from 2to3 that are applicable for stage 1.

stage 1 includes those 2to3 fixers that produce code which can run on Python 2.7 (possibly using some from __future__ import ... or from future_builtins import ...). The code will usually not run on Python 3.

stage 2 has those 2to3 fixers (and possibly others) that produce code which can run on Python 3 (more precisely Python 3.3+). The code can run on Python 2 only with the support of imported "compatibility" libraries. Stage 2 is now meta-ticket #16052.

After completion of stage 1 and 2 Sage should have a single, common code base for Python 2.7 and Python 3.3+.

No. 2to3 fixer see ticket Comment
1apply none Nothing to change
3buffer none Nothing to change
4callable none No need to change (reintroduced in Python 3.2)
6except #15982 about 98 py&pyx modules
9exitfunc none Nothing to change
10filter #16067 about 53 modules
11funcattrs #15983 about 17 py&pyx modules; since Py2.6 compatible fcts available
12future none do NOT run, as we want to keep from __future__ import xxx
13getcwdu none Nothing to change
14has_key #15784 Nothing to change, since already done
15idioms #15984 about 145 py&pyx modules; details see ticket
16import #15985, #22808 about 568 py modules; with from __future__ import absolute_import
18imports2 none Nothing to change
19input none Nothing to change
20intern none Nothing to change
21isinstance none Nothing to change
27methodattrs #15986 7 py&pyx modules; since Py2.6 compatible fcts available
28ne #15734 Done
29anext #16075 about 84 modules
32operator none Nothing to change
33paren #15988 2 py modules
34print #15989 about 204 py modules and many doctests; with from __future__ import print_function
35raise #15990 about 505 py modules
37reduce #16078 about 24 modules
38renames #15991 18 py&pyx modules
39repr #15992 4 py modules
40set_literal none do NOT run, as it is mere style change
41standard_error none Nothing to change
42sys_exc none Nothing to change
43throw none Nothing to change
44tuple_params #15993, #20554
45types #15994 5 py modules
48ws_comma none do NOT run; about 13,049 changes; just to enhance readability and PEP8 compliance
50xreadlines none Nothing to change

The following changes do not relate to 2to3:

61division #18622, #18578, #15995, #19535, #19536, #19842 up to 411 py modules; with from __future__ import division
62cmp parameter #16536 a few modules affected
63rich comparison #16537 many modules affected
  • Note 1: The No. in the above table is an enumeration of the fixers of lib2to3/fixes/*.
  • Note 2: No. starting with denote fixers not included in lib2to3/fixes/*.

Change History (29)

comment:1 Changed 5 years ago by wluebbe

  • Description modified (diff)

comment:2 Changed 5 years ago by wluebbe

  • Description modified (diff)

comment:3 Changed 5 years ago by wluebbe

  • Description modified (diff)

comment:4 Changed 5 years ago by ohanar

  • Summary changed from Meta-ticket for Python 3.3+ preparation - stage 1 to Meta-ticket for Python 3.3+ preparation (sage library) - stage 1

Hi Wilfried,

There is currently a meta-ticket pertaining to supporting Python 3.3 for the Sage distribution, which includes making various changes to the build system and upgrading various dependencies (see #15530). I've added this meta-ticket to that meta-ticket and changed the summary of this one to better reflect that it is specifically referring to the sage library.

I'm a little confused on your distinction between stage 1 and stage 2. What exactly are things that go into stage 2 but not into stage 1?

I don't see anywhere in this list issues with renamed/reorganized libraries like urllib or StringIO, maybe this is part of the compatibility library that you mention as part of stage 2? Also, probably the biggest issue with Python 3 support is the requirement for rich comparison, which again wasn't mentioned in here.

Last edited 5 years ago by ohanar (previous) (diff)

comment:5 Changed 5 years ago by wluebbe

Hi Andrew,

Thanks for linking the ticket:15530 and improving the ticket's title.

As for stage 2 I guess I should soon open the respective meta-ticket.

Some reasons for assigning tasks to stage 2:

  • The code can run on Python 2 only with the support of imported "compatibility" libraries. [copied from description] Maybe we have to check the licenses of the used compatibility libraries.
  • The tasks are usually more complicated. The approach may not be obvious or uncontroversial.
  • To make progress we need a Python 3.3 test environment for them (can ticket:15530 help?).

And yes, the issues to mention belong to stage 2.

Hopefully the tasks assigned to stage 1 turn out (relatively) easy :-)

comment:6 Changed 5 years ago by wluebbe

  • Description modified (diff)

comment:7 Changed 5 years ago by wluebbe

  • Description modified (diff)
  • Status changed from new to needs_review

comment:8 Changed 5 years ago by wluebbe

  • Status changed from needs_review to needs_work

Was changed to "needs review" to allow "needs work".

comment:9 Changed 5 years ago by wluebbe

  • Description modified (diff)

comment:10 Changed 5 years ago by wluebbe

  • Description modified (diff)

comment:11 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:12 Changed 5 years ago by wluebbe

  • Description modified (diff)

Changed No. 10 (ticket:16067) and No. 37 (ticket:16078) from stage 2 to stage 1.

Corrected the fixer name in No. 50 to "xreadlines".

comment:13 Changed 5 years ago by wluebbe

  • Description modified (diff)

comment:14 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:15 Changed 4 years ago by jdemeyer

  • Description modified (diff)
  • Milestone changed from sage-6.4 to sage-6.8
  • Type changed from enhancement to task

comment:16 Changed 4 years ago by wluebbe

  • Description modified (diff)

comment:17 Changed 4 years ago by jdemeyer

  • Description modified (diff)

comment:18 Changed 4 years ago by jdemeyer

  • Description modified (diff)

comment:19 Changed 4 years ago by jdemeyer

  • Description modified (diff)

comment:20 Changed 4 years ago by jdemeyer

  • Description modified (diff)

comment:21 Changed 4 years ago by jdemeyer

  • Description modified (diff)

comment:22 Changed 3 years ago by jdemeyer

  • Description modified (diff)

comment:23 Changed 3 years ago by jdemeyer

  • Component changed from distribution to python3

comment:24 Changed 3 years ago by jdemeyer

  • Description modified (diff)

comment:25 Changed 2 years ago by jdemeyer

  • Description modified (diff)

comment:26 Changed 2 years ago by chapoton

  • Milestone changed from sage-6.8 to sage-8.0

comment:27 Changed 16 months ago by embray

  • Milestone changed from sage-8.0 to sage-pending

comment:28 Changed 16 months ago by embray

  • Summary changed from Meta-ticket for Python 3.3+ preparation (sage library) - stage 1 to Meta-ticket for Python 3.6+ preparation (sage library) - stage 1

comment:29 Changed 7 months ago by chapoton

  • Description modified (diff)
Note: See TracTickets for help on using tickets.