Skip to content

Commit

Permalink
Trac #27171: Move file src/bin/sage-maxima.lisp, used by sage at impo…
Browse files Browse the repository at this point in the history
…rt time, to live inside the package

Non-binary files that are part of the sage sources and needed by the
sage package at import time should be installed in the package, using
`package_data` in `setup.py`.  See e.g.
https://trac.sagemath.org/ticket/27040#comment:48

URL: https://trac.sagemath.org/27171
Reported by: embray
Ticket author(s): Matthias Koeppe
Reviewer(s): François Bissey
  • Loading branch information
Release Manager committed Jul 9, 2020
2 parents ed49c85 + da05b3c commit 2fb40d2
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions src/sage/interfaces/maxima.py
Expand Up @@ -522,10 +522,10 @@ def __init__(self, script_subdirectory=None, logfile=None, server=None,
# setting inchar and outchar..
eval_using_file_cutoff = 256
self.__eval_using_file_cutoff = eval_using_file_cutoff
STARTUP = os.path.join(SAGE_LOCAL,'bin','sage-maxima.lisp')
STARTUP = os.path.join(os.path.dirname(__file__), 'sage-maxima.lisp')

if not os.path.exists(STARTUP):
raise RuntimeError('You must get the file local/bin/sage-maxima.lisp')
raise RuntimeError('You must get the file sage-maxima.lisp')

#self.__init_code = init_code
if init_code is None:
Expand Down Expand Up @@ -553,7 +553,7 @@ def __init__(self, script_subdirectory=None, logfile=None, server=None,
init_code = init_code,
logfile = logfile,
eval_using_file_cutoff=eval_using_file_cutoff)
# Must match what is in the file local/bin/sage-maxima.lisp
# Must match what is in the file sage-maxima.lisp
self._display_prompt = '<sage-display>'
# See #15440 for the importance of the trailing space
self._output_prompt_re = re.compile(r'\(\%o[0-9]+\) ')
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion src/setup.py
Expand Up @@ -87,6 +87,7 @@
packages = python_packages,
package_data = {
'sage.libs.gap': ['sage.gaprc'],
'sage.interfaces': ['sage-maxima.lisp'],
'sage.doctest': ['tests/*'],
'sage': ['ext_data/*',
'ext_data/kenzo/*',
Expand Down Expand Up @@ -148,7 +149,6 @@
'bin/sage-inline-fortran',
'bin/sage-ipynb2rst',
'bin/sage-ipython',
'bin/sage-maxima.lisp',
'bin/sage-native-execute',
'bin/sage-notebook',
'bin/sage-num-threads.py',
Expand Down

0 comments on commit 2fb40d2

Please sign in to comment.