Opened 2 years ago

Closed 2 years ago

# update sagetex to version 3.2

Reported by: Owned by: dimpase critical sage-8.7 packages: standard sagetex, py3 Dima Pasechnik François Bissey, Karl-Dieter Crisman Fixed upstream, in a later stable release. e4d70cc e4d70cc3dc991cf96e7676fe5579be12dae481f4

This is to merge various fixes, in particular ones from Debian, and prepare for Python 3.

propose eventual patches on the package github repo https://github.com/sagemath/sagetex

### comment:1 Changed 2 years ago by dimpase

• Authors set to Dima Pasechnik

### comment:2 Changed 2 years ago by dimpase

• Description modified (diff)

### comment:3 follow-up: ↓ 11 Changed 2 years ago by fbissey

Well when I tried to package it for python 2.7 and 3.6 in sage-on-gentoo I got the following

byte-compiling /dev/shm/portage/dev-tex/sage-latex-3.1/image/_python3.6/usr/lib64/python3.6/site-packages/sagetex.py to sagetex.cpython-36.pyc
writing byte-compilation script '/dev/shm/portage/dev-tex/sage-latex-3.1/temp/tmp1cn1xh43.py'
/usr/bin/python3.6 /dev/shm/portage/dev-tex/sage-latex-3.1/temp/tmp1cn1xh43.py
File "/usr/lib64/python3.6/site-packages/sagetex.py", line 156
raise SyntaxError, """ SageTeX no longer supports "..." for line continuation in sagexample and
^
SyntaxError: invalid syntax


It didn't stop the install but I think that will be an issue at runtime.

### comment:4 follow-up: ↓ 5 Changed 2 years ago by dimpase

This is a python3-build, no?

### comment:5 in reply to: ↑ 4 Changed 2 years ago by fbissey

This is a python3-build, no?

I do both 2.7 and 3.6, and yes that's from the python3 part.

### comment:6 Changed 2 years ago by kcrisman

Fixing this should hopefully deal with #23085, and possibly #21450 and #22499. The latter two would require having a way to auto-generate, or something, the example.pdf and make sure that all links in install and elsewhere only point to the sagetex tutorial document, not the install guide.

Last edited 2 years ago by kcrisman (previous) (diff)

### comment:7 follow-ups: ↓ 8 ↓ 9 Changed 2 years ago by dimpase

My understanding is that some of PRs I merged are related to py3 support of SageTeX. I have not tried it in on py3 yet - it's not a requirement at the moment that everything must be py3-compatible, right?

On py2 example.pdf is autogenerated now, as far as I can tell...

### comment:8 in reply to: ↑ 7 ; follow-up: ↓ 10 Changed 2 years ago by fbissey

My understanding is that some of PRs I merged are related to py3 support of SageTeX.

Yes, I have seen them.

I have not tried it in on py3 yet - it's not a requirement at the moment that everything must be py3-compatible, right?

I guess it is not an absolute requirement yet. I probably should open an issue then.

### comment:9 in reply to: ↑ 7 Changed 2 years ago by kcrisman

On py2 example.pdf is autogenerated now, as far as I can tell...

Sorry, I meant on the GH site so that documentation is available outside of Sage proper (since I don't think one can independently download the ST doc other than from the ST GH page). But that would not technically block this ticket; comment:6 was just an FYI for those reading this thread.

### comment:10 in reply to: ↑ 8 Changed 2 years ago by kcrisman

I guess it is not an absolute requirement yet. I probably should open an issue then.

FWIW, #23085 is the py3 compatibility ticket for ST.

### comment:11 in reply to: ↑ 3 Changed 2 years ago by dimpase

Well when I tried to package it for python 2.7 and 3.6 in sage-on-gentoo I got the following

byte-compiling /dev/shm/portage/dev-tex/sage-latex-3.1/image/_python3.6/usr/lib64/python3.6/site-packages/sagetex.py to sagetex.cpython-36.pyc
writing byte-compilation script '/dev/shm/portage/dev-tex/sage-latex-3.1/temp/tmp1cn1xh43.py'
/usr/bin/python3.6 /dev/shm/portage/dev-tex/sage-latex-3.1/temp/tmp1cn1xh43.py
File "/usr/lib64/python3.6/site-packages/sagetex.py", line 156
raise SyntaxError, """ SageTeX no longer supports "..." for line continuation in sagexample and
^
SyntaxError: invalid syntax


It didn't stop the install but I think that will be an issue at runtime.

I've only tried py2. Now trying on py3:

I've pushed a commit to sagetex repo which fixes this, and another py2-only leftover. https://github.com/sagemath/sagetex/commit/2f3d4be3736e4adb0674ddbf94bda63e0ff7265e

There is still a problem one has to deal with:

SageTeX paused on sagetex.tex line 882
SageTeX unpaused on sagetex.tex line 887
Traceback (most recent call last):
File "sagetex.sagetex.sage.py", line 77, in <module>
_st_.endofdoc()
File "/home/dimpase/sagetex-3.0/sagetex.py", line 276, in endofdoc
m.update(line)
TypeError: Unicode-objects must be encoded before hashing
Makefile:13: recipe for target 'sagetex.pdf' failed
make: *** [sagetex.pdf] Error 1


### comment:12 Changed 2 years ago by git

• Commit changed from 784bb8ce0c112d8b2680c427973b8d45cfc9e120 to 7f67e720febef2b5d0f30a87dcc7e6207de7f2d4

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

 ​4dcba27 Merge branch 'develop' of trac.sagemath.org:sage into stex31 ​7f67e72 version bump

### comment:13 Changed 2 years ago by dimpase

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

updated to fix more py3 stuff and docs

### comment:14 Changed 2 years ago by dimpase

• Summary changed from update sagetex to version 3.1 to update sagetex to version 3.2

### comment:15 Changed 2 years ago by dimpase

• Status changed from needs_review to needs_work

fix tarball and get some sleep

### comment:16 Changed 2 years ago by dimpase

• Status changed from needs_work to needs_review

OK, it all seems in order now. Works on py2 and on py3.

### comment:17 Changed 2 years ago by kcrisman

I'm getting the weird situation that I am not getting any errors when upgrading! Usually there is a strict 1-1 correspondence between sty file and Sage version necessary. Do you think I am doing something wrong?

Upon further looking, there was no updating of the key lines in sagetex.dtx that give the version number. I don't know if this matters.

I'm also doing a little maintenance of some non-essential stuff on the GH right now, see what you think - I don't think it should block this py3 business though.

### comment:18 Changed 2 years ago by dimpase

I am not sure what are "key lines" in sagetex.dtx you are talking about. I bumped up the version in setup.py, that's all...

### comment:19 Changed 2 years ago by kcrisman

Sorry, I'll make mention of that on GH. Here is some relevant verbiage. sagetex.dtx:

% As of version 2.2.4, \ST automatically checks to see if the versions
% of the style file and Python module match. This is intended to prevent
% strange version mismatch problems, but if you would like to use
% mismatched sources, you can---at your peril---give the
% |noversioncheck| option when you load the \ST package. Don't be
% surprised if things don't work when you do this.
%
% If you are considering using this option because the Sage script
% complained and exited, you really should just get the \LTX and Python
% modules synchronized. Every copy of Sage since version 4.3.2 comes
% with a copy of |sagetex.sty| that is matched up to Sage's baked-in \ST
% support, so you can always use that. See the
% \href{http://doc.sagemath.org/html/en/tutorial/sagetex.html}{\ST section of the Sage
%   tutorial}.

Warning it’s very important that the file sagetex.sty that LaTeX uses when typesetting your document match the version of SageTeX that Sage is using. If you upgrade your Sage installation, you really should delete all the old versions of sagetex.sty floating around.
Because of this problem, we recommend copying the SageTeX files into your home directory’s texmf directory (the third method above). Then there is only one thing you need to do (copy a directory) when you upgrade Sage to insure that SageTeX will work properly.


So I think somehow we missed something here.

### comment:20 Changed 2 years ago by kcrisman

(The point being that maybe it really does matter. The Python and .sty files are not visible on GH, but it's possible there are some subtle errors; for instance, did the style file change, or only the Python for py3? And would that make them incompatible, or not be a problem?)

### comment:21 Changed 2 years ago by dimpase

This is something make dist must check. Perhaps it does not. I guess I bumped up the version and created the distribution, without any errors...

### comment:22 Changed 2 years ago by dimpase

Can you dig up where the version number is set in dtx, while I am out on a school run?

### comment:23 Changed 2 years ago by kcrisman

See GH issue 27 for details. My best guess is that Dan originally manually did this to avoid issues, but presumably at least sometimes there wouldn't be any or they would be subtle. I have contacted him off list too, and hopefully can get brief feedback for that and one other issue on GH.

### comment:24 Changed 2 years ago by dimpase

OK, sagetex.sty in the tarfile still has \newcommand{\ST@ver}{2015/08/26 v3.0-92d9f7a} which is obviously old. Need to find out where it is set.

### comment:25 Changed 2 years ago by dimpase

• Status changed from needs_review to needs_work
• Work issues set to update tarball etc

### comment:26 Changed 2 years ago by git

• Commit changed from 7f67e720febef2b5d0f30a87dcc7e6207de7f2d4 to e4d70cc3dc991cf96e7676fe5579be12dae481f4

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

 ​e4d70cc newer tarball checksum

### comment:27 Changed 2 years ago by dimpase

• Status changed from needs_work to needs_review
• Work issues update tarball etc deleted

ok, now versions should be consistent (3.2) everywhere.

### comment:28 Changed 2 years ago by kcrisman

Success! All error messages occurred when and where expected, and did not occur when the sagetex.sty was in the appropriate places. sage -f -c sagetex also seems to have created the right stuff, though I did get some error messages and this:

[sagetex-3.2] (\end occurred inside a group at level 1)
[sagetex-3.2]
[sagetex-3.2] ### simple group (level 1) entered at line 27 ({)
[sagetex-3.2] ### bottom level
[sagetex-3.2] (see the transcript file for additional information)


but anyway. I would say if you update the GH site with example.pdf and sagetex.pdf that would make things fairly good to go, though I guess fbissey should also try it on py3 for reviewing purposes, since I do not have that done (nor will I for now).

### comment:29 Changed 2 years ago by dimpase

I think it should be OK on py3 side. I've uploaded the pdf files to the 3.2 release mini-page.

### comment:30 Changed 2 years ago by dimpase

I've seen messages like (\end occurred inside a group at level 1) in 3.0 too.

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

My earlier problems with 3.1 and python3.6 are all gone with that new version :)

### comment:32 in reply to: ↑ 31 ; follow-up: ↓ 35 Changed 2 years ago by kcrisman

My earlier problems with 3.1 and python3.6 are all gone with that new version :)

So does that mean #23085 is ready for review? (Also, was that ever on #15530?)

### comment:33 Changed 2 years ago by kcrisman

• Report Upstream changed from N/A to Fixed upstream, in a later stable release.
• Reviewers set to François Bissey, Karl-Dieter Crisman

### comment:34 Changed 2 years ago by kcrisman

Once this is closed, then #21450 can also be closed.

### comment:35 in reply to: ↑ 32 Changed 2 years ago by fbissey

My earlier problems with 3.1 and python3.6 are all gone with that new version :)

So does that mean #23085 is ready for review? (Also, was that ever on #15530?)

I'll have to check on that particular example. Just because pre-compiling works doesn't mean everything work in a practical sense.

### comment:36 Changed 2 years ago by kcrisman

Also, if anyone else wants to review #14343 that can be closed, I believe (but I like having two opinions).

### comment:37 Changed 2 years ago by dimpase

Anything still needs a review here?

### comment:38 follow-up: ↓ 39 Changed 2 years ago by kcrisman

Not as far as I'm concerned. François you are happy?

### comment:39 in reply to: ↑ 38 Changed 2 years ago by fbissey

Not as far as I'm concerned. François you are happy?

I can't see anything wrong. So that count as happy.

### comment:40 Changed 2 years ago by dimpase

• Status changed from needs_review to positive_review

I take this as positive review then :-)

### comment:41 Changed 2 years ago by embray

• Milestone changed from sage-8.6 to sage-8.7

Retarging tickets optimistically to the next milestone. If you are responsible for this ticket (either its reporter or owner) and don't believe you are likely to complete this ticket before the next release (8.7) please retarget this ticket's milestone to sage-pending or sage-wishlist.

### comment:42 Changed 2 years ago by vbraun

• Branch changed from u/dimpase/packages/stex31 to e4d70cc3dc991cf96e7676fe5579be12dae481f4
• Resolution set to fixed
• Status changed from positive_review to closed
Note: See TracTickets for help on using tickets.