Opened 3 years ago

Last modified 13 days ago

#15530 needs_work enhancement

Metaticket: Add support for python 3.3+

Reported by: ohanar Owned by:
Priority: major Milestone: sage-8.0
Component: python3 Keywords: python3
Cc: Merged in:
Authors: Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540, #15541, #15807, #15980, #18537, #16052, #18437 Stopgaps:

Description (last modified by chapoton)

In order to support python 3.3, the following needs to be fixed:

  1. #15510 - upgrade to a newer version of setuptools
  2. #15511 - upgrade to a newer version of rpy2
  3. #15512 - upgrade to a newer version of sympy
  4. #14854 - upgrade to a newer version of pycrypto
  5. #15532 - upgrade to a newer version of networkx
  6. #15537 - fix csage to work with python3
  7. #15539 - switch from using PIL to Pillow
  8. #15540 - trivial python3 fixes to a few spkgs
  9. #15541 - fix sage-location and sage-download-file for python3
  10. #15593 - remove sqlalchemy
  11. #17591 - remove gdmodule
  12. #15620 - Stop using StandardError
  13. #15755 - upgrade cython to version 0.20.1
  14. #15807 - upgrade mpmath to version 0.18
  15. #15980 - meta-ticket for python3 compatibility of the sage library (stage 1)
  16. #16052 - meta-ticket for python3 compatibility of the sage library (stage 2)
  17. #17854 - remove c_lib
  18. #18437 - fix polybori and python 3
  19. #18537 - fix Pynac at least building against python 3
  20. #17607 - add python 3 package

How to try to make sage with python3:

export SAGE_PYTHON3=yes
make build

Possibly relevant timeline from PEP 373:

Being the last of the 2.x series, 2.7 will have an extended period of maintenance. The current plan is to support it for at least 10 years from the initial 2.7 release. This means there will be bugfix releases until 2020.

Change History (58)

comment:1 Changed 3 years ago by ohanar

  • Dependencies changed from #15510, #15511, #15512 to #15510, #15511, #15512, #15531
  • Description modified (diff)

comment:2 Changed 3 years ago by ohanar

  • Dependencies changed from #15510, #15511, #15512, #15531 to #15510, #15511, #15512, #15531, #15532
  • Description modified (diff)

comment:3 Changed 3 years ago by ohanar

  • Dependencies changed from #15510, #15511, #15512, #15531, #15532 to #15510, #15511, #15512, #15531, #15532, #15537
  • Description modified (diff)

comment:4 Changed 3 years ago by ohanar

  • Dependencies changed from #15510, #15511, #15512, #15531, #15532, #15537 to #15510, #15511, #15512, #15531, #15532, #15537, #15539
  • Description modified (diff)

comment:5 Changed 3 years ago by ohanar

  • Dependencies changed from #15510, #15511, #15512, #15531, #15532, #15537, #15539 to #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540
  • Description modified (diff)

comment:6 Changed 3 years ago by ohanar

  • Dependencies changed from #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540 to #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540, #15541
  • Description modified (diff)

comment:7 Changed 3 years ago by ohanar

  • Summary changed from Add support for python 3.3+ to Metaticket: Add support for python 3.3+

comment:8 Changed 3 years ago by tscrim

  • Status changed from new to needs_review

It looks like everything is done. Now we just need to switch Sage to python 3...

comment:9 Changed 3 years ago by ohanar

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

Sorry, I should have put a note that I haven't listed all issues (since I haven't even encountered all the issues yet).

comment:10 Changed 3 years ago by ohanar

  • Description modified (diff)

comment:11 Changed 3 years ago by ohanar

  • Description modified (diff)

comment:12 Changed 3 years ago by ohanar

  • Description modified (diff)

comment:13 Changed 3 years ago by ohanar

  • Description modified (diff)

comment:14 Changed 3 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:15 Changed 3 years ago by jdemeyer

  • Description modified (diff)

comment:16 Changed 3 years ago by ohanar

  • Description modified (diff)

comment:17 Changed 3 years ago by ohanar

  • Dependencies changed from #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540, #15541 to #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540, #15541, #15807
  • Description modified (diff)

comment:18 Changed 3 years ago by ohanar

  • Dependencies changed from #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540, #15541, #15807 to #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540, #15541, #15807, #15980
  • Description modified (diff)

comment:19 Changed 3 years ago by wluebbe

  • Description modified (diff)

comment:20 Changed 3 years ago by jason

Python 3.4 is out now...

(really just commenting to subscribe to updates)

comment:21 Changed 3 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:22 Changed 3 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4

comment:23 Changed 3 years ago by aapitzsch

  • Keywords python3 added

comment:24 Changed 2 years ago by kcrisman

  • Description modified (diff)

comment:25 Changed 2 years ago by jdemeyer

  • Description modified (diff)

comment:26 Changed 2 years ago by jdemeyer

  • Description modified (diff)

comment:27 Changed 2 years ago by jdemeyer

  • Description modified (diff)

comment:28 Changed 2 years ago by jdemeyer

  • Description modified (diff)

comment:29 Changed 2 years ago by ohanar

  • Description modified (diff)

comment:30 Changed 2 years ago by ohanar

  • Description modified (diff)

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

We had to abandon the idea of using distutils for libcsage at least as is. We could certainly use getting rid of scons for it. Do we know if there is anyone currently active for polybori? My understanding is that Alexander Dreyer has gone to the industry and no one has really taken over polybori.

comment:32 in reply to: ↑ 31 Changed 2 years ago by ohanar

Replying to fbissey:

We had to abandon the idea of using distutils for libcsage at least as is.

There was also a autotools approach at #15594, which I think could be returned to (it was closed as won't fix in favor of distutils).

We could certainly use getting rid of scons for it. Do we know if there is anyone currently active for polybori? My understanding is that Alexander Dreyer has gone to the industry and no one has really taken over polybori.

I don't really know the situation, from an outsiders perspective, it certainly looks as if the project is dead. I don't really know how best to deal with it.

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

Yes we closed the autotools ticket when we decided to go distutils. And then we found that distutils couldn't be used that way. So we should try to revive that.

Someone should try to contact Alexander or Michael Brickenstein to see if they will make any new releases. As I see it the first problem will be to remove scons as the build system for polybori. Autotools+distutils feels like the right option for it. Then we could work out the python3 migration. Removing polybori would be interesting too but I think it is ingrained deep in sage.

comment:34 in reply to: ↑ 33 Changed 2 years ago by ohanar

Replying to fbissey:

Someone should try to contact Alexander or Michael Brickenstein to see if they will make any new releases. As I see it the first problem will be to remove scons as the build system for polybori. Autotools+distutils feels like the right option for it. Then we could work out the python3 migration. Removing polybori would be interesting too but I think it is ingrained deep in sage.

I don't think it is too deeply integrated into sage, it seems like it is mainly used for boolean polynomial rings (which themselves don't seem to be very widely used in the sage library). If it is easier to make a version of sage compatible with python 3 which doesn't have polybori, than it is to bring polybori up to speed, I would definitely vote for the former (especially if it is significantly easier, which I suspect might be the case ... but I could be completely wrong). In either case, I would keep polybori around for the python 2 version of sage.

comment:35 Changed 2 years ago by jdemeyer

  • Description modified (diff)

comment:36 Changed 2 years ago by jdemeyer

  • Description modified (diff)

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

Something for which there is no ticket yet but shouldn't be forgotten. pynac is python2.7 only last time I checked. ginac/numeric.cpp needs a significant overhaul to move to python3, some of which I think I could do but some other like the rich cmp I wouldn't.

comment:38 in reply to: ↑ 37 Changed 2 years ago by kcrisman

  • Cc rws added

Something for which there is no ticket yet but shouldn't be forgotten. pynac is python2.7 only last time I checked. ginac/numeric.cpp needs a significant overhaul to move to python3, some of which I think I could do but some other like the rich cmp I wouldn't.

rws, you've been doing great work recently with a lot of the nitty-gritty stuff in Pynac - any ideas? We could at least open a ticket if this is not too impossible.

comment:39 Changed 2 years ago by ohanar

I was looking at porting pynac to python 3 a few weeks ago, and it doesn't look too bad (even the rich comp stuff, but I could always be wrong). I was either going to work on this or see if I can't figure something to do with polybori and python 3 during Sage Days 64.25.

comment:40 Changed 2 years ago by rws

I'm only starting now to get into Pynac's Python interface. I also have no idea which changes are necessary because of Python 3. So, if you cannot give me at least a lead by opening a detailed Pynac ticket then don't expect rapid progress there.

comment:41 Changed 2 years ago by fbissey

OK so I opened a pynac issue at https://github.com/pynac/pynac/issues/42 and I'll start making pull requests for what I can fix as I go along.

comment:42 Changed 2 years ago by rws

  • Dependencies changed from #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540, #15541, #15807, #15980 to #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540, #15541, #15807, #15980, pynac-0.3.8

The pynac issue is now fixed in pynac master, pending a full Py3 doctest of Sage.

comment:43 Changed 2 years ago by fbissey

Pending insulation of polybori or making it python3.4 compatible and modest hacking (in pynac and libcsage) I should be able to make a version of sage-on-gentoo that will install sage for both python 2.7 and 3.4 and test things further. I see polybori as the biggest hurdle, finishing the integration of libcsage would help too but polybori is really the biggest problem as far as I can see.

comment:44 follow-up: Changed 2 years ago by vbraun

There is some progress on scons to move to python 3 (http://thread.gmane.org/gmane.comp.programming.tools.scons.devel/12929). Still, I think thats the least of the problems. If scons doesn't get support in time we can just build Python 2 + Python 3 and use python2 for scons at build time.

comment:45 in reply to: ↑ 44 Changed 2 years ago by fbissey

Replying to vbraun:

There is some progress on scons to move to python 3 (http://thread.gmane.org/gmane.comp.programming.tools.scons.devel/12929). Still, I think thats the least of the problems. If scons doesn't get support in time we can just build Python 2 + Python 3 and use python2 for scons at build time.

I agree in principle but scons is potentially not the only problem in polybori.

comment:46 Changed 2 years ago by fbissey

First attempt to get scons to install polybori as a python 3.4 thing failed. SConstruct is relying on the version of python running scons as being the version you should use I think. That leads to a number of odd behavior and misdetections very fast.

comment:47 Changed 2 years ago by ohanar

  • Description modified (diff)

fyi, I started working on an autotools based build system for polybori at https://github.com/ohanar/PolyBoRi/tree/autotools. I'll probably work on it a bit more next weekend during SD 64.25, but the important bits (the c++ libraries) are currently working with only a couple of hacks. What remains (for sage at least) is just a little cleanup and throwing in the bit of the python bindings we use. I've created #18437 for future discussion of polybori and python 3.

comment:48 Changed 2 years ago by rws

  • Cc rws removed
  • Dependencies changed from #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540, #15541, #15807, #15980, pynac-0.3.8 to #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540, #15541, #15807, #15980, #18537
  • Milestone changed from sage-6.4 to sage-6.8

comment:49 follow-ups: Changed 2 years ago by jdemeyer

Does now every standard package except polybori support Python 3?

comment:50 Changed 2 years ago by fbissey

I think so. The current pexpect would be the other problematic one but the current has been patched to use six to support python 3 if we don't upgrade it to 3.3 + patch (#10295).

comment:51 in reply to: ↑ 49 ; follow-up: Changed 2 years ago by aapitzsch

Replying to jdemeyer:

Does now every standard package except polybori support Python 3?

The Sphinx release notes for 1.3b1 mention Add support for Python 3.4. So I assume this version is not supported by the Sphinx 1.2.2 which is currently shipped with Sage. #18497

comment:52 in reply to: ↑ 51 Changed 2 years ago by fbissey

Replying to aapitzsch:

Replying to jdemeyer:

Does now every standard package except polybori support Python 3?

The Sphinx release notes for 1.3b1 mention Add support for Python 3.4. So I assume this version is not supported by the Sphinx 1.2.2 which is currently shipped with Sage. #18497

That's odd, Gentoo permits you to build and install sphinx 1.2.2 against python 3.4 without any patch. It is a stable version so I'll assume that it passes its test suite at least with python 3.4. But going to 1.3.1 would be good anyway.

comment:53 in reply to: ↑ 49 Changed 2 years ago by ohanar

Replying to jdemeyer:

Does now every standard package except polybori support Python 3?

Pynac doesn't really support Python 3 (it builds against Python 3, but it is almost certainly broken, since it can only really be tested when sage can be built against Python 3).

comment:54 Changed 23 months ago by kcrisman

  • Dependencies changed from #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540, #15541, #15807, #15980, #18537 to #15510, #15511, #15512, #15531, #15532, #15537, #15539, #15540, #15541, #15807, #15980, #18537, #16052, #18437
  • Description modified (diff)

comment:55 Changed 13 months ago by jdemeyer

  • Component changed from packages: standard to python3
  • Description modified (diff)
  • Milestone changed from sage-6.8 to sage-feature

comment:56 Changed 11 months ago by chapoton

  • Description modified (diff)

comment:57 Changed 11 months ago by chapoton

  • Description modified (diff)

comment:58 Changed 13 days ago by chapoton

  • Milestone changed from sage-feature to sage-8.0
Note: See TracTickets for help on using tickets.