diff --git a/.github/workflows/documentation.yml b/.github/workflows/documentation.yml index dcc6d513..467680f3 100644 --- a/.github/workflows/documentation.yml +++ b/.github/workflows/documentation.yml @@ -33,17 +33,23 @@ jobs: with: python-version: '3.11' + - name: Install pandoc + run: sudo apt-get install -y pandoc + - name: Install requirements run: python -m pip install -r requirements.txt - - name: Install requirements-dev.txt - run: python -m pip install -r requirements-dev.txt - - - name: Install - run: python -m pip install -e . + #- name: Install + # run: python -m pip install -e . + - name: Copy license + run: cp LICENSE* ./_doc/sphinxdoc/source + - name: Copy readme + run: cp README* ./_doc/sphinxdoc/source + #- name: Documentation + # run: python -m sphinx ./_doc/sphinxdoc/source ./dist/html - name: Documentation - run: python -m sphinx ./_doc ./dist/html + run: python setup.py build_sphinx - uses: actions/upload-artifact@v3 with: diff --git a/README.rst b/README.rst index a2abbe19..254764a0 100644 --- a/README.rst +++ b/README.rst @@ -1,5 +1,5 @@ -.. image:: https://travis-ci.com/sdpython/mlstatpy.svg?branch=master +.. image:: https://travis-ci.com/sdpython/mlstatpy.svg?branch=main :target: https://app.travis-ci.com/github/sdpython/mlstatpy :alt: Build status @@ -7,8 +7,8 @@ :target: https://ci.appveyor.com/project/sdpython/mlstatpy :alt: Build Status Windows -.. image:: https://circleci.com/gh/sdpython/mlstatpy/tree/master.svg?style=svg - :target: https://circleci.com/gh/sdpython/mlstatpy/tree/master +.. image:: https://circleci.com/gh/sdpython/mlstatpy/tree/main.svg?style=svg + :target: https://circleci.com/gh/sdpython/mlstatpy/tree/main .. image:: https://badge.fury.io/py/mlstatpy.svg :target: https://pypi.org/project/mlstatpy/ @@ -17,8 +17,8 @@ :alt: MIT License :target: http://opensource.org/licenses/MIT -.. image:: https://codecov.io/github/sdpython/mlstatpy/coverage.svg?branch=master - :target: https://codecov.io/github/sdpython/mlstatpy?branch=master +.. image:: https://codecov.io/github/sdpython/mlstatpy/coverage.svg?branch=main + :target: https://codecov.io/github/sdpython/mlstatpy?branch=main .. image:: http://img.shields.io/github/issues/sdpython/mlstatpy.png :alt: GitHub Issues diff --git a/_doc/sphinxdoc/source/c_algo/gest.rst b/_doc/sphinxdoc/source/c_algo/gest.rst index 5505dec7..99bcfdf6 100644 --- a/_doc/sphinxdoc/source/c_algo/gest.rst +++ b/_doc/sphinxdoc/source/c_algo/gest.rst @@ -53,7 +53,7 @@ Explications ============ La présentation -`Détection des images dans les images digitales `_ +`Détection des images dans les images digitales `_ détaille le principe de l'algorithme. L'idée de l'algorithme est assez proche de la `transformée de Hough `_. Celle-ci est implémentée dans le module diff --git a/_doc/sphinxdoc/source/conf.py b/_doc/sphinxdoc/source/conf.py index 9ccee104..6f6433df 100644 --- a/_doc/sphinxdoc/source/conf.py +++ b/_doc/sphinxdoc/source/conf.py @@ -120,6 +120,7 @@ "PiecewiseTreeRegressor": "http://www.xavierdupre.fr/app/mlinsights/helpsphinx/mlinsights/mlmodel/" "piecewise_tree_regression.html#mlinsights.mlmodel.piecewise_tree_regression.PiecewiseTreeRegressor", "Predictable t-SNE": "http://www.xavierdupre.fr/app/mlinsights/helpsphinx/notebooks/predictable_tsne.html", + "QuantileLinearRegression": "http://www.xavierdupre.fr/app/mlinsights/helpsphinx/mlinsights/mlmodel/quantile_regression.html#mlinsights.mlmodel.quantile_regression.QuantileLinearRegression", "R-tree": "https://en.wikipedia.org/wiki/R-tree", "R* tree": "https://en.wikipedia.org/wiki/R*_tree", "Regression with confidence interval": "http://www.xavierdupre.fr/app/mlinsights/helpsphinx/notebooks/regression_confidence_interval.html", diff --git a/_doc/sphinxdoc/source/index.rst b/_doc/sphinxdoc/source/index.rst index 95c99798..0dc6de89 100644 --- a/_doc/sphinxdoc/source/index.rst +++ b/_doc/sphinxdoc/source/index.rst @@ -38,7 +38,7 @@ Xavier Dupré .. only:: html - .. image:: https://travis-ci.com/sdpython/mlstatpy.svg?branch=master + .. image:: https://travis-ci.com/sdpython/mlstatpy.svg?branch=main :target: https://app.travis-ci.com/github/sdpython/mlstatpy :alt: Build status @@ -46,8 +46,8 @@ Xavier Dupré :target: https://ci.appveyor.com/project/sdpython/mlstatpy :alt: Build Status Windows - .. image:: https://circleci.com/gh/sdpython/mlstatpy/tree/master.svg?style=svg - :target: https://circleci.com/gh/sdpython/mlstatpy/tree/master + .. image:: https://circleci.com/gh/sdpython/mlstatpy/tree/main.svg?style=svg + :target: https://circleci.com/gh/sdpython/mlstatpy/tree/main .. image:: https://badge.fury.io/py/mlstatpy.svg :target: https://pypi.org/project/mlstatpy/ @@ -56,8 +56,8 @@ Xavier Dupré :alt: MIT License :target: http://opensource.org/licenses/MIT - .. image:: https://codecov.io/github/sdpython/mlstatpy/coverage.svg?branch=master - :target: https://codecov.io/github/sdpython/mlstatpy?branch=master + .. image:: https://codecov.io/github/sdpython/mlstatpy/coverage.svg?branch=main + :target: https://codecov.io/github/sdpython/mlstatpy?branch=main .. image:: http://img.shields.io/github/issues/sdpython/mlstatpy.png :alt: GitHub Issues diff --git a/requirements.txt b/requirements.txt index 04a5a9f1..049d6aae 100644 --- a/requirements.txt +++ b/requirements.txt @@ -40,7 +40,7 @@ snakeviz scikit-learn>=1.1 git+https://github.com/onnx/sklearn-onnx.git sphinx -sphinx-bootstrap-theme +sphinx_gallery sphinxcontrib.imagesvg stack_data statsmodels diff --git a/setup.py b/setup.py index db2632e3..b973ee73 100644 --- a/setup.py +++ b/setup.py @@ -3,6 +3,7 @@ import os from setuptools import find_packages, setup from pyquicksetup import read_version, read_readme, default_cmdclass +from pyquicksetup.pyquick import _SetupCommand ######### # settings @@ -37,6 +38,38 @@ package_data = {} +class SetupCommandSphinx(_SetupCommand): + description = "Builds documentation." + + user_options = [ + ("layout=", None, "format generation, default is html,rst."), + ( + "nbformats=", + None, + "format generation, default is ipynb,slides,html,python,rst,github", + ), + ] + + def initialize_options(self): + self.layout = "html,rst" + self.nbformats = "ipynb,html,python,rst,github" + + def finalize_options(self): + pass + + def run(self): + from pyquickhelper.pycode import process_standard_options_for_setup + + parameters = self.get_parameters() + parameters["argv"] = ["build_sphinx"] + parameters["layout"] = self.layout.split(",") + parameters["nbformats"] = self.nbformats.split(",") + process_standard_options_for_setup(**parameters) + + +defcla = default_cmdclass().copy() +defcla["build_sphinx"] = SetupCommandSphinx + setup( name=project_var_name, version=read_version(__file__, project_var_name), @@ -47,7 +80,7 @@ download_url=f"https://github.com/sdpython/{project_var_name}/", description=DESCRIPTION, long_description=read_readme(__file__), - cmdclass=default_cmdclass(), + cmdclass=defcla, keywords=KEYWORDS, classifiers=CLASSIFIERS, packages=packages,