Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make Python 3 the default #28660

Closed
videlec opened this issue Oct 27, 2019 · 53 comments
Closed

Make Python 3 the default #28660

videlec opened this issue Oct 27, 2019 · 53 comments

Comments

@videlec
Copy link
Contributor

videlec commented Oct 27, 2019

Because 3 x 3 = 9 and we are at 9.0.beta3 these are three reasons to do the switch... see

https://groups.google.com/forum/#!topic/sage-devel/fmQbbSctZ-I

Depends on #28657

CC: @sagetrac-tmonteil

Component: misc

Author: Frédéric Chapoton

Branch: 715e85a

Reviewer: John Palmieri, Eric Gourgoulhon

Issue created by migration from https://trac.sagemath.org/ticket/28660

@videlec videlec added this to the sage-9.0 milestone Oct 27, 2019
@fchapoton
Copy link
Contributor

Branch: public/python3_switch

@fchapoton
Copy link
Contributor

comment:1

No idea how to do that properly. Any volunteer to do the job ?


New commits:

c9646f9py3 switch : some changes in doc only

@fchapoton
Copy link
Contributor

Commit: c9646f9

@fchapoton
Copy link
Contributor

comment:2

Some of the involved stuff:

  • SAGE_PYTHON_VERSION

  • SAGE_PYTHON3

  • --with-python

  • WITH_PYTHON

@kiwifb
Copy link
Member

kiwifb commented Oct 27, 2019

comment:3

Changing https://github.com/sagemath/sage-prod/blob/master/configure.ac#L395 should be a good start.

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 27, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

4357742python3 switch : change in configure.ac

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 27, 2019

Changed commit from c9646f9 to 4357742

@fchapoton
Copy link
Contributor

comment:5

ok, I did that. Anything else ?

@dimpase
Copy link
Member

dimpase commented Oct 27, 2019

Dependencies: #25837

@dimpase
Copy link
Member

dimpase commented Oct 27, 2019

comment:6

I think it depends on #25837, as sagenb doesn't work with Python 3.

@fchapoton
Copy link
Contributor

comment:7

Did you test ? Sagenb is already automatically put aside (i.e. not built) with python3.

@dimpase
Copy link
Member

dimpase commented Oct 27, 2019

comment:8

well, this is OK as an experimental feature, but we do install all the standard packages, normally speaking, and sagenb is standard. Besides, with Python 3 the message on https://github.com/vbraun/ExportSageNB/pull/16/commits
is unclear (it does not say that Sage must be built with Python 2 for sagenb to function)

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 27, 2019

Changed commit from 4357742 to ad6e2f9

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 27, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

ad6e2f9py3 switch more doc changes

@fchapoton
Copy link
Contributor

comment:10

vbraun/ExportSageNB#17

@jhpalmieri
Copy link
Member

comment:11

If a prerequisite for building from source becomes "Python >= 3.6", then we need #28657 as a dependency.

@jhpalmieri
Copy link
Member

Changed dependencies from #25837 to #25837 #28657

@jhpalmieri
Copy link
Member

comment:12

In my opinion, #25837 is a hybrid ticket: one part should be simple — make sagenb optional, perhaps with a better error message, as in comment:10. The other part is to add to Jupyter some functionality which sagenb has but Jupyter does not. I am willing to sacrifice the second of these goals (for now) in order to make the switch to Python 3.

@egourgoulhon
Copy link
Member

comment:13

Replying to @jhpalmieri:

In my opinion, #25837 is a hybrid ticket: one part should be simple — make sagenb optional, perhaps with a better error message, as in comment:10. The other part is to add to Jupyter some functionality which sagenb has but Jupyter does not. I am willing to sacrifice the second of these goals (for now) in order to make the switch to Python 3.

+1

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 28, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

1b42e43py3 switch more details

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 28, 2019

Changed commit from ad6e2f9 to 1b42e43

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 28, 2019

Changed commit from 1b42e43 to 3efeee9

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 28, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

3efeee9py3 swithc more details

@fchapoton
Copy link
Contributor

comment:16

May I remove the dependency to #25837 ?

@jhpalmieri
Copy link
Member

comment:17

Replying to @fchapoton:

May I remove the dependency to #25837 ?

I certainly think so.

@jhpalmieri
Copy link
Member

comment:18

And #28657 doesn't need to be a dependency for this ticket, as long as it remains a blocker for the next release.

@jhpalmieri
Copy link
Member

comment:19

I tried this and it works: after running make, I see

configure:7614: checking Python version to install
configure:7631: result: 3

@sagetrac-git
Copy link
Mannequin

sagetrac-git mannequin commented Oct 29, 2019

Branch pushed to git repo; I updated commit sha1. New commits:

715e85amake sagenb optional

@fchapoton
Copy link
Contributor

Changed dependencies from #25837 #28657 to #28657

@fchapoton
Copy link
Contributor

comment:22

ok, we can turn sagenb to optional here if you prefer.

@fchapoton
Copy link
Contributor

comment:24

Please edit and enhance the wiki page about the switch https://wiki.sagemath.org/Python3-Switch

@videlec
Copy link
Contributor Author

videlec commented Oct 31, 2019

comment:25

Replying to @fchapoton:

Please edit and enhance the wiki page about the switch https://wiki.sagemath.org/Python3-Switch

I would have thought that url link with space in them would better be avoided. You created a page Python3-compatible code. Am I allowed to fix that? I also open a page for end users who will suffer much more the transition than developers.

@fchapoton
Copy link
Contributor

comment:26

something else ? We should try to move forward.

@fchapoton
Copy link
Contributor

Author: Frédéric Chapoton

@jhpalmieri
Copy link
Member

comment:27

As I said before, it works for me. Anyone else with feedback?

@egourgoulhon
Copy link
Member

comment:28

Builds like a charm on Ubuntu 18.04 running on a i7-6700HQ + 16 GB RAM computer: having merged this ticket branch in Sage 9.0.beta4 sources (from a fresh git clone + pull develop), running
MAKE="make -j8" make yielded a fully working Python3 Sage. In particular sage -python gives

Python 3.7.3 (default, Nov  4 2019, 17:58:44) 
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.

@jhpalmieri
Copy link
Member

Reviewer: John Palmieri, Eric Gourgoulhon

@jhpalmieri
Copy link
Member

comment:30

Let's proceed with this.

@mwageringel
Copy link

comment:31

This works for me as well on CentOS.

@kcrisman
Copy link
Member

kcrisman commented Nov 7, 2019

comment:32

In my opinion, #25837 is a hybrid ticket: one part should be simple — make sagenb optional, perhaps with a better error message, as in comment:10. The other part is to add to Jupyter some functionality which sagenb has but Jupyter does not. I am willing to sacrifice the second of these goals (for now) in order to make the switch to Python 3.

"For now" are dangerous words, though, in particular regarding matrix input and automatic_names. I'm certainly glad that both 3d viewers seem to work in Jupyter now, though I haven't yet built with py3 support.

@jhpalmieri
Copy link
Member

comment:33

The switch to Python 3 needs to happen. To get these issues fixed, people need to work on them, and if no one is working on them (as seems to be the case), that isn't reason enough to delay the switch to Python 3.

@vbraun
Copy link
Member

vbraun commented Nov 14, 2019

Changed branch from public/python3_switch to 715e85a

@jhpalmieri
Copy link
Member

Changed commit from 715e85a to none

@jhpalmieri
Copy link
Member

comment:35

See #28742 for a followup: after building with Python 2 and then upgrading to a version of Sage including this ticket, the version of Python changes to 3. This causes problems, so we should detect the version mismatch and either keep using Python 2 or abort the make process, telling the user what the issue is.

@jhpalmieri
Copy link
Member

comment:36

Even though sagenb is now optional, it is still always installed because it is a dependency for building the documentation. Look at line 4 in the following, from build/make/deps:

# Building the documentation has many dependencies, because all
# documented modules are imported and because we use matplotlib to
# produce plots.
DOC_DEPENDENCIES = sagelib $(inst_sphinx) $(inst_sagenb) \
	| $(SAGERUNTIME) $(inst_maxima) $(inst_networkx) $(inst_scipy) $(inst_sympy) \
	$(inst_matplotlib) $(inst_pillow) $(inst_mathjax) $(inst_mpmath) \
	$(inst_ipykernel) $(inst_jupyter_client) $(inst_conway_polynomials) \
	$(inst_tachyon) $(inst_jmol) $(inst_thebe) $(inst_ipywidgets) $(inst_typing)

Should we create another followup to deal with this? I can do it, but it may take me a few days, because I have other higher priority things I have to do first.

@kiwifb
Copy link
Member

kiwifb commented Nov 25, 2019

comment:37

Definitely need a follow up. We disentangled that bit a while ago now. I can take care of it, if that's the only place we need to fix for this.

@kiwifb
Copy link
Member

kiwifb commented Nov 25, 2019

comment:38

It is now #28805.

@jhpalmieri
Copy link
Member

comment:39

Thanks.

@jhpalmieri
Copy link
Member

comment:40

Should we delete the file src/ext/doctest/python3-known-passing.txt and the corresponding parts of Makefile?

@dimpase
Copy link
Member

dimpase commented Dec 2, 2019

comment:41

yes, sure, let's do this.

@jhpalmieri
Copy link
Member

comment:42

I opened #28835.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

9 participants