Skip to content

Commit

Permalink
setup.py: Remove API checks for ancient Sage versions
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias Koeppe committed Jun 30, 2024
1 parent ded7063 commit 679b9be
Showing 1 changed file with 2 additions and 25 deletions.
27 changes: 2 additions & 25 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,31 +57,8 @@ def readfile(filename):
extra_compile_args=['-std=c++11'])
]


## SageMath 8.1 (included in Ubuntu bionic 18.04 LTS) does not have sage.cpython.string;
## it was introduced in 8.2.
compile_time_env = {'HAVE_SAGE_CPYTHON_STRING': False,
'HAVE_ADD_COL_UNTYPED_ARGS': False}

print("Checking whether HAVE_SAGE_CPYTHON_STRING...", file=sys.stderr)
try:
import sage.cpython.string
compile_time_env['HAVE_SAGE_CPYTHON_STRING'] = True
except ImportError:
pass

## SageMath 8.7 changed the signature of add_col.
print("Checking whether HAVE_ADD_COL_UNTYPED_ARGS...", file=sys.stderr)
try:
cythonize(Extension('check_add_col_untyped_args',
sources=['check_add_col_untyped_args.pyx'],
include_dirs=sage_include_directories()),
quiet=True,
include_path=sys.path)
compile_time_env['HAVE_ADD_COL_UNTYPED_ARGS'] = True
except CompileError:
pass

compile_time_env = {'HAVE_SAGE_CPYTHON_STRING': True,
'HAVE_ADD_COL_UNTYPED_ARGS': True}
print("Using compile_time_env: {}".format(compile_time_env), file=sys.stderr)

setup(
Expand Down

0 comments on commit 679b9be

Please sign in to comment.