diff --git a/.github/workflows/clean.yml b/.github/workflows/clean.yml new file mode 100644 index 00000000..5381a438 --- /dev/null +++ b/.github/workflows/clean.yml @@ -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 }} diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml deleted file mode 100644 index 8ec70b39..00000000 --- a/.github/workflows/docs.yml +++ /dev/null @@ -1,20 +0,0 @@ -name: Publish docs -on: - workflow_dispatch: - push: - branches: - - develop - -jobs: - mkdocs: - name: Publish docs - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v2 - - - name: Deploy docs - uses: mhausenblas/mkdocs-deploy-gh-pages@master - env: - REQUIREMENTS: requirements.txt - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml deleted file mode 100644 index baf8efc6..00000000 --- a/.github/workflows/publish.yml +++ /dev/null @@ -1,32 +0,0 @@ -# This workflow will upload a Python Package using Twine when a release is created -# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries - -name: Upload Python Package - -on: - release: - types: [created] - -jobs: - - deploy: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up Python - uses: actions/setup-python@v2 - with: - python-version: '3.7' - - name: Install dependencies - run: | - python -m pip install --upgrade pip - pip install setuptools wheel twine - - name: Build and publish - env: - TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} - TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} - run: | - python setup.py sdist bdist_wheel - twine upload dist/* diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml new file mode 100644 index 00000000..1c7ff27b --- /dev/null +++ b/.github/workflows/push.yml @@ -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 }} diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 00000000..574dd6d0 --- /dev/null +++ b/.github/workflows/release.yml @@ -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/* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index 7755bcd0..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: Python package - -on: [push] - -jobs: - build: - - runs-on: ubuntu-latest - strategy: - matrix: - python-version: [3.7, 3.8] - - steps: - - uses: actions/checkout@v2 - - 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: Install package - run: | - pip install -e .[test] - - name: Test with pytest - run: | - pytest -s -m "not skipci" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9233240d..16d171a3 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -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] diff --git a/docs/contributing/development.md b/docs/contributing/development.md index a29bc7ff..8bf524e6 100644 --- a/docs/contributing/development.md +++ b/docs/contributing/development.md @@ -1,6 +1,5 @@ # Development - ## Preparation ### Install Git diff --git a/docs/index.md b/docs/index.md index e69de29b..18d64985 100644 --- a/docs/index.md +++ b/docs/index.md @@ -0,0 +1,3 @@ +### For testing feature + +I am the the PR for branch: `test-deleting-ref` --> `versioned-docs` diff --git a/environment.yml b/environment.yml index c3545a0e..29b0c063 100644 --- a/environment.yml +++ b/environment.yml @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/mkdocs.yml b/mkdocs.yml index 7b083835..ddd68ed2 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -26,6 +26,7 @@ theme: plugins: - autorefs - awesome-pages + - mike - mkdocstrings: default_handler: python enable_inventory: true @@ -57,6 +58,11 @@ plugins: - tm2py - search +extra: + version: + provider: mike + default: latest + extra_javascript: - https://unpkg.com/mermaid@8.5.0/dist/mermaid.min.js diff --git a/requirements.txt b/requirements.txt index 76316bfd..3517632a 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,6 +7,7 @@ geopandas > 0.8.0 jsonschema jupyter lark-parser +mike mkdocs mkdocs-autorefs mkdocs-awesome-pages-plugin diff --git a/tests/README.md b/tests/README.md index bf02846e..865b9657 100644 --- a/tests/README.md +++ b/tests/README.md @@ -18,7 +18,13 @@ Install along with all development requirements (recommended): pip install -r dev-requirements.txt ``` -=== Conda +Install using PIP: + +```sh +pip install pytest +``` + +Install using Conda: ```sh conda install pytest