From a2a2a0a48034e23ee3d956267dccdd6a225f0058 Mon Sep 17 00:00:00 2001 From: Stefan Mauerberger <mauerber@uni-potsdam.de> Date: Sun, 12 Jul 2020 07:44:37 +0200 Subject: [PATCH] Initial import of an empty Sphinx documentation --- .gitlab-ci.yml | 10 ++++++++ docs/conf.py | 51 +++++++++++++++++++++++++++++++++++++++ docs/index.rst | 16 +++++++++++++ setup.py | 65 ++++++++++++++++++++++++++++---------------------- 4 files changed, 114 insertions(+), 28 deletions(-) create mode 100644 .gitlab-ci.yml create mode 100644 docs/conf.py create mode 100644 docs/index.rst diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml new file mode 100644 index 0000000..32c51aa --- /dev/null +++ b/.gitlab-ci.yml @@ -0,0 +1,10 @@ +pages: + stage: deploy + script: + - python3 setup.py build_sphinx + - mv build/sphinx/html public + artifacts: + paths: + - public + only: + - docs diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000..307a5e0 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,51 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +#import os +#import sys +#sys.path.insert(0, os.path.abspath('../')) + +# -- Project information ----------------------------------------------------- + +# Sphinx's options are specified by setup.py +#project = 'pymagglobal' +#copyright = '2020 Helmholtz Centre Potsdam GFZ, German Research Centre for Geosciences, Potsdam, Germany' +## The full version, including alpha/beta/rc tags +#release = '0.0.2' +# Due to some reason not set by setup.py +author = 'Schanner, M.A. and Mauerberger, S.' + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] + +# -- 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 = 'classic' + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000..092fa6b --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,16 @@ +Welcome to pymagglobal's documentation! +======================================= + +Nothing here yet ... + +.. toctree:: + :maxdepth: 2 + :caption: Contents: + + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/setup.py b/setup.py index c1cdfdf..f842d00 100644 --- a/setup.py +++ b/setup.py @@ -1,31 +1,30 @@ -''' - This is the install file for pymagglobal. - - Copyright (C) 2020 Helmholtz Centre Potsdam GFZ, - German Research Centre for Geosciences, Potsdam, Germany - - Cite as: - TODO - - This file is part of pymagglobal. - - pymagglobal is free software: you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - pymagglobal is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with pymagglobal. If not, see <https://www.gnu.org/licenses/>. -''' +# This is the install file for pymagglobal. +# +# Copyright (C) 2020 Helmholtz Centre Potsdam GFZ, +# German Research Centre for Geosciences, Potsdam, Germany +# +# Cite as: +# TODO +# +# This file is part of pymagglobal. +# +# pymagglobal is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# pymagglobal is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with pymagglobal. If not, see <https://www.gnu.org/licenses/>. import os import codecs from setuptools import setup +from sphinx.setup_command import BuildDoc # https://packaging.python.org/guides/single-sourcing-package-version/ @@ -43,12 +42,14 @@ def get_version(rel_path): else: raise RuntimeError("Unable to find version string.") - -description = ''' python interface for global geomagnetic field models ''' +name = 'pymagglobal' +version = get_version('pymagglobal/__init__.py') +description = '''python interface for global geomagnetic field models ''' +copyright = '2020 Helmholtz Centre Potsdam GFZ, German Research Centre for Geosciences, Potsdam, Germany' setup( - name='pymagglobal', - version=get_version('pymagglobal/__init__.py'), + name=name, + version=version, author='Maximilian Schanner', author_email='arthus@gfz-potsdam.de', packages=['pymagglobal'], @@ -58,4 +59,12 @@ setup( install_requires=[], package_data={'pymagglobal': ['dat/*']}, include_package_data=True, + cmdclass={'build_sphinx': BuildDoc}, + # Override docs/conf.py settings + command_options={ + 'build_sphinx': { + 'project': ('dfetup.py', name), + 'release': ('dfetup.py', version), + 'copyright': ('dfetup.py', copyright), + 'source_dir': ('dfetup.py', 'docs')}}, ) -- GitLab