-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚀 Add sphinx and deploy to readthedocs.io (#13)
* 🚀 Add sphinx and deploy to readthedocs.io * ✏️ Add newer python classifiers * 🐛 Amend docs.txt for 3.6+ * 🚨 Run pytest on src and tests only * 🐛 Amend ci.txt for 3.6+ * 🐛 Explicitly point to tests/ * 🐛 Unpin pytest
- Loading branch information
Showing
18 changed files
with
566 additions
and
113 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 |
---|---|---|
|
@@ -2,76 +2,89 @@ name: GH | |
|
||
on: | ||
pull_request: | ||
branches: '*' | ||
push: | ||
branches: 'master' | ||
tags: '*' | ||
branches: master | ||
release: | ||
types: [released, prereleased] | ||
workflow_dispatch: # allows running workflow manually from the Actions tab | ||
|
||
jobs: | ||
CI: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 8 | ||
matrix: | ||
python-version: [2.7, 3.5, 3.6, 3.7, 3.8] | ||
python-version: ['2.7', '3.5', '3.6', '3.7', '3.8', '3.9', '3.10', '3.11'] | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
uses: actions/setup-python@v4 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Pip cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pip | ||
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements/*.txt') }} | ||
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('**/requirements/*.txt') }} | ||
restore-keys: | | ||
${{ runner.os }}-pip- | ||
- run: pip install -U pip setuptools wheel | ||
- name: Pre-commit cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: ${{ runner.os }}-pre-commit-${{ matrix.python-version }}-${{ hashFiles('**/requirements/ci.txt') }}-${{ hashFiles('.pre-commit-config.yaml') }} | ||
restore-keys: | | ||
${{ runner.os }}-pre-commit- | ||
- name: Install dependencies | ||
run: make install | ||
run: | | ||
pip install -U pip setuptools wheel codecov | ||
make install | ||
- name: Lint | ||
if: matrix.python-version == 3.8 | ||
if: matrix.python-version == 3.11 | ||
run: make lint | ||
|
||
- name: Test | ||
run: make test | ||
|
||
- name: Docs | ||
if: matrix.python-version == 3.11 | ||
run: SPHINXOPTS=-W make builddocs | ||
|
||
- name: Codecov | ||
if: matrix.python-version == 3.8 | ||
env: | ||
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} | ||
run: | | ||
pip install codecov | ||
codecov | ||
CD: | ||
needs: CI | ||
if: startsWith(github.ref, 'refs/tags/') | ||
if: github.event_name == 'release' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up Python 3.8 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.8 | ||
python-version: 3.x | ||
|
||
- name: PyPi Deploy preparation | ||
- name: Build | ||
run: | | ||
pip install --upgrade setuptools wheel | ||
pip install -U pip setuptools wheel twine | ||
python setup.py sdist bdist_wheel --universal | ||
- name: PyPi Deploy | ||
uses: pypa/[email protected] | ||
with: | ||
user: ${{ secrets.PYPI_USER }} | ||
password: ${{ secrets.PYPI_PASSWORD }} | ||
- name: Publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USER }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
twine upload dist/* | ||
- uses: apexskier/github-release-commenter@v1 | ||
with: | ||
|
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 |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# docs | ||
docs/source/README.md | ||
docs/source/_code_reference/ | ||
|
||
# setuptools_scm | ||
_repo_version.py |
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 @@ | ||
# .readthedocs.yml | ||
# Read the Docs configuration file | ||
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details | ||
|
||
# Required | ||
version: 2 | ||
|
||
# Build documentation in the docs/ directory with Sphinx | ||
sphinx: | ||
configuration: docs/source/conf.py | ||
|
||
# Build documentation with MkDocs | ||
#mkdocs: | ||
# configuration: mkdocs.yml | ||
|
||
# Optionally build your docs in additional formats such as PDF and ePub | ||
formats: all | ||
|
||
# Optionally set the version of Python and requirements required to build your docs | ||
python: | ||
version: 3.8 | ||
install: | ||
- method: pip | ||
path: . | ||
- requirements: requirements/docs.txt |
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,29 @@ | ||
|
||
# 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 = source | ||
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) | ||
|
||
show: | ||
xdg-open docs/_build/html/index.html || open docs/_build/html/index.html | ||
|
||
docs: | ||
rm -rf source/_code_reference | ||
make clean | ||
make html |
Oops, something went wrong.