diff --git a/docs/Makefile b/docs/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..d4bb2cbb9eddb1bb1b4f366623044af8e4830919 --- /dev/null +++ b/docs/Makefile @@ -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 = . +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) diff --git a/docs/api/ani.rst b/docs/api/ani.rst new file mode 100644 index 0000000000000000000000000000000000000000..f5f50bab034212f37be4d579fc3d365d9c17d377 --- /dev/null +++ b/docs/api/ani.rst @@ -0,0 +1,20 @@ +Average Nucleotide Identity +=========================== + +.. currentmodule:: pyfastani + +Sketch +------ + +.. autoclass:: pyfastani.Sketch + :special-members: __init__ + :inherited-members: + :members: + + +Mapper +------ + +.. autoclass:: pyfastani.Mapper + :inherited-members: + :members: diff --git a/docs/api/index.rst b/docs/api/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..67e0e3204a2f3128cbb9fb726fb7ade9627f2bfe --- /dev/null +++ b/docs/api/index.rst @@ -0,0 +1,44 @@ +API Reference +============= + +.. currentmodule:: pyfastani + +.. toctree:: + :hidden: + + sketch <ani> + miscellaneous <misc> + minimizer <minimizer> + + +.. only:: html + + Average Nucleotide Identity + --------------------------- + + .. autosummary:: + :nosignatures: + + pyfastani.Sketch + pyfastani.Mapper + + + Minimizers + ---------- + + .. autosummary:: + :nosignatures: + + pyfastani.Minimizers + pyfastani.MinimizerInfo + pyfastani.MinimizerIndex + + + Miscellaneous + ------------- + + .. autosummary:: + :nosignatures: + + pyfastani.Hit + pyfastani.Position diff --git a/docs/api/minimizer.rst b/docs/api/minimizer.rst new file mode 100644 index 0000000000000000000000000000000000000000..c4ceabf8dc6527cc4aabebacb799337141b89d0f --- /dev/null +++ b/docs/api/minimizer.rst @@ -0,0 +1,27 @@ +Minimizer +========= + +.. currentmodule:: pyfastani + +Minimizers +---------- + +.. autoclass:: pyfastani.Minimizers + :inherited-members: + :members: + + +MinimizerInfo +------------- + +.. autoclass:: pyfastani.MinimizerInfo + :inherited-members: + :members: + + +MinimizerIndex +-------------- + +.. autoclass:: pyfastani.MinimizerIndex + :inherited-members: + :members: diff --git a/docs/api/misc.rst b/docs/api/misc.rst new file mode 100644 index 0000000000000000000000000000000000000000..bae9a5d79368a02a18211a4314c58dc6807f84d6 --- /dev/null +++ b/docs/api/misc.rst @@ -0,0 +1,19 @@ +Miscellaneous +============= + +.. currentmodule:: pyfastani + +Hit +--- + +.. autoclass:: pyfastani.Hit + :inherited-members: + :members: + + +Position +-------- + +.. autoclass:: pyfastani.Position + :inherited-members: + :members: diff --git a/docs/changes.md b/docs/changes.md new file mode 120000 index 0000000000000000000000000000000000000000..04c99a55caae5d51f17666f554c2c8cea0aadfc0 --- /dev/null +++ b/docs/changes.md @@ -0,0 +1 @@ +../CHANGELOG.md \ No newline at end of file diff --git a/docs/conf.py b/docs/conf.py new file mode 100644 index 0000000000000000000000000000000000000000..22115facf02e05c2361303de3b54b1c33f88b1b1 --- /dev/null +++ b/docs/conf.py @@ -0,0 +1,342 @@ +# 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 + +# -- Imports ----------------------------------------------------------------- + +import configparser +import datetime +import os +import re +import semantic_version +import shutil +import sphinx_bootstrap_theme +import sys + +# -- 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. + +docssrc_dir = os.path.dirname(os.path.abspath(__file__)) +project_dir = os.path.dirname(docssrc_dir) + +# -- Project information ----------------------------------------------------- + +import pyfastani + +# extract the project metadata from the module itself +project = pyfastani.__name__ +author = re.match('(.*) <.*>', pyfastani.__author__).group(1) +year = datetime.date.today().year +copyright = '{}, {}'.format("2021" if year==2021 else "2021-{}".format(year), author) + +# extract the semantic version +semver = semantic_version.Version.coerce(pyfastani.__version__) +version = str(semver.truncate(level="patch")) +release = str(semver) + +# extract the project URLs from ``setup.cfg`` +cfgparser = configparser.ConfigParser() +cfgparser.read(os.path.join(project_dir, "setup.cfg")) +project_urls = dict( + map(str.strip, line.split(" = ", 1)) + for line in cfgparser.get("metadata", "project_urls").splitlines() + if line.strip() +) + +# patch the docstring so that we don't show the link to redirect +# to the docs (we don't want to see it when reading the docs already, duh!) +doc_lines = pyfastani.__doc__.splitlines() +if "See Also:" in doc_lines: + see_also = doc_lines.index("See Also:") + pyfastani.__doc__ = "\n".join(doc_lines[:see_also]) + + + +# -- 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.autosummary", + "sphinx.ext.intersphinx", + "sphinx.ext.napoleon", + "sphinx.ext.coverage", + "sphinx.ext.mathjax", + "sphinx.ext.todo", + "sphinx.ext.extlinks", + "sphinx_bootstrap_theme", + "recommonmark", + "nbsphinx", +] + +# 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', + '**.ipynb_checkpoints', + 'requirements.txt' +] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = "monokailight" + +# The name of the default role for inline references +default_role = "py:obj" + + + +# The name of the default role for inline references +default_role = "py:obj" + + +# -- 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 = 'bootstrap' + +# 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'] + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +html_theme_options = { + # Bootswatch (http://bootswatch.com/) theme. + "bootswatch_theme": "flatly", + # Choose Bootstrap version. + "bootstrap_version": "3", + # Tab name for entire site. (Default: "Site") + "navbar_site_name": "Documentation", + # HTML navbar class (Default: "navbar") to attach to <div> element. + # For black navbar, do "navbar navbar-inverse" + "navbar_class": "navbar", + # Render the next and previous page links in navbar. (Default: true) + "navbar_sidebarrel": True, + # Render the current pages TOC in the navbar. (Default: true) + "navbar_pagenav": False, + # A list of tuples containing pages or urls to link to. + "navbar_links": [ + ("GitHub", cfgparser.get("metadata", "url").strip(), True) + ] + [ + (k, v, True) + for k, v in project_urls.items() + if k in {"Zenodo", "PyPI"} + ], + "admonition_use_panel": True, +} + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +html_sidebars = { + "*": ["localtoc.html"], + "api/*": ["localtoc.html"], + "examples/*": ["localtoc.html"], +} + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = pyfastani.__name__ + + +# -- Extension configuration ------------------------------------------------- + +# -- Options for imgmath extension ------------------------------------------- + +imgmath_image_format = "svg" + +# -- Options for napoleon extension ------------------------------------------ + +napoleon_include_init_with_doc = True +napoleon_include_special_with_doc = True +napoleon_include_private_with_doc = True +napoleon_use_admonition_for_examples = True +napoleon_use_admonition_for_notes = True +napoleon_use_admonition_for_references = True +napoleon_use_rtype = False + +# -- Options for autodoc extension ------------------------------------------- + +autoclass_content = "class" +autodoc_member_order = 'groupwise' +autosummary_generate = [] + +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("https://docs.python.org/3/", None), + "biopython": ("https://biopython.org/docs/latest/api/", None), +} + +# -- Options for recommonmark extension -------------------------------------- + +source_suffix = { + '.rst': 'restructuredtext', + '.txt': 'markdown', + '.md': 'markdown', +} + +# -- Options for nbsphinx extension ------------------------------------------ + +nbsphinx_execute = 'auto' +nbsphinx_execute_arguments = [ + "--InlineBackend.figure_formats={'svg', 'pdf'}", + "--InlineBackend.rc={'figure.dpi': 96}", +] + +# -- Options for extlinks extension ------------------------------------------ + +extlinks = { + 'doi': ('https://doi.org/%s', 'doi:'), + 'pmid': ('https://pubmed.ncbi.nlm.nih.gov/%s', 'PMID:'), + 'pmc': ('https://www.ncbi.nlm.nih.gov/pmc/articles/PMC%s', 'PMC'), + 'isbn': ('https://www.worldcat.org/isbn/%s', 'ISBN:'), + 'wiki': ('https://en.wikipedia.org/wiki/%s', 'Wikipedia:') +} + + +# The name of the default role for inline references +default_role = "py:obj" + + +# -- 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 = 'bootstrap' + +# 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'] + +# Theme options are theme-specific and customize the look and feel of a theme +# further. For a list of options available for each theme, see the +# documentation. +# +html_theme_options = { + # Bootswatch (http://bootswatch.com/) theme. + "bootswatch_theme": "flatly", + # Choose Bootstrap version. + "bootstrap_version": "3", + # Tab name for entire site. (Default: "Site") + "navbar_site_name": "Documentation", + # HTML navbar class (Default: "navbar") to attach to <div> element. + # For black navbar, do "navbar navbar-inverse" + "navbar_class": "navbar", + # Render the next and previous page links in navbar. (Default: true) + "navbar_sidebarrel": True, + # Render the current pages TOC in the navbar. (Default: true) + "navbar_pagenav": False, + # A list of tuples containing pages or urls to link to. + "navbar_links": [ + ("GitHub", cfgparser.get("metadata", "url").strip(), True) + ] + [ + (k, v, True) + for k, v in project_urls.items() + if k in {"Zenodo", "PyPI"} + ], + "admonition_use_panel": True, +} + +# Custom sidebar templates, must be a dictionary that maps document names +# to template names. +# +# The default sidebars (for documents that don't match any pattern) are +# defined by theme itself. Builtin themes are using these templates by +# default: ``['localtoc.html', 'relations.html', 'sourcelink.html', +# 'searchbox.html']``. +# +html_sidebars = { + "*": ["localtoc.html"], + "api/*": ["localtoc.html"], + "examples/*": ["localtoc.html"], +} + +# -- Options for HTMLHelp output --------------------------------------------- + +# Output file base name for HTML help builder. +htmlhelp_basename = pyfastani.__name__ + + +# -- Extension configuration ------------------------------------------------- + +# -- Options for imgmath extension ------------------------------------------- + +imgmath_image_format = "svg" + +# -- Options for napoleon extension ------------------------------------------ + +napoleon_include_init_with_doc = True +napoleon_include_special_with_doc = True +napoleon_include_private_with_doc = True +napoleon_use_admonition_for_examples = True +napoleon_use_admonition_for_notes = True +napoleon_use_admonition_for_references = True +napoleon_use_rtype = False + +# -- Options for autodoc extension ------------------------------------------- + +autoclass_content = "class" +autodoc_member_order = 'groupwise' +autosummary_generate = [] + +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = { + "python": ("https://docs.python.org/3/", None), + "biopython": ("https://biopython.org/docs/latest/api/", None), +} + +# -- Options for recommonmark extension -------------------------------------- + +source_suffix = { + '.rst': 'restructuredtext', + '.txt': 'markdown', + '.md': 'markdown', +} + +# -- Options for nbsphinx extension ------------------------------------------ + +nbsphinx_execute = 'auto' +nbsphinx_execute_arguments = [ + "--InlineBackend.figure_formats={'svg', 'pdf'}", + "--InlineBackend.rc={'figure.dpi': 96}", +] + +# -- Options for extlinks extension ------------------------------------------ + +extlinks = { + 'doi': ('https://doi.org/%s', 'doi:'), + 'pmid': ('https://pubmed.ncbi.nlm.nih.gov/%s', 'PMID:'), + 'pmc': ('https://www.ncbi.nlm.nih.gov/pmc/articles/PMC%s', 'PMC'), + 'isbn': ('https://www.worldcat.org/isbn/%s', 'ISBN:'), + 'wiki': ('https://en.wikipedia.org/wiki/%s', 'Wikipedia:') +} diff --git a/docs/contributing.md b/docs/contributing.md new file mode 120000 index 0000000000000000000000000000000000000000..44fcc63439371c8c829df00eec6aedbdc4d0e4cd --- /dev/null +++ b/docs/contributing.md @@ -0,0 +1 @@ +../CONTRIBUTING.md \ No newline at end of file diff --git a/docs/index.rst b/docs/index.rst new file mode 100644 index 0000000000000000000000000000000000000000..5363d43bafe0bdb32470cb27285d33a9c1febc89 --- /dev/null +++ b/docs/index.rst @@ -0,0 +1,115 @@ +PyFastANI |Stars| +================= + +.. |Stars| image:: https://img.shields.io/github/stars/althonos/pyfastani.svg?style=social&maxAge=3600&label=Star + :target: https://github.com/althonos/pyfastani/stargazers + +`Cython <https://cython.org/>`_ *bindings and Python interface to* `trimAl <http://trimal.cgenomics.org/>`_, +*a tool for automated alignment trimming.* + +|Actions| |Coverage| |PyPI| |Bioconda| |AUR| |Wheel| |Versions| |Implementations| |License| |Source| |Mirror| |Issues| |Docs| |Changelog| |Downloads| + +.. |Actions| image:: https://img.shields.io/github/workflow/status/althonos/pyfastani/Test/main?logo=github&style=flat-square&maxAge=300 + :target: https://github.com/althonos/pyfastani/actions + +.. |Coverage| image:: https://img.shields.io/codecov/c/gh/althonos/pyfastani?style=flat-square&maxAge=600 + :target: https://codecov.io/gh/althonos/pyfastani/ + +.. |PyPI| image:: https://img.shields.io/pypi/v/pyfastani.svg?style=flat-square&maxAge=3600 + :target: https://pypi.python.org/pypi/pyfastani + +.. |Bioconda| image:: https://img.shields.io/conda/vn/bioconda/pyfastani?style=flat-square&maxAge=3600 + :target: https://anaconda.org/bioconda/pyfastani + +.. |AUR| image:: https://img.shields.io/aur/version/python-pyfastani?logo=archlinux&style=flat-square&maxAge=3600 + :target: https://aur.archlinux.org/packages/python-pyfastani + +.. |Wheel| image:: https://img.shields.io/pypi/wheel/pyfastani?style=flat-square&maxAge=3600 + :target: https://pypi.org/project/pyfastani/#files + +.. |Versions| image:: https://img.shields.io/pypi/pyversions/pyfastani.svg?style=flat-square&maxAge=3600 + :target: https://pypi.org/project/pyfastani/#files + +.. |Implementations| image:: https://img.shields.io/pypi/implementation/pyfastani.svg?style=flat-square&maxAge=3600&label=impl + :target: https://pypi.org/project/pyfastani/#files + +.. |License| image:: https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square&maxAge=3600 + :target: https://choosealicense.com/licenses/mit/ + +.. |Source| image:: https://img.shields.io/badge/source-GitHub-303030.svg?maxAge=2678400&style=flat-square + :target: https://github.com/althonos/pyfastani/ + +.. |Mirror| image:: https://img.shields.io/badge/mirror-EMBL-009f4d?style=flat-square&maxAge=2678400 + :target: https://git.embl.de/larralde/pyfastani/ + +.. |Issues| image:: https://img.shields.io/github/issues/althonos/pyfastani.svg?style=flat-square&maxAge=600 + :target: https://github.com/althonos/pyfastani/issues + +.. |Docs| image:: https://img.shields.io/readthedocs/pyfastani?style=flat-square&maxAge=3600 + :target: http://pyfastani.readthedocs.io/en/stable/?badge=stable + +.. |Changelog| image:: https://img.shields.io/badge/keep%20a-changelog-8A0707.svg?maxAge=2678400&style=flat-square + :target: https://github.com/althonos/pyfastani/blob/main/CHANGELOG.md + +.. |Downloads| image:: https://img.shields.io/badge/dynamic/json?style=flat-square&color=303f9f&maxAge=86400&label=downloads&query=%24.total_downloads&url=https%3A%2F%2Fapi.pepy.tech%2Fapi%2Fprojects%2Fpyfastani + :target: https://pepy.tech/project/pyfastani + + +Overview +-------- + +PytrimAl is a Python module that provides bindings to trimAl using +`Cython <https://cython.org/>`_. It directly interacts with the trimAl +internals, which has the following advantages: + +- **single dependency**: PytrimAl is distributed as a Python package, so you + can add it as a dependency to your project, and stop worrying about the + trimAl binary being present on the end-user machine. +- **no intermediate files**: Everything happens in memory, in a Python object + you control, so you don't have to invoke the trimAl CLI using a + sub-process and temporary files. `Alignment` objects can be created + directly from Python code. +- **friendly interface**: The different trimming methods are implement as + Python classes that can be configured independently. +- **error management**: Errors occuring in trimAl are converted + transparently into Python exceptions, including an informative + error message. + + +Setup +----- + +Run ``pip install pyfastani`` in a shell to download the latest release and all +its dependencies from PyPi, or have a look at the +:doc:`Installation page <install>` to find other ways to install ``pyfastani``. + + +Library +------- + +.. toctree:: + :maxdepth: 2 + + Installation <install> + Contributing <contributing> + API Reference <api/index> + Changelog <changes> + + +License +------- + +This library is provided under the `MIT License <https://choosealicense.com/licenses/mit/>`_. + +The fastANI code was written by `Chirag Jain <https://github.com/cjain7>`_ +and is distributed under the terms of the +`Apache License 2.0 <https://choosealicense.com/licenses/apache-2.0/>`_, +unless otherwise specified in vendored sources. The ``cpu_features`` code was written by `Guillaume Chatelet <https://github.com/gchatelet>`_ +and is distributed under the terms of the `Apache License 2.0 <https://choosealicense.com/licenses/apache-2.0/>`_. +The ``Boost::math`` headers were written by `Boost Libraries <https://www.boost.org/>`_ contributors +and is distributed under the terms of the `Boost Software License <https://choosealicense.com/licenses/bsl-1.0/>`_. + +*This project is in no way not affiliated, sponsored, or otherwise endorsed by +the original* ``fastANI`` *authors. It was developed by* `Martin Larralde <https://github.com/althonos>`_ *during his +PhD project at the* `European Molecular Biology Laboratory <https://www.embl.de/>`_ +*in the* `Zeller team <https://github.com/zellerlab>`_. diff --git a/docs/install.rst b/docs/install.rst new file mode 100644 index 0000000000000000000000000000000000000000..c7a651d3850e6c32355e68170ef01a1ad2948c40 --- /dev/null +++ b/docs/install.rst @@ -0,0 +1,86 @@ +Installation +============ + +.. note:: + + Wheels are provided for Linux and OSX x86-64, but other machines will + have to build the wheel from the source distribution. Building ``pyfastani`` + involves compiling fastANI, which requires a C++ compiler to be available + on the local machine. + + +PyPi +^^^^ + +``pyfastani`` is hosted on GitHub, but the easiest way to install it is to download +the latest release from its `PyPi repository <https://pypi.python.org/pypi/pyfastani>`_. +It will install all dependencies then install ``pyfastani`` either from a wheel if +one is available, or from source after compiling the Cython code : + +.. code:: console + + $ pip install --user pyfastani + + +.. Conda +.. ^^^^^ +.. +.. `pyfastani` is also available as a `recipe <https://anaconda.org/bioconda/pyfastani>`_ +.. in the `bioconda <https://bioconda.github.io/>`_ channel. To install, simply +.. use the ``conda`` installer: +.. +.. .. code:: console +.. +.. $ conda install -c bioconda pyfastani +.. +.. +.. Arch User Repository +.. ^^^^^^^^^^^^^^^^^^^^ +.. +.. A package recipe for Arch Linux can be found in the Arch User Repository +.. under the name `python-pyfastani <https://aur.archlinux.org/packages/python-pyfastani>`_. +.. It will always match the latest release from PyPI. +.. +.. Steps to install on ArchLinux depend on your `AUR helper <https://wiki.archlinux.org/title/AUR_helpers>`_ +.. (``yaourt``, ``aura``, ``yay``, etc.). For ``aura``, you'll need to run: +.. +.. .. code:: console +.. +.. $ aura -A python-pyfastani + + +GitHub + ``pip`` +^^^^^^^^^^^^^^^^ + +If, for any reason, you prefer to download the library from GitHub, you can clone +the repository and install the repository by running (with the admin rights): + +.. code:: console + + $ git clone --recursive https://github.com/althonos/pyfastani + $ pip install --user ./pyfastani + +.. caution:: + + Keep in mind this will install always try to install the latest commit, + which may not even build, so consider using a versioned release instead. + + +GitHub + ``setuptools`` +^^^^^^^^^^^^^^^^^^^^^^^ + +If you do not want to use ``pip``, you can still clone the repository and +run the ``setup.py`` file manually, although you will need to install the +build dependencies (mainly `Cython <https://pypi.org/project/cython>`_): + +.. code:: console + + $ git clone --recursive https://github.com/althonos/pyfastani + $ cd pyfastani + $ python setup.py build_ext + # python setup.py install + +.. Danger:: + + Installing packages without ``pip`` is strongly discouraged, as they can + only be uninstalled manually, and may damage your system. diff --git a/docs/make.bat b/docs/make.bat new file mode 100644 index 0000000000000000000000000000000000000000..32bb24529f92346af26219baed295b7488b77534 --- /dev/null +++ b/docs/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=. +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 diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000000000000000000000000000000000000..a1f0601e6aea0339e468cd9527f889f9d726e179 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,16 @@ +# build dependencies +setuptools >=46.4 +cython ~=0.29.16 + +# sphinx documentation dependencies +semantic_version ~=2.8 +sphinx ~=5.0 +recommonmark ~=0.7 +pygments-style-monokailight ~=0.4 +ipython ~=7.19 +pygments ~=2.4 +nbsphinx ~=0.8 +ipykernel ~=6.0 + +# sphinx-bootstrap-theme ~=0.7 with patched admonition +https://github.com/althonos/sphinx-bootstrap-theme/archive/master.zip