Skip to content
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

Changed pyproject to configure docs #8

Merged
merged 16 commits into from
Jul 30, 2024
Merged
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
20 changes: 13 additions & 7 deletions .github/workflows/sphinx-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,16 @@ jobs:
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Build HTML
uses: ammaraskar/sphinx-action@master
- name: Install Python
uses: actions/setup-python@v5
with:
docs-folder: "docs/"
python-version: "3.12"
- name: Install Poetry
uses: abatilo/actions-poetry@v2
- name: Install the project dependencies
run: poetry install --only=docs
- name: Build HTML
run: cd docs && poetry run -- make html
- name: Upload artifacts
uses: actions/upload-pages-artifact@v3
with:
Expand All @@ -51,10 +57,10 @@ jobs:
runs-on: ubuntu-latest
needs: build
steps:
#- name: Checkout
# uses: actions/checkout@v4
#- name: Setup Pages
# uses: actions/configure-pages@v5
- name: Checkout
uses: actions/checkout@v4
- name: Setup Pages
uses: actions/configure-pages@v5
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
2 changes: 1 addition & 1 deletion docs/make.bat
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set BUILDDIR=_build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
Expand Down
1 change: 0 additions & 1 deletion docs/requirements.txt

This file was deleted.

60 changes: 2 additions & 58 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,59 +1,3 @@
import os
import sys
from sphinx_pyproject import SphinxConfig

sys.path.insert(0, os.path.abspath("../../"))
# 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 -----------------------------------------------------

project = "dfttools"
copyright = "2024, Lukas Hoermann, Dylan Morgan"
author = "Lukas Hoermann, Dylan Morgan"


# The full version, including alpha/beta/rc tags
release = "00.00.01"


# -- 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 = ["sphinx.ext.autodoc", "sphinx.ext.viewcode", "sphinx.ext.napoleon"]

# 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 = "furo"

# 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"]
config = SphinxConfig("../../pyproject.toml", globalns=globals(), style="poetry")
169 changes: 164 additions & 5 deletions poetry.lock

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

24 changes: 23 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,34 @@ optional = true

[tool.poetry.group.docs.dependencies]
sphinx = "^7.4.7"
furo = "^2024.7.18"
piccolo-theme = "^0.23.0"
sphinx-pyproject = "^0.3.0"
myst-parser = "^3.0.1"
sphinx-rtd-theme = "^2.0.0"

[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.sphinx-pyproject]
project = "dfttools"
author = "Lukas Hoermann, Dylan Morgan"
copyright = "2024, Lukas Hoermann, Dylan Morgan"
# html_theme = "piccolo_theme"
html_theme = "sphinx_rtd_theme"
extensions = [
"sphinx.ext.autodoc",
"sphinx.ext.viewcode",
"sphinx.ext.napoleon",
"myst_parser",
]
templates_path = ["_templates",]
html_static_path = ["_static",]
exclude_patterns = [
"build",
".DS_Store",
]

[tool.pytest.ini_options]
pythonpath = "dfttools"
testpaths = ["tests"]
Expand Down
Loading