forked from jurra/pymurtree
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #48 from jurra/docs
Docs test coverage setup with codecov
- Loading branch information
Showing
17 changed files
with
472 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: deploy-documentation | ||
|
||
# Only run this when the master branch | ||
on: | ||
push: | ||
branches: | ||
- master | ||
- develop | ||
- feature/sphinx | ||
# Option to run action manually | ||
workflow_dispatch: | ||
inputs: | ||
tag: | ||
description: Tag for manually deploying docs website | ||
required: False | ||
default: "" | ||
permissions: | ||
contents: write | ||
|
||
# This job installs dependencies, builds the documentaiton, and pushes it to `gh-pages` | ||
jobs: | ||
deploy-docs: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python 3.8 | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
- name: Install dependencies | ||
run: | | ||
pip install -e .[docs] | ||
- name: Build the documentation | ||
run: | | ||
cd docs | ||
make html | ||
touch _build/html/.nojekyll | ||
- name: Deploy documentation | ||
uses: JamesIves/github-pages-deploy-action@v4 | ||
with: | ||
folder: docs/_build/html | ||
token: ${{ secrets.GH_PAGES }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
The MIT License (MIT) | ||
===================== | ||
|
||
Copyright © `2023` `Yasel Quintero, Jose Urra, Koos Van der Linden, Emir Demirovic` | ||
|
||
Permission is hereby granted, free of charge, to any person | ||
obtaining a copy of this software and associated documentation | ||
files (the “Software”), to deal in the Software without | ||
restriction, including without limitation the rights to use, | ||
copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the | ||
Software is furnished to do so, subject to the following | ||
conditions: | ||
|
||
The above copyright notice and this permission notice shall be | ||
included in all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, | ||
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES | ||
OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND | ||
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT | ||
HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, | ||
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR | ||
OTHER DEALINGS IN THE SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 = . | ||
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
API reference | ||
============= | ||
.. automodule:: pymurtree.OptimalDecisionTreeClassifier | ||
:members: | ||
:exclude-members: standardize_to_dtype_int32 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
# | ||
# For the full list of built-in configuration values, see the documentation: | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html | ||
|
||
# -- Project information ----------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information | ||
|
||
import os | ||
import sys | ||
import shutil | ||
|
||
sys.path.insert(0, os.path.abspath('../src/pymurtree')) | ||
|
||
shutil.copyfile('../README.md', './readme.md') | ||
|
||
project = 'PyMurTree' | ||
copyright = '2023, Yasel Quintero, Jose Urra, Emir Demirovic, Koos van der Linden' | ||
author = 'Yasel Quintero, Jose Urra, Emir Demirovic, Koos van der Linden' | ||
release = '0.0.1' | ||
|
||
# -- General configuration --------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration | ||
|
||
extensions = [ | ||
'sphinx.ext.autodoc', | ||
'sphinx.ext.napoleon', | ||
'sphinx.ext.coverage', | ||
'sphinx.ext.githubpages', | ||
'myst_parser', | ||
'sphinx_rtd_theme' | ||
] | ||
|
||
source_suffix = ['.rst', '.md'] | ||
|
||
# Specify autodoc settings | ||
napoleon_numpy_docstring = True | ||
napoleon_use_param = False | ||
|
||
autosummary_generate = True # Turn on sphinx.ext.autosummary | ||
|
||
templates_path = ['_templates'] | ||
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store'] | ||
|
||
|
||
|
||
# -- Options for HTML output ------------------------------------------------- | ||
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output | ||
|
||
html_theme = 'sphinx_rtd_theme' | ||
html_static_path = ['_static'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
.. PyMurTree documentation master file, created by | ||
sphinx-quickstart on Mon Sep 25 10:40:56 2023. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Welcome to PyMurTree's documentation! | ||
===================================== | ||
|
||
.. toctree:: | ||
:maxdepth: 3 | ||
:caption: PyMurTree | ||
|
||
readme.md | ||
|
||
|
||
.. toctree:: | ||
:maxdepth: 3 | ||
:caption: For developers | ||
|
||
api_reference | ||
lifecycle.md | ||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Lifecycle & automation | ||
All the CI automation and lifecycle management is done through GitHub Actions. | ||
There are different rules for different workflows. | ||
|
||
## Development and branching | ||
Even though we are not strictly using [git-flow](https://www.atlassian.com/git/tutorials/comparing-workflows/gitflow-workflow#:~:text=Gitflow%20is%20an%20alternative%20Git,lived%20branches%20and%20larger%20commits.), we are following a similar branching strategy. | ||
- All features are developed in feature branches. `git checkout -b feature/my_feature` | ||
- All features are merged into the `develop` branch. `git checkout develop && git merge feature/my_feature` | ||
- All bugfixes are developed in bugfix branches. `git checkout -b bugfix/my_bugfix` | ||
|
||
### Forking and Pull requests | ||
- Promote forking of the repository for better collaboration. This is a good practice for open source projects. This will allow you also to have control over rights, permissions and actions environments. | ||
- This also allows you to have a separate repository for a contributors own development and testing. Contributers can then make a PR to the main repository when you are ready. | ||
- Contributing from forks can only be made through Pull requests, this makes the overall codebase management more transparent. | ||
- Furthermore there are specific automations like tests that are triggered on pull requests. This is a good way to make sure that the code is tested before merging, and educates contributors in writing tests. | ||
|
||
## What is automated? | ||
- Tests on every pull request to develop and main branches for all platforms (Linux, Windows, MacOS). Worfklow: [`pip.yaml`](../.github/workflows/pip.yml). | ||
- Automatic build and distribution to pypi on every release. Workflow: [`pypi.yaml`](../.github/workflows/wheels.yml). | ||
- Automatic documentation generation. Workflow: [`docs.yaml`](../.github/workflows/docs.yaml). | ||
|
||
## Releasing | ||
- Update the version number in `pyproject.toml`. Do the same for the citation file. `CITAION.cff``. | ||
- Use the release tag in GitHub to create a new release. This will trigger the automatic build and distribution to pypi. This manual step will trigger the workflow: [`pypi.yaml`](../.github/workflows/wheels.yaml). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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=. | ||
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 |
Oops, something went wrong.