Skip to content
This repository was archived by the owner on Dec 6, 2023. It is now read-only.

deploy docs automatically with every commit in master #177

Merged
merged 3 commits into from
May 17, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 34 additions & 0 deletions .github/workflows/gh_pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Deploy Docs to GitHub Pages

on:
push:
branches:
- master

jobs:
build-and-deploy-docs:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
fetch-depth: 3
- name: Install Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install package
run: |
pip install -r requirements_build.txt
python setup.py build
python setup.py install
- name: Build docs
run: |
cd doc
pip install -r requirements.txt
make html
- name: Deploy docs
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: ${{ github.workspace }}/doc/_build/html
8 changes: 7 additions & 1 deletion doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@

import sphinx_bootstrap_theme

from lightning import __version__

# -- Project information -----------------------------------------------------

Expand All @@ -20,6 +19,13 @@
copyright = '{}, {}'.format(datetime.now().year, author)

# The full version, including alpha/beta/rc tags.
try:
from lightning import __version__
except (ImportError, ModuleNotFoundError) as e:
raise ImportError(
f"You must install '{project}' package itself to build docs for it"
) from e

release = __version__

# -- General configuration ---------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
matplotlib
sphinx
sphinx_bootstrap_theme
sphinx-gallery
sphinx_gallery
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
joblib
numpy
scikit-learn
scipy
2 changes: 2 additions & 0 deletions requirements_build.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cython
numpy
2 changes: 2 additions & 0 deletions requirements_test.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-r requirements.txt
pytest
10 changes: 7 additions & 3 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@
f.read())
VERSION = match.group('version').strip()
MIN_PYTHON_VERSION = '3.6'
with open('requirements.txt', encoding='utf-8') as f:
REQUIREMENTS = [
line.strip()
for line in f.read().splitlines()
if line.strip()
]


def configuration(parent_package='', top_path=None):
Expand All @@ -49,9 +55,7 @@ def configuration(parent_package='', top_path=None):
name=DISTNAME,
maintainer=MAINTAINER,
python_requires='>={}'.format(MIN_PYTHON_VERSION),
install_requires=[
'scikit-learn'
],
install_requires=REQUIREMENTS,
include_package_data=True,
scripts=["bin/lightning_train",
"bin/lightning_predict"],
Expand Down