diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 55dacf60..86dcfbcb 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -2,7 +2,7 @@ name: Bug report about: Create a report to help us improve title: "[BUG]" -labels: '' +labels: ["bug"] assignees: Benjamin-eecs --- diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index 0e6ca2a8..b61aa154 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -2,7 +2,7 @@ name: Feature request about: Suggest an idea for this project title: "[Feature Request]" -labels: '' +labels: ["enhancement"] assignees: Benjamin-eecs --- diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..88b7a202 --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,32 @@ +# .readthedocs.yaml +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details + +# Required +version: 2 + +# Set the version of Python and other tools you might need +build: + os: ubuntu-20.04 + tools: + python: mambaforge-4.10 + +# Optionally declare the Python requirements required to build your docs +conda: + environment: docs/conda-recipe.yaml + +# If using Sphinx, optionally build your docs in additional formats such as PDF +formats: + - pdf + +# Build documentation in the docs/ directory with Sphinx +sphinx: + builder: html + configuration: docs/source/conf.py + fail_on_warning: true + +# Optionally declare the Python requirements required to build your docs +python: + install: + - method: pip + path: . diff --git a/conda-recipe.yaml b/conda-recipe.yaml index f7f0917a..625a236c 100644 --- a/conda-recipe.yaml +++ b/conda-recipe.yaml @@ -59,6 +59,7 @@ dependencies: - sphinxcontrib-spelling - sphinxcontrib-bibtex - sphinx-autodoc-typehints + - pyenchant - myst-nb - ipykernel - pandoc @@ -76,7 +77,6 @@ dependencies: - flake8-bugbear - doc8 - pydocstyle - - pyenchant - clang-format - clang-tools # clang-tidy - cpplint diff --git a/docs/conda-recipe.yaml b/docs/conda-recipe.yaml new file mode 100644 index 00000000..d55c0f19 --- /dev/null +++ b/docs/conda-recipe.yaml @@ -0,0 +1,73 @@ +# Copyright 2022 MetaOPT Team. All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============================================================================== +# +# Create virtual environment with command: +# +# $ CONDA_OVERRIDE_CUDA=11.7 conda env create --file docs/conda-recipe.yaml +# + +name: torchopt-docs + +channels: + - pytorch + - defaults + - conda-forge + +dependencies: + - python = 3.8 + - pip + + # Learning + - pytorch::pytorch = 1.12 + - pytorch::torchvision + - pytorch::pytorch-mutex = *=*cpu* + - pip: + - jax[cpu] >= 0.3 + - functorch + - torchviz + - sphinxcontrib-katex # for documentation + - tensorboard + - wandb + + # Build toolchain + - cmake >= 3.4 + - make + - cxx-compiler + - gxx = 10 + - nvidia/label/cuda-11.6.2::cuda-nvcc + - nvidia/label/cuda-11.6.2::cuda-cudart-dev + - pybind11 + + # Misc + - typing-extensions + - numpy + - matplotlib-base + - seaborn + - python-graphviz + - pillow + + # Documentation + - sphinx + - sphinx_rtd_theme + - sphinx-autobuild + - sphinx-copybutton + - sphinxcontrib-spelling + - sphinxcontrib-bibtex + - sphinx-autodoc-typehints + - pyenchant + - myst-nb + - ipykernel + - pandoc + - docutils diff --git a/docs/source/conf.py b/docs/source/conf.py index da11e3b7..25159cb0 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -25,15 +25,12 @@ # 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 inspect import os import pathlib import sys import sphinxcontrib.katex as katex -import torchopt - HERE = pathlib.Path(__file__).absolute().parent PROJECT_ROOT = HERE.parent.parent @@ -76,12 +73,14 @@ def get_version() -> str: 'sphinx_copybutton', 'sphinx_rtd_theme', 'sphinxcontrib.bibtex', - 'sphinxcontrib.spelling', 'sphinxcontrib.katex', 'sphinx_autodoc_typehints', 'myst_nb', # This is used for the .ipynb notebooks ] +if not os.getenv('READTHEDOCS', None): + extensions.append('sphinxcontrib.spelling') + # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates']