Skip to content
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
56 changes: 56 additions & 0 deletions .github/workflows/run_build_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Workflow for building Sphinx docs and deploying to GH Pages
name: Build Sphinx docs and deploy to GH Pages

on:
pull_request:
branches: [main]
workflow_dispatch:
inputs:
branch:
description: Branch to build docs for
required: true
default: main

# Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
permissions:
contents: read
pages: write
id-token: write

# Allow only one concurrent deployment, cancelling in-progress runs.
concurrency:
group: pages
cancel-in-progress: true

jobs:
build:
runs-on: ubuntu-latest
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server."
- run: echo "Running on branch ${{ github.ref }} of repository ${{ github.repository }}."
- name: Check out repository code.
uses: actions/checkout@v3
- name: Python environment setup
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: Install dependencies.
run: |
sudo apt-get update
sudo apt-get install libsfml-dev
git submodule sync
git submodule update --init --recursive
python -m pip install -U pip poetry
poetry install --with=docs
- name: Build Sphinx docs
run: poetry run sphinx-build -b html ${{ github.workspace }}/docs/source ${{ github.workspace }}/docs/build/html
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Upload artifact
uses: actions/upload-pages-artifact@v1
with:
path: ./docs/build/html # Upload HTML docs only
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -51,5 +51,8 @@ configs.json
# poetry
poetry.lock

# Static doc files
!docs/source/_static/*

# wandb
wandb
23 changes: 23 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,30 @@ repos:
args: [--autofix, --no-sort]
- id: pretty-format-yaml
args: [--autofix]
- repo: https://github.com/mwouts/jupytext
rev: v1.15.2
hooks:
- id: jupytext
args: [--from, ipynb, --to, md:myst, --sync]
- repo: https://github.com/nbQA-dev/nbQA
rev: 1.7.0
hooks:
- id: nbqa-pyupgrade
args: [--py310-plus]
- id: nbqa-black
args: [--line-length=120]
- id: nbqa-isort
args: [--profile=black]
- id: nbqa-flake8
args: [--max-line-length=120, --extend-ignore=E203]
- repo: local
hooks:
- id: pylint
name: pylint
entry: poetry run pylint
language: system
types: [python]
exclude: ^docs/.*
- id: poetry-export-requirements
name: poetry-export-requirements
entry: poetry export --without-hashes --with=main,research -f requirements.txt -o requirements.txt
Expand All @@ -64,3 +81,9 @@ repos:
language: system
types: [python]
pass_filenames: false
- id: poetry-export-requirements-docs
name: poetry-export-requirements-docs
entry: poetry export --without-hashes --only docs -f requirements.txt -o requirements.docs.txt
language: system
types: [python]
pass_filenames: false
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
Loading