-
-
Notifications
You must be signed in to change notification settings - Fork 514
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trac #30010: Split sage_setup.docbuild out to a separate distribution…
… sage_docbuild `sage_setup.docbuild`, created in #19127, has very different dependencies compared to `sage_setup`: It depends on `sagelib` and `sphinx`, whereas the rest of `sage_setup` is for building `sagelib`. We remove the nesting within `sage_setup`, creating a new top-level package `sage_docbuild`. We split it out as a separate pip-installable distribution package `sage_docbuild`. Using the `spkg-src` script, a pip-installable tarball can be generated, which could be uploaded to PyPI -- for the use by external packages that want to build documentation. This is preparation for #29868 (pip-installable packages sagemath-doc- src, sagemath-doc-inventory, sagemath-doc-html, sagemath-doc-pdf) URL: https://trac.sagemath.org/30010 Reported by: mkoeppe Ticket author(s): Matthias Koeppe Reviewer(s): John Palmieri
- Loading branch information
Showing
28 changed files
with
166 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(PYTHON) sphinx ../pkgs/sage_docbuild/src/sage_docbuild/*.py ../pkgs/sage_docbuild/src/sage_docbuild/ext/*.py | $(PYTHON_TOOLCHAIN) sagelib |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../sagelib/package-version.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
#!/usr/bin/env bash | ||
# From sage-spkg. | ||
# For type=script packages, the build rule in build/make/Makefile sources | ||
# sage-env but not sage-dist-helpers. | ||
lib="$SAGE_ROOT/build/bin/sage-dist-helpers" | ||
source "$lib" | ||
if [ $? -ne 0 ]; then | ||
echo >&2 "Error: failed to source $lib" | ||
echo >&2 "Is $SAGE_ROOT the correct SAGE_ROOT?" | ||
exit 1 | ||
fi | ||
# We build the wheel directly with "setup.py bdist_wheel", not with "pip wheel", | ||
# because pip does not handle our symlinks correctly. | ||
cd src && sdh_setup_bdist_wheel && sdh_store_and_pip_install_wheel . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/usr/bin/env bash | ||
# | ||
# Script to prepare an sdist tarball for sage_docbuild | ||
# This script is not used during build. | ||
# | ||
# HOW TO MAKE THE TARBALL: | ||
# ./sage --sh build/pkgs/sage_docbuild/spkg-src | ||
|
||
if [ -z "$SAGE_ROOT" ] ; then | ||
echo >&2 "Error - SAGE_ROOT undefined ... exiting" | ||
echo >&2 "Maybe run 'sage -sh'?" | ||
exit 1 | ||
fi | ||
|
||
# Exit on failure | ||
set -e | ||
|
||
cd build/pkgs/sage_docbuild | ||
|
||
cd src | ||
python3 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
include VERSION.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
================================================================================ | ||
Sage: Open Source Mathematics Software: Build system of the Sage documentation | ||
================================================================================ | ||
|
||
About SageMath | ||
-------------- | ||
|
||
"Creating a Viable Open Source Alternative to | ||
Magma, Maple, Mathematica, and MATLAB" | ||
|
||
Copyright (C) 2005-2020 The Sage Development Team | ||
|
||
https://www.sagemath.org | ||
|
||
SageMath fully supports all major Linux distributions, recent versions of macOS, and Windows (using Cygwin or Windows Subsystem for Linux). | ||
|
||
The traditional and recommended way to install SageMath is from source via Sage-the-distribution (https://www.sagemath.org/download-source.html). Sage-the-distribution first builds a large number of open source packages from source (unless it finds suitable versions installed in the system) and then installs the Sage Library (sagelib, implemented in Python and Cython). | ||
|
||
|
||
About this pip-installable source distribution | ||
---------------------------------------------- | ||
|
||
This is the build system of the Sage documentation, based on Sphinx. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../package-version.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
#sage | ||
sphinx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
../../../../src/sage_docbuild |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
[metadata] | ||
name = sage_docbuild | ||
version = file: VERSION.txt | ||
description = Sage: Open Source Mathematics Software: Build system of the Sage documentation | ||
long_description = file: README.rst | ||
long_description_content_type = text/x-rst | ||
license = GNU General Public License (GPL) v2 or later | ||
author = The Sage Developers | ||
author_email = sage-support@googlegroups.com | ||
url = https://www.sagemath.org | ||
|
||
classifiers = | ||
Development Status :: 6 - Mature | ||
Intended Audience :: Education | ||
Intended Audience :: Science/Research | ||
License :: OSI Approved :: GNU General Public License v2 or later (GPLv2+) | ||
Operating System :: POSIX | ||
Operating System :: MacOS :: MacOS X | ||
Programming Language :: Python :: 3 :: Only | ||
Programming Language :: Python :: 3.6 | ||
Programming Language :: Python :: 3.7 | ||
Programming Language :: Python :: 3.8 | ||
Programming Language :: Python :: 3.9 | ||
Programming Language :: Python :: Implementation :: CPython | ||
Topic :: Scientific/Engineering :: Mathematics | ||
|
||
[options] | ||
packages = | ||
sage_docbuild | ||
sage_docbuild.ext | ||
|
||
install_requires = | ||
sphinx |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/usr/bin/env python | ||
|
||
from setuptools import setup | ||
|
||
setup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# First pip-install tox: | ||
# | ||
# ./sage -pip install tox | ||
# | ||
# To build and test in the tox environment: | ||
# | ||
# ./sage -sh -c '(cd build/pkgs/sage_docbuild/src && tox)' | ||
# | ||
# To test interactively: | ||
# | ||
# build/pkgs/sage_docbuild/src/.tox/python/bin/python | ||
# | ||
[tox] | ||
|
||
[testenv] | ||
deps = -rrequirements.txt | ||
|
||
setenv = | ||
# Sage scripts like to use $HOME/.sage | ||
HOME={envdir} | ||
|
||
whitelist_externals = | ||
bash | ||
|
||
commands = | ||
# Beware of the treacherous non-src layout. | ||
#python -c 'import sys; "" in sys.path and sys.path.remove(""); import sage_docbuild' | ||
|
||
# TODO: Add tests after adding the dependency on sagelib to | ||
# requirements.txt |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
standard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters