Skip to content
Open
14 changes: 13 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,19 @@
# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []
extensions = [
# built-in extensions
"sphinx.ext.apidoc", # generate API docs
"sphinx.ext.autodoc", # include documentation from docstrings
"sphinx.ext.duration", # show durations in documentation builds
"sphinx.ext.intersphinx", # link to other projects' documentation
"sphinx.ext.mathjax", # render math with MathJax
"sphinx.ext.napoleon", # support numpy and google style docstrings
"sphinx.ext.viewcode", # add links to highlighted source code
# other 3rd party extensions
"notfound.extension", # adds a notfound 404 page
"sphinx_copybutton", # adds a button that enables code to be copied
]

templates_path = ["_templates"]
exclude_patterns = []
Expand Down
2 changes: 2 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,5 @@ documentation for details.
.. toctree::
:maxdepth: 2
:caption: Contents:

utils
11 changes: 11 additions & 0 deletions docs/source/utils.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
.. _utils:

=================
Package utilities
=================

.. module:: pyfaradaycup.utils
.. currentmodule:: pyfaradaycup.utils

.. automodapi:: pyfaradaycup.utils
:noindex:
7 changes: 6 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,12 @@
def tests(session: nox.Session) -> None:
"""Run tests with pytest."""
session.install(".")
session.run("pytest", *session.posargs)

# Test examples in docstrings only using the most recent Python
# because string representations may change.
doctest_options = ["--doctest-modules"] if session.python == MAXPYTHON else []

session.run("pytest", *doctest_options, *session.posargs)


if RUNNING_ON_RTD:
Expand Down
3 changes: 3 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ dependencies = [

[dependency-groups]
dev = [
{ include-group = "docs" },
{ include-group = "lint" },
{ include-group = "nox" },
{ include-group = "test" },
Expand All @@ -40,6 +41,8 @@ test = [
]
docs = [
"sphinx>=9.1",
"sphinx-copybutton>=0.5.2",
"sphinx-notfound-page>=1.1",
]
lint = [
"pre-commit>=4.6.2",
Expand Down
12 changes: 4 additions & 8 deletions src/pyfaradaycup/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
def hello() -> str:
"""Check that docstrings are tested.
"""Faraday cup data pipeline and data analysis tools."""

Examples
--------
>>> 6 * 9
54
"""
return "Hello from pyfaradaycup!"
__all__: list[str] = ["utils"]

from pyfaradaycup import utils
17 changes: 17 additions & 0 deletions src/pyfaradaycup/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
"""Package utilities."""

__all__: list[str] = ["placeholder"]

from typing import Literal


def placeholder() -> Literal[42]:
"""
Run a placeholder function.

Examples
--------
>>> placeholder()
42
"""
return 42
38 changes: 37 additions & 1 deletion uv.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading