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

Deprecate sage --cython foo.spyx #22698

Closed
kcrisman opened this issue Mar 28, 2017 · 21 comments
Closed

Deprecate sage --cython foo.spyx #22698

kcrisman opened this issue Mar 28, 2017 · 21 comments

Comments

@kcrisman
Copy link
Member

.spyx files are treated exactly the same as .pyx files in all of Sage, with one exception: sage --cython foo.spyx adds pre-processing to .spyx files. To be more compatible with other Sage commands (in particular, sage foo.spyx and load("foo.spyx")), we deprecate sage --cython foo.spyx.

There is another reason for this: sage --cython foo.spyx adds some include statements like cdefs.pxi. These .pxi files should be deprecated in Sage. Moreover, .pxi files in general are semi-deprecated anyway by upstream Cython.

CC: @robertwb @jpflori

Component: scripts

Author: Jeroen Demeyer

Branch/Commit: 6984666

Reviewer: Jean-Pierre Flori

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

@kcrisman kcrisman added this to the sage-8.0 milestone Mar 28, 2017
@jdemeyer
Copy link

comment:1

For the record: .spyx files are exactly the same as .pyx files. So we could even deprecate .spyx files if it makes people think that it's something Sage-specific while it's not.

@kcrisman
Copy link
Member Author

comment:2

Wait, they don't have preparsing? Then ... why "s"pyx? WTH?

@jdemeyer
Copy link

comment:3

Replying to @kcrisman:

Wait, they don't have preparsing?

No.

@kcrisman
Copy link
Member Author

comment:4

Then I guess a good way to document this would be to either deprecate them (this would have to be discussed on sage-devel though, maybe ask William too if he introduced them) or to make it really clear in lots of places where one might encounter them that there is zero difference with .pyx. I'm still baffled by this ... Maybe when SageX was originally founded the idea was that .pyx would stay for old-style Pyrex files but that was abandoned, I'm just guessing. Robert Bradshaw might know more.

@jdemeyer
Copy link

comment:5

I was mostly right but not 100%: there is one difference between .spyx and .pyx files: when running a command like

$ sage --cython somefile.spyx

Sage will add some .pxi includes to the Cython sources and set some Sage-specific flags.

Within Sage itself, doing cython("somefile.spyx"), there is no difference. When executing a Cython file by running sage somefile.spyx, there is also no difference.

In my opinion, sage --cython should just run plain Cython. Related: #22805

@jdemeyer
Copy link

comment:6

Just reformulating my last comment, I can think of 3 ways to run Cython in a Sage environment:

  1. Within Sage, load("foo.spyx"): compiles and executes the file

  2. sage foo.spyx: compiles and executes the file

  3. sage --cython foo.spyx: only runs Cython on the file

Only 3 makes a difference between .spyx and .pyx files. I suggest to deprecate this. More precisely, keep the current behaviour but deprecate sage --cython foo.spyx (but not sage --cython foo.pyx which just runs Cython).

@jdemeyer
Copy link

Author: Jeroen Demeyer

@jdemeyer

This comment has been minimized.

@jdemeyer jdemeyer changed the title Improve spyx documentation Deprecate sage --cython foo.spyx May 25, 2017
@jdemeyer
Copy link

@jdemeyer
Copy link

New commits:

6984666Deprecate sage --cython foo.spyx

@jdemeyer
Copy link

Commit: 6984666

@jdemeyer

This comment has been minimized.

@jdemeyer

This comment has been minimized.

@videlec
Copy link
Contributor

videlec commented Jul 14, 2017

comment:13

What about Sage specific %runfile and %attach?

@jdemeyer
Copy link

comment:14

Replying to @videlec:

What about Sage specific %runfile and %attach?

What do you mean; what is your question?

@videlec
Copy link
Contributor

videlec commented Jul 14, 2017

comment:15

Replying to @jdemeyer:

Replying to @videlec:

What about Sage specific %runfile and %attach?

What do you mean; what is your question?

These are two other ways of running Cython code in Sage that were not mentioned.

@jdemeyer
Copy link

comment:16

Replying to @videlec:

These are two other ways of running Cython code in Sage that were not mentioned.

Right: %runfile and %attach are essentially just wrappers around load(). So they also treat .spyx files and .pyx files the same.

@jdemeyer
Copy link

jdemeyer commented Sep 7, 2017

comment:17

ping

@jpflori
Copy link

jpflori commented Sep 7, 2017

Reviewer: Jean-Pierre Flori

@jpflori
Copy link

jpflori commented Sep 7, 2017

comment:18

Looks ok.

@vbraun
Copy link
Member

vbraun commented Sep 10, 2017

Changed branch from u/jdemeyer/deprecate_sage___cython_foo_spyx to 6984666

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

5 participants