Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
build/pkgs/sage_setup_docbuild: New
Browse files Browse the repository at this point in the history
  • Loading branch information
mkoeppe committed Jul 13, 2020
1 parent 72c5040 commit ce79954
Show file tree
Hide file tree
Showing 13 changed files with 83 additions and 1 deletion.
2 changes: 1 addition & 1 deletion build/make/Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ base: $(inst_patch) $(inst_pkgconf)
# Building the documentation has many dependencies, because all
# documented modules are imported and because we use matplotlib to
# produce plots.
DOC_DEPENDENCIES = sagelib $(inst_sphinx) \
DOC_DEPENDENCIES = sagelib sage_setup_docbuild $(inst_sphinx) \
| $(SAGERUNTIME) $(inst_maxima) $(inst_networkx) $(inst_scipy) $(inst_sympy) \
$(inst_matplotlib) $(inst_pillow) $(inst_mathjax) $(inst_mpmath) \
$(inst_ipykernel) $(inst_jupyter_client) $(inst_conway_polynomials) \
Expand Down
1 change: 1 addition & 0 deletions build/pkgs/sage_setup_docbuild/dependencies
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$(PYTHON) sagelib sphinx six | $(PYTHON_TOOLCHAIN)
1 change: 1 addition & 0 deletions build/pkgs/sage_setup_docbuild/package-version.txt
6 changes: 6 additions & 0 deletions build/pkgs/sage_setup_docbuild/spkg-install
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
#!/usr/bin/env bash
cd src
. sage-dist-helpers
# We install directly with setuptools, not with pip, because pip does not handle our symlinks correctly.
# An alternative would be to build an sdist and then to install the sdist using pip.
sage-python23 -u setup.py --no-user-cfg install --single-version-externally-managed --root=/
21 changes: 21 additions & 0 deletions build/pkgs/sage_setup_docbuild/spkg-src
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_setup
# This script is not used during build.
#
# HOW TO MAKE THE TARBALL:
# ./sage --sh build/pkgs/sage_setup_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_setup_docbuild

cd src
sage-python23 -u setup.py --no-user-cfg sdist --dist-dir "$SAGE_DISTFILES"
3 changes: 3 additions & 0 deletions build/pkgs/sage_setup_docbuild/src/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# sage_setup.docbuild #

This is the build system of the Sage documentation, based on sphinx.
3 changes: 3 additions & 0 deletions build/pkgs/sage_setup_docbuild/src/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#sage
sphinx
six
1 change: 1 addition & 0 deletions build/pkgs/sage_setup_docbuild/src/sage_setup/docbuild
8 changes: 8 additions & 0 deletions build/pkgs/sage_setup_docbuild/src/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
[metadata]
name = sage_setup.docbuild
description = Sage: Open Source Mathematics Software: Build system of the Sage documentation
long_description = file: README.md
license = GNU General Public License (GPL) v2 or later
author = The Sage Developers
author_email = https://groups.google.com/group/sage-support
url = https://www.sagemath.org
7 changes: 7 additions & 0 deletions build/pkgs/sage_setup_docbuild/src/setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#!/usr/bin/env python

from setuptools import setup, find_namespace_packages

setup(
packages=find_namespace_packages()
)
30 changes: 30 additions & 0 deletions build/pkgs/sage_setup_docbuild/src/tox.ini
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_setup_docbuild/src && tox)'
#
# To test interactively:
#
# build/pkgs/sage_setup_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_setup.docbuild'

# TODO: Add tests after adding the dependency on sagelib to
# requirements.txt
1 change: 1 addition & 0 deletions build/pkgs/sage_setup_docbuild/type
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
standard
Empty file removed src/sage_setup/__init__.py
Empty file.

0 comments on commit ce79954

Please sign in to comment.