Skip to content

Start using sage-package to factor out common stuff #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
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
24 changes: 5 additions & 19 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,12 @@
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
extensions = [ # Maybe some more of this could be moved to sage-package
#'sphinx.ext.autodoc',
'sage_autodoc',
'sphinx.ext.doctest',
'sphinx.ext.todo',
'sphinx.ext.coverage',
'sphinx.ext.mathjax',
'sphinx.ext.extlinks',
'sage_package.sphinx',
]

# Add any paths that contain templates here, relative to this directory.
Expand Down Expand Up @@ -117,34 +115,22 @@
# If true, keep warnings as "system message" paragraphs in the built documents.
#keep_warnings = False

pythonversion = sys.version.split(' ')[0]
# Python and Sage trac ticket shortcuts. For example, :trac:`7549` .
extlinks = {
'python': ('https://docs.python.org/release/'+pythonversion+'/%s', ''),
'trac': ('http://trac.sagemath.org/%s', 'trac ticket #'),
'wikipedia': ('https://en.wikipedia.org/wiki/%s', 'Wikipedia article '),
'arxiv': ('http://arxiv.org/abs/%s', 'Arxiv '),
'oeis': ('https://oeis.org/%s', 'OEIS sequence '),
'doi': ('https://dx.doi.org/%s', 'doi:'),
'mathscinet': ('http://www.ams.org/mathscinet-getitem?mr=%s', 'MathSciNet ')
}

# -- Options for HTML output ----------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
html_theme = 'default'
# html_theme = 'default'

# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
html_theme_options = {}
# html_theme_options = {}


# Add any paths that contain custom themes here, relative to this directory.
#html_theme_path = []
#html_theme_path = [os.path.join(SAGE_DOC_SRC, 'common', 'themes')]
html_theme_path = [os.path.join(SAGE_DOC_SRC, 'common', 'themes', 'sage')]
#html_theme_path = [os.path.join(SAGE_DOC_SRC, 'common', 'themes', 'sage')]

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
Expand Down
5 changes: 3 additions & 2 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,13 @@ Sage Sample Package

This is a sample reference manual for a SageMath package.

To use this module, you need to import it::
To use this module, you need to import it::

from sage_sample import *

This reference shows a minimal example of documentation of the
Sage sample package following SageMath guidelines.
Sage sample package following
:ref:`SageMath guidelines <chapter-code-basics>`.

This work is licensed under a `Creative Commons Attribution-Share Alike
3.0 License`__.
Expand Down
17 changes: 7 additions & 10 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,12 @@
import sys
from setuptools import setup
from codecs import open # To open the README file with proper encoding
from setuptools.command.test import test as TestCommand # for tests


# Get information from separate files (README, VERSION)
def readfile(filename):
with open(filename, encoding='utf-8') as f:
return f.read()

# For the tests
class SageTest(TestCommand):
def run_tests(self):
errno = os.system("sage -t --force-lib sage_sample")
if errno != 0:
sys.exit(1)

setup(
name = "sage_sample",
version = readfile("VERSION"), # the VERSION file is shared with the documentation
Expand All @@ -41,5 +32,11 @@ def run_tests(self):
], # classifiers list: https://pypi.python.org/pypi?%3Aaction=list_classifiers
keywords = "SageMath packaging",
packages = ['sage_sample'],
cmdclass = {'test': SageTest} # adding a special setup command for tests
setup_requires = ['sage-package'],
install_requires = ['sage-package', 'sphinx'],
entry_points = {
"distutils.commands": [
"test = sage_package.setuptools:SageTest",
],
}
)