Skip to content

Commit

Permalink
Trac #27041: Remove deprecated stuff related to Cython
Browse files Browse the repository at this point in the history
Remove deprecations from #22698, #22805, #23855, #24105.

Deprecate the script `src/bin/sage-cython`.

URL: https://trac.sagemath.org/27041
Reported by: jdemeyer
Ticket author(s): Jeroen Demeyer
Reviewer(s): Erik Bray
  • Loading branch information
Release Manager authored and vbraun committed Jan 27, 2019
2 parents 2258aca + 108a42e commit 7d0fc20
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 417 deletions.
19 changes: 8 additions & 11 deletions src/bin/sage-cython
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
#!/usr/bin/env python

# This script is a deprecated wrapper around the "cython" program.
# It is deprecated since Trac #27041 (Sage 8.7) because one should
# simply use "cython" directly. We display deprecation messages whenever
# "sage-cython" does something different from plain "cython".

import os
import sys
args = sys.argv[1:]
Expand All @@ -12,24 +17,16 @@ SAGE_SRC = os.environ["SAGE_SRC"]
pyx_file = os.path.abspath(args[-1]) if len(args) else None
include_sage_flags = False

if pyx_file and pyx_file.endswith('.spyx'):
sys.stderr.write("WARNING: running sage --cython on .spyx files is deprecated, use the .pyx extension instead\n")
spyx_file = pyx_file
pyx_file = pyx_file[:-5] + '.pyx'
args[-1] = pyx_file
f = open(pyx_file, 'w')
f.write("include 'sage/ext/stdsage.pxi'\ninclude 'sage/ext/cdefs.pxi'\ninclude 'cysignals/signals.pxi'\n\n")
f.write(open(spyx_file).read())
f.close()
include_sage_flags = True

if pyx_file and pyx_file.startswith(SAGE_SRC):
sys.stderr.write("WARNING: in the future, sage --cython will not add special flags for files in Sage sources.\n")
include_sage_flags = True

if '-sage' in args:
sys.stderr.write("WARNING: sage --cython -sage is deprecated.\n")
include_sage_flags = True
args.remove('-sage')
elif '-no-sage' in args:
sys.stderr.write("WARNING: sage --cython -no-sage is deprecated, remove the -no-sage flag.\n")
include_sage_flags = False
args.remove('-no-sage')

Expand Down
20 changes: 0 additions & 20 deletions src/sage/ext/cdefs.pxi

This file was deleted.

34 changes: 0 additions & 34 deletions src/sage/ext/stdsage.pxi

This file was deleted.

Loading

0 comments on commit 7d0fc20

Please sign in to comment.