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

Add documentation build steps, move doc dependencies into pyproject.toml #143

Merged
merged 8 commits into from
Feb 12, 2023
Merged
Show file tree
Hide file tree
Changes from 7 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: 1 addition & 1 deletion .github/workflows/alns.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7', '3.8', '3.9', '3.10' ]
python-version: [ '3.8', '3.9', '3.10', '3.11' ]
steps:
- uses: actions/checkout@v3
- name: Set up Python
Expand Down
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ repos:
- id: flake8

- repo: https://github.com/pycqa/isort
rev: 5.10.1
rev: 5.12.0
N-Wouda marked this conversation as resolved.
Show resolved Hide resolved
hooks:
- id: isort

Expand Down
10 changes: 6 additions & 4 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@ build:
os: ubuntu-20.04
tools:
python: "3.9"

python:
install:
- requirements: docs/requirements.txt
commands:
- pip install poetry
- poetry install --with docs
- poetry run make html --directory=docs
- mkdir _readthedocs/
- mv docs/build/html _readthedocs/
14 changes: 14 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Documentation

This directory hosts the documentation.
We use Sphinx for this.
The documentation has a few unique dependencies that are listed in the optional `docs` group in the top-level `pyproject.toml`.
If you want to build the documentation, make sure to install that group (using `poetry install --with docs` or `--only docs`).

The Makefile in this directory can be used to build the documentation.
Running the command `poetry run make help` from this directory provides an overview of the available options.
In particular `poetry run make html` is useful, as that will build the documentation in the exact same way as it will be displayed on readthedocs later.

> Alternatively, one can run `poetry run make html --directory=docs` from the project root as well.

Finally, all Sphinx-related settings are configured in `docs/source/conf.py`.
8 changes: 0 additions & 8 deletions docs/requirements.txt

This file was deleted.

10 changes: 2 additions & 8 deletions docs/source/setup/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,5 @@ This greatly reduces the job of maintaining and releasing the software.
- Each function, class, method, and attribute needs to be documented using docstrings.
We conform to the `NumPy docstring standard <https://numpydoc.readthedocs.io/en/latest/format.html#docstring-standard>`_.
- If you are adding new functionality, you need to add it to the documentation by editing (or creating) the appropriate file in ``docs/source/``.
- Make sure your documentation changes parse correctly. Change into the top-level ``docs/`` directory and type:

.. code-block:: shell

make clean
make html

Check that the build output does not have *any* warnings due to your changes.
- Make sure your documentation changes parse correctly.
See the documentation in the ``docs/`` directory for details on how to build the documentation locally.
16 changes: 15 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ classifiers = [
"Tracker" = "https://github.com/N-Wouda/ALNS/issues"

[tool.poetry.dependencies]
python = "^3.7"
python = "^3.8, <4.0"
numpy = ">=1.15.2"
matplotlib = ">=2.2.0"
N-Wouda marked this conversation as resolved.
Show resolved Hide resolved

Expand All @@ -40,6 +40,20 @@ pytest = ">=6.0.0"
pytest-cov = ">=2.6.1"
codecov = "*"

# This optional docs group is needed to build the documentation. It is not
# required by the package itself.
[tool.poetry.group.docs]
optional = true

[tool.poetry.group.docs.dependencies]
tomli = ">=2.0.1"
nbsphinx = ">=0.8.9"
ipython = ">=8.6.0"
numpydoc = ">=1.5.0"
sphinx_rtd_theme = ">=0.5.1"
sphinx-autoapi = ">=2.0.1"
docutils = "==0.16"

# This optional examples group is needed to run the example notebooks, but not
# required for the package itself.
[tool.poetry.group.examples]
Expand Down