Skip to content
Draft
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
.idea # Pycharm related file
*.so
build
docs/_build
docs/.docs_venv
*.egg-info
__pycache__
env
19 changes: 19 additions & 0 deletions docs/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/usr/bin/env bash

if [[ ! -f "../pyproject.toml" ]]; then
echo "WTF"
exit 1
fi

TARGET=singlehtml

python3 -m venv .docs_venv

echo "Installing dependencies"
.docs_venv/bin/pip install sphinx myst_parser

echo "Installing python bindings"
.docs_venv/bin/pip install --force --no-cache ..

echo "Building the website"
.docs_venv/bin/sphinx-build -M ${TARGET} . _build
46 changes: 46 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

import datetime

project = "pyprecice"
author = "The preCICE developers"
copyright = f"{datetime.datetime.now().year}, {author}"

extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"myst_parser",
]

intersphinx_mapping = {
"python": ("https://docs.python.org/3/", None),
"numpy": ("https://numpy.org/doc/stable/", None),
"mpi4py": ("https://mpi4py.readthedocs.io/en/latest/", None),
}

# exclude_patterns = ["_build", "Thumbs.db", ".DS_Store", ".docs_venv"]
include_patterns = ["*.rst", "*.md"]

html_theme = "alabaster"
html_static_path = ["_static"]

source_suffix = {
".rst": "restructuredtext",
".md": "markdown",
}

autodoc_class_signature = "separated"
autodoc_typehints = "description"
autodoc_typehints_format = "short"
autodoc_member_order = "bysource"

suppress_warnings = ["myst.xref_missing"]

# The cython detection relyies on a built and installed version of the package
try:
import precice
except:
raise RuntimeError("Cannot import precice. Please install pyprecice first")
10 changes: 10 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
The preCICE python bindings
===========================

.. toctree::
:maxdepth: 1
:caption: Contents:

precice
MigrationGuide
ReleaseGuide
6 changes: 6 additions & 0 deletions docs/precice.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The pyprecice package
=====================

.. automodule:: cyprecice
:members:
:undoc-members:
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def get_extensions():
extra_compile_args=compile_args,
extra_link_args=link_args,
define_macros=[("NPY_NO_DEPRECATED_API", "NPY_1_7_API_VERSION")],
cython_directives={"embedsignature": True},
)
]

Expand Down