Skip to content

Commit

Permalink
Doc Versioning (#73)
Browse files Browse the repository at this point in the history
* add mike install and initial config to mkdocs
* Separate workflows by push, release, clean (not ideal - will fix later)
  • Loading branch information
e-lo authored May 3, 2022
1 parent d3c2f8e commit 0367b85
Show file tree
Hide file tree
Showing 13 changed files with 173 additions and 113 deletions.
30 changes: 30 additions & 0 deletions .github/workflows/clean.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Clean Docs for Deleted References
on:
delete:

env:
PYTHON_VERSION: 3.8

jobs:
clean:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python $PYTHON_VERSION
uses: actions/setup-python@v2
with:
python-version: $PYTHON_VERSION
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install mike
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Delete defunct docs versions
run: |
echo "Deleting ${{ github.event.ref_name }} version from docs"
mike delete ${{ github.event.ref_name }}
20 changes: 0 additions & 20 deletions .github/workflows/docs.yml

This file was deleted.

32 changes: 0 additions & 32 deletions .github/workflows/publish.yml

This file was deleted.

46 changes: 46 additions & 0 deletions .github/workflows/push.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Push Workflow

on: [push]

jobs:
build:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.8]

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Document branch
run: echo ${{ github.ref_name }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: Lint
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install package
run: |
pip install -e .[test]
- name: Test with pytest
run: |
pytest -s -m "not skipci"
- name: Configure Git user
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Build docs
run: |
mike deploy --push --rebase ${{ github.ref_name }}
69 changes: 69 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
name: Release Workflow

on:
release:
types: [published]

jobs:
build-test-deploy:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.7, 3.8]
env:
DEPLOY_TARGET: ${{ matrix.python-version == '3.8' }}

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Document python/os version
run: |
echo "Python V ${{ matrix.python-version }}"
echo "Targeted Deployment Combo? $DEPLOY_TARGET"
- name: Document branch
run: echo ${{ github.ref_name }}
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r dev-requirements.txt
- name: Lint
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
- name: Install package
run: |
pip install -e .
- name: Test with pytest
run: |
pytest -s -m "not skipci"
- name: Configure Git user
if: ${{DEPLOY_TARGET}}
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
- name: Build docs
if: ${{DEPLOY_TARGET}}
run: |
mike deploy --push --rebase --update-aliases ${{ github.ref_name }} latest
- name: Install deployment dependencies
if: ${{DEPLOY_TARGET}}
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Publish to PyPI
if: ${{DEPLOY_TARGET}}
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
python setup.py sdist bdist_wheel
twine upload dist/*
29 changes: 0 additions & 29 deletions .github/workflows/test.yml

This file was deleted.

24 changes: 0 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,27 +20,3 @@ repos:
- id: mixed-line-ending
- id: check-added-large-files
- id: check-json
- id: check-toml
- id: check-yaml
- id: requirements-txt-fixer
- id: check-executables-have-shebangs
- repo: https://github.com/igorshubovych/markdownlint-cli
rev: v0.27.1
hooks:
- id: markdownlint
stages: [manual]
- repo: https://github.com/pycqa/isort
rev: 5.10.1
hooks:
- id: isort
args: ["--profile", "black"]
- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.14.3
hooks:
- id: check-github-workflows
- id: check-github-actions
- repo: http://github.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
stages: [manual]
1 change: 0 additions & 1 deletion docs/contributing/development.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Development


## Preparation

### Install Git
Expand Down
3 changes: 3 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### For testing feature

I am the the PR for branch: `test-deleting-ref` --> `versioned-docs`
17 changes: 11 additions & 6 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ channels:
dependencies:
- affine=2.3.0=py_0
- appnope=0.1.2=py37hf985489_2
- argh=0.26.2=pyh9f0ad1d_1002
- argon2-cffi=21.3.0=pyhd8ed1ab_0
- argon2-cffi-bindings=21.2.0=py37h271585c_1
- attrs=21.4.0=pyhd8ed1ab_0
Expand All @@ -21,7 +22,7 @@ dependencies:
- c-ares=1.18.1=h0d85af4_0
- ca-certificates=2021.10.8=h033912b_0
- cairo=1.16.0=he43a7df_1008
- certifi=2021.10.8=py37hf985489_1
- certifi=2021.10.8=py37hf985489_2
- cffi=1.15.0=py37h446072c_0
- cfitsio=3.470=h01dc385_7
- chardet=4.0.0=py37hf985489_2
Expand All @@ -40,7 +41,7 @@ dependencies:
- fiona=1.8.20=py37h687fd47_1
- flit-core=3.7.1=pyhd8ed1ab_0
- folium=0.12.0=pyhd8ed1ab_1
- fontconfig=2.13.96=h676cef8_1
- fontconfig=2.13.94=h10f422b_0
- fonttools=4.30.0=py37h69ee0a8_0
- freetype=2.10.4=h4cff582_1
- freexl=1.0.6=h0d85af4_0
Expand All @@ -52,11 +53,13 @@ dependencies:
- geos=3.9.1=he49afe7_2
- geotiff=1.6.0=h26421ea_6
- gettext=0.19.8.1=hd1a6beb_1008
- ghp-import=2.0.2=pyhd8ed1ab_0
- giflib=5.2.1=hbcb3906_2
- hdf4=4.2.15=hefd3b78_3
- hdf5=1.12.1=nompi_ha60fbc9_104
- icu=68.2=he49afe7_0
- idna=3.3=pyhd8ed1ab_0
- importlib-metadata=4.11.3=py37hf985489_1
- ipykernel=6.9.1=py37h4c52d7d_0
- ipython=7.32.0=py37hf985489_0
- ipython_genutils=0.2.0=py_1
Expand Down Expand Up @@ -131,6 +134,8 @@ dependencies:
- markupsafe=2.1.0=py37h69ee0a8_1
- matplotlib-base=3.5.1=py37h3147e9e_0
- matplotlib-inline=0.1.3=pyhd8ed1ab_0
- mergedeep=1.3.4=pyhd8ed1ab_0
- mike=1.1.2=pyhd8ed1ab_0
- mistune=0.8.4=py37h271585c_1005
- munch=2.5.0=py_0
- munkres=1.1.4=pyh9f0ad1d_0
Expand Down Expand Up @@ -168,6 +173,7 @@ dependencies:
- prompt_toolkit=3.0.27=hd8ed1ab_0
- pthread-stubs=0.4=hc929b4f_1001
- ptyprocess=0.7.0=pyhd3deb0d_0
- pyaml=21.10.1=pyhd8ed1ab_0
- pycparser=2.21=pyhd8ed1ab_0
- pydantic=1.9.0=py37h271585c_0
- pygments=2.11.2=pyhd8ed1ab_0
Expand All @@ -186,6 +192,7 @@ dependencies:
- python_abi=3.7=2_cp37m
- pytz=2021.1=pyhd8ed1ab_0
- pyyaml=5.4.1=py37h271585c_1
- pyyaml-env-tag=0.1=pyhd8ed1ab_0
- pyzmq=22.3.0=py37h8f778e5_1
- qt=5.12.9=h126340a_4
- qtconsole=5.2.2=pyhd8ed1ab_1
Expand Down Expand Up @@ -216,6 +223,7 @@ dependencies:
- tzdata=2021e=he74cb21_0
- unicodedata2=14.0.0=py37h271585c_0
- urllib3=1.26.8=pyhd8ed1ab_1
- verspec=0.1.0=pyhd8ed1ab_0
- wcwidth=0.2.5=pyh9f0ad1d_2
- webencodings=0.5.1=py_1
- wheel=0.37.1=pyhd8ed1ab_0
Expand Down Expand Up @@ -246,15 +254,12 @@ dependencies:
- filelock==3.6.0
- flake8==4.0.1
- fontawesome-markdown==0.2.6
- ghp-import==2.0.2
- identify==2.4.11
- imagesize==1.3.0
- importlib-metadata==4.2.0
- iniconfig==1.1.1
- jsbeautifier==1.14.0
- markdown==3.3.4
- mccabe==0.6.1
- mergedeep==1.3.4
- mkdocs==1.2.3
- mkdocs-autorefs==0.4.1
- mkdocs-awesome-pages-plugin==2.7.0
Expand All @@ -279,8 +284,8 @@ dependencies:
- pyflakes==2.4.0
- pymdown-extensions==9.2
- pytest==7.0.1
- pytest-mock==3.7.0
- pytkdocs==0.16.1
- pyyaml-env-tag==0.1
- recommonmark==0.7.1
- snowballstemmer==2.2.0
- soupsieve==2.3.1
Expand Down
6 changes: 6 additions & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ theme:
plugins:
- autorefs
- awesome-pages
- mike
- mkdocstrings:
default_handler: python
enable_inventory: true
Expand Down Expand Up @@ -57,6 +58,11 @@ plugins:
- tm2py
- search

extra:
version:
provider: mike
default: latest

extra_javascript:
- https://unpkg.com/[email protected]/dist/mermaid.min.js

Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ geopandas > 0.8.0
jsonschema
jupyter
lark-parser
mike
mkdocs
mkdocs-autorefs
mkdocs-awesome-pages-plugin
Expand Down
Loading

0 comments on commit 0367b85

Please sign in to comment.