From 294bec7ddb2d8daacb8c901f3b001a705df01514 Mon Sep 17 00:00:00 2001 From: abhiabhi94 <13880786+abhiabhi94@users.noreply.github.com> Date: Sun, 20 Feb 2022 18:52:08 +0530 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20documentation=20build?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - add environment in tox and github actions for documentation build. --- .github/workflows/test.yml | 28 ++++++++++++++++++++++++---- docs/requirements.txt | 1 + pyproject.toml | 3 --- tox.ini | 16 +++++++++++++++- 4 files changed, 40 insertions(+), 8 deletions(-) create mode 100644 docs/requirements.txt diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c86d16..aca0a35 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -29,10 +29,6 @@ jobs: restore-keys: | ${{ runner.os }}-pip- - - name: Ensure latest pip - run: | - python -m pip install --upgrade pip wheel - - name: Install dependencies run: | python -m pip install tox @@ -42,6 +38,30 @@ jobs: python -m tox --version python -m tox -e lint + docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.10' + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - name: Install dependencies + run: | + python -m pip install tox + - name: Build docs + run: | + python -m tox --version + python -m tox -e docs + tests: name: Python ${{ matrix.python-version }} runs-on: ubuntu-latest diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 0000000..a95ae18 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1 @@ +furo diff --git a/pyproject.toml b/pyproject.toml index f2f98fa..901c1df 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -76,6 +76,3 @@ source = [ [tool.coverage.report] show_missing = true skip_covered = true - -[upload_sphinx] -upload-dir = "docs/_build/html" diff --git a/tox.ini b/tox.ini index 6e73272..ea8abdd 100644 --- a/tox.ini +++ b/tox.ini @@ -5,7 +5,7 @@ envlist = py38-dj{22, 30, 31, 32, main} py39-dj{22, 30, 31, 32, main} py310-dj{main} - lint + lint, docs [gh-actions] python = @@ -20,6 +20,20 @@ deps = commands = flake8 hitcount tests {posargs} +[testenv:docs] +deps = + sphinx + furo +allowlist_externals = + poetry + test + make +changedir = + docs +commands = + python -m pip install -U pip poetry + poetry run make html + [testenv] deps = dj22: Django>=2.2,<2.3