Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 0 additions & 78 deletions build/bin/sage-bootstrap-python

This file was deleted.

2 changes: 1 addition & 1 deletion build/bin/sage-build-num-threads
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sage-bootstrap-python
#!/usr/bin/env python3
#
# Determine the number of threads to be used by Sage.
#
Expand Down
2 changes: 1 addition & 1 deletion build/bin/sage-download-file
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sage-bootstrap-python
#!/usr/bin/env python3

# USAGE:
#
Expand Down
2 changes: 1 addition & 1 deletion build/bin/sage-flock
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sage-bootstrap-python
#!/usr/bin/env python3
# vim: set filetype=python:

# USAGE:
Expand Down
2 changes: 1 addition & 1 deletion build/bin/sage-print-system-package-command
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ function print_shell_command()
if [ -z "$WRAP" -o $# -lt 6 ]; then
echo "${PROMPT}${quoted}"
else
sage-bootstrap-python -c "import textwrap; print(' \\\\\n'.join(textwrap.wrap(r'''${quoted}''', $WRAP, initial_indent=r'''${PROMPT}''', subsequent_indent=r'''${CONTINUATION}''', break_long_words=False, break_on_hyphens=False)))"
python3 -c "import textwrap; print(' \\\\\n'.join(textwrap.wrap(r'''${quoted}''', $WRAP, initial_indent=r'''${PROMPT}''', subsequent_indent=r'''${CONTINUATION}''', break_long_words=False, break_on_hyphens=False)))"
fi
if [ -n "$OUTPUT_RST" ]; then
echo
Expand Down
2 changes: 1 addition & 1 deletion build/bin/sage-spkg-installcheck
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sage-bootstrap-python
#!/usr/bin/env python3

# usage: sage-spkg-installcheck [-h] PKG [SAGE_LOCAL]
#
Expand Down
2 changes: 1 addition & 1 deletion build/bin/sage-spkg-uninstall
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sage-bootstrap-python
#!/usr/bin/env python3

# usage: sage-spkg-uninstall [-h] PKG [SAGE_LOCAL]
#
Expand Down
2 changes: 1 addition & 1 deletion build/bin/sage-uncompress-spkg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sage-bootstrap-python
#!/usr/bin/env python3

# usage: sage-uncompress-spkg [-h] [-d DIR] PKG [FILE]
#
Expand Down
11 changes: 2 additions & 9 deletions build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ SPKG_INST_RELDIR = var/lib/sage/installed

# Aliases for mutually exclusive standard packages selected at configure time
TOOLCHAIN = @SAGE_TOOLCHAIN@
PYTHON = python3
MP_LIBRARY = gmp
BLAS = openblas

Expand Down Expand Up @@ -221,12 +220,7 @@ ifneq ($(PYTHON_FOR_VENV),)
# 3 only). $(PYTHON) is set in Makefile to python3_venv.
# Thus $(inst_python3_venv) will an (order-only) dependency of every Python package.
#
# TODO: If we reconfigure to build our own Python after having used the system
# Python, files installed to create the virtualenv should be *removed*. That
# could either be done here by the makefile, or in an spkg-preinst for python3
ifeq ($(PYTHON),python3)
PYTHON = python3_venv
endif
inst_python3_venv = $(SAGE_VENV)/$(SPKG_INST_RELDIR)/python3_venv-3.$(PYTHON_MINOR)-$(subst /,-,$(PYTHON_FOR_VENV))$(findstring --system-site-packages,$(SAGE_VENV_FLAGS))

$(SAGE_VENV)/$(SPKG_INST_RELDIR):
Expand Down Expand Up @@ -313,9 +307,8 @@ all-toolchain: base-toolchain
PYTHON_TOOLCHAIN = setuptools pip setuptools_scm wheel flit_core hatchling python_build meson_python

# Issue #32056: Avoid installed setuptools leaking into the build of python3 by uninstalling it.
# It will have to be reinstalled anyway because of its dependency on $(PYTHON).
python3-SAGE_LOCAL-no-deps: setuptools-clean
python3-SAGE_VENV-no-deps: setuptools-clean
# python3-SAGE_LOCAL-no-deps: setuptools-clean
# python3-SAGE_VENV-no-deps: setuptools-clean

# Everything needed to start up Sage using "./sage". Of course, not
# every part of Sage will work. It does not include Maxima for example.
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/appnope/spkg-install.in
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
cd src

# Only install this package on OS X
if sage-bootstrap-python -c 'from sys import *; exit(0 if platform == "darwin" else 1)'; then
if python3 -c 'from sys import *; exit(0 if platform == "darwin" else 1)'; then
sdh_pip_install .
else
echo "Not OS X, skipping installation of package 'appnope'"
Expand Down
1 change: 0 additions & 1 deletion build/pkgs/database_stein_watkins_mini/spkg-install.in

This file was deleted.

16 changes: 16 additions & 0 deletions build/pkgs/database_stein_watkins_mini/spkg-install.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# spkg-install file for
# * database_stein_watkins
# * database_stein_watkins_mini

if [ -z "$SAGE_SHARE" ]; then
echo >&2 "SAGE_SHARE undefined ... exiting"
echo >&2 "Maybe run 'sage --sh'?"
exit 1
fi

TARGET="${SAGE_SHARE}/stein_watkins"
if [ ! -d "${TARGET}" ]; then
mkdir "${TARGET}"
fi

exec cp -R src/swdb/* "${TARGET}/"
2 changes: 1 addition & 1 deletion build/pkgs/openblas/spkg-install.in
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ cd src
# OpenBLAS does not build on 32bit Haswell. Upstream suggests to pass BINARY=32 to default to NEHALEM kernels
# See https://github.com/xianyi/OpenBLAS/issues/657
# Right now this affect all 32bit CPUs.
if [ `sage-bootstrap-python -c "from __future__ import print_function; import platform; print(platform.architecture()[0])"` = "32bit" ]; then
if [ `python3 -c "from __future__ import print_function; import platform; print(platform.architecture()[0])"` = "32bit" ]; then
echo >&2 "Building a 32bit version of OpenBLAS."
OPENBLAS_CONFIGURE="$OPENBLAS_CONFIGURE BINARY=32"
fi
Expand Down
2 changes: 1 addition & 1 deletion build/pkgs/openblas/write_pc_file.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sage-bootstrap-python
#!/usr/bin/env python3


TEMPLATE = """
Expand Down
1 change: 0 additions & 1 deletion build/pkgs/sage_docbuild/spkg-install.in

This file was deleted.

9 changes: 9 additions & 0 deletions build/pkgs/sage_docbuild/spkg-install.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
cd src
if [ "$SAGE_EDITABLE" = yes ]; then
sdh_pip_editable_install .
if [ "$SAGE_WHEELS" = yes ]; then
sdh_build_and_store_wheel --no-isolation .
fi
else
sdh_pip_install .
fi
1 change: 0 additions & 1 deletion build/pkgs/sagemath_categories/spkg-install.in

This file was deleted.

10 changes: 10 additions & 0 deletions build/pkgs/sagemath_categories/spkg-install.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cd src

export PIP_NO_INDEX=true
export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS"

# First build the sdist, then build the wheel from the sdist.
# https://pypa-build.readthedocs.io/en/latest/#python--m-build
# (Important because sagemath-objects uses MANIFEST.in for filtering.)
# Do not install the wheel.
sdh_build_and_store_wheel --sdist-then-wheel .
1 change: 0 additions & 1 deletion build/pkgs/sagemath_environment/spkg-install.in

This file was deleted.

10 changes: 10 additions & 0 deletions build/pkgs/sagemath_environment/spkg-install.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cd src

export PIP_NO_INDEX=true
export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS"

# First build the sdist, then build the wheel from the sdist.
# https://pypa-build.readthedocs.io/en/latest/#python--m-build
# (Important because sagemath-objects uses MANIFEST.in for filtering.)
# Do not install the wheel.
sdh_build_and_store_wheel --sdist-then-wheel .
1 change: 0 additions & 1 deletion build/pkgs/sagemath_repl/spkg-install.in

This file was deleted.

10 changes: 10 additions & 0 deletions build/pkgs/sagemath_repl/spkg-install.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
cd src

export PIP_NO_INDEX=true
export PIP_FIND_LINKS="file://$SAGE_SPKG_WHEELS"

# First build the sdist, then build the wheel from the sdist.
# https://pypa-build.readthedocs.io/en/latest/#python--m-build
# (Important because sagemath-objects uses MANIFEST.in for filtering.)
# Do not install the wheel.
sdh_build_and_store_wheel --sdist-then-wheel .
4 changes: 2 additions & 2 deletions build/sage_bootstrap/creator.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,9 @@ def set_python_data_and_scripts(self, pypi_package_name=None, source='normal', d
else:
dependencies = ''
if source == 'wheel':
dependencies_order_only = 'pip $(PYTHON)'
dependencies_order_only = 'pip'
else:
dependencies_order_only = '$(PYTHON_TOOLCHAIN) $(PYTHON)'
dependencies_order_only = '$(PYTHON_TOOLCHAIN)'
f.write(dependencies + ' | ' + dependencies_order_only + '\n\n')
f.write('----------\nAll lines of this file are ignored except the first.\n')
if source == 'normal':
Expand Down
2 changes: 1 addition & 1 deletion build/sage_bootstrap/expand_class.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ def include_recursive_dependencies(names, package_name):
pkg = Package(package_name)
except FileNotFoundError:
# Silently ignore unknown packages,
# substitutions such as $(BLAS) $(PYTHON),
# substitutions such as $(BLAS)
# and optional dependencies of the form $(find-string ...).
return
names.add(package_name)
Expand Down
2 changes: 1 addition & 1 deletion build/sage_bootstrap/flock.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sage-bootstrap-python
#!/usr/bin/env python3
# vim: set filetype=python:
"""
This script runs the given command under a file lock (similar to the flock
Expand Down
4 changes: 2 additions & 2 deletions build/setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sage-bootstrap-python
#!/usr/bin/env python3

from distutils.core import setup

Expand All @@ -12,7 +12,7 @@
'sage_bootstrap.download',
'sage_bootstrap.compat'
],
scripts=['bin/sage-package', 'bin/sage-download-file', 'bin/sage-bootstrap-python'],
scripts=['bin/sage-package', 'bin/sage-download-file'],
version='1.0',
url='https://www.sagemath.org',
)
2 changes: 1 addition & 1 deletion build/test/runnable.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/usr/bin/env sage-bootstrap-python
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Utility to test running with different values for ``SAGE_BOOTSTRAP``
Expand Down
10 changes: 1 addition & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -353,14 +353,6 @@ SAGE_DARWIN_PKG_CONFIG_PATH=
AC_CHECK_HEADER([zlib.h], [],
[AC_MSG_ERROR([cannot find libz headers. $SAGE_PREREQ_URL])])

# Check for system python (bootstrap python for build scripts)
AC_MSG_CHECKING([for Python])
if SAGE_BOOTSTRAP_PYTHON=$(build/bin/sage-bootstrap-python -c "import sys; print(sys.executable)"); then
AC_MSG_RESULT([$SAGE_BOOTSTRAP_PYTHON])
else
AC_MSG_ERROR([You do not have a suitable version of Python installed])
fi

# check for liblzma

PKG_CHECK_MODULES([liblzma], [liblzma], [], [
Expand All @@ -381,7 +373,7 @@ AS_IF([test x"$with_python" = x3], [
AC_MSG_NOTICE([The meaning of the option --with-python has changed in Sage 9.2. Ignoring.])
with_python=''
])
AS_IFbuild/bin/sage-bootstrap-python([test x"$with_python" = x"no"],
AS_IF([test x"$with_python" = x"no"],
[AC_MSG_ERROR([building Sage --without-python is not supported])])

ac_path_PYTHON3="$with_python"
Expand Down
20 changes: 2 additions & 18 deletions src/doc/en/developer/packaging.rst
Original file line number Diff line number Diff line change
Expand Up @@ -325,28 +325,12 @@ Likewise for :envvar:`CXXFLAGS`, :envvar:`FCFLAGS`, and :envvar:`F77FLAGS`.
code should go in a separate file (e.g. ``spkg-install.py``), and can
then be executed from the real ``spkg-install.in`` like:

.. code-block:: text

exec sage-bootstrap-python spkg-install.py

or

.. code-block:: text

exec python3 spkg-install.py

In more detail: ``sage-bootstrap-python`` runs a version of Python
pre-installed on the machine, which is a build prerequisite of Sage.
Note that ``sage-bootstrap-python`` accepts a wide range of Python
versions, Python >= 2.6 and >= 3.4, see :sage_root:`build/tox.ini`
for details. You should only use ``sage-bootstrap-python`` for
installation tasks that must be able to run before Sage has made
``python3`` available. It must not be used for running ``pip`` or
``setup.py`` for any package.

``python3`` runs the version of Python managed by Sage (either its
own installation of Python 3 from an SPKG or a venv over a system
python3. You should use this if you are installing a Python package
``python3`` runs from the venv over a system python3.
You should use this if you are installing a Python package
to make sure that the libraries are installed in the right place.

Many packages currently do not separate the build and install steps and only
Expand Down
Loading