diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index 7eedef4c4..473bf0524 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -61,15 +61,14 @@ jobs: uses: actions/cache@v3.0.6 with: path: ${{ steps.prepare-cache-pip.outputs.cache-dir }} - key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/setup.cfg') }} + key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/pyproject.toml') }} restore-keys: | ${{ runner.os }}-${{ matrix.python-version }}-pip- - - name: install requirements.txt + - name: install broadbean & docs dependencies run: | - pip install -r requirements.txt - - name: install broadbean - run: pip install . + pip install -c requirements.txt .[docs,test] + # currently we are building api docs of the whole package including tests so we need to be able to import the tests and therefore require test dependencies to build the docs. - name: Build docs on linux run: | cd docs diff --git a/.github/workflows/pytest.yaml b/.github/workflows/pytest.yaml index e8d044c7a..c798bc1d3 100644 --- a/.github/workflows/pytest.yaml +++ b/.github/workflows/pytest.yaml @@ -44,15 +44,12 @@ jobs: uses: actions/cache@v3.0.6 with: path: ${{ steps.prepare-cache-pip.outputs.cache-dir }} - key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/setup.cfg') }} + key: ${{ runner.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/pyproject.toml') }} restore-keys: | ${{ runner.os }}-${{ matrix.python-version }}-pip- - - name: install requirements.txt + - name: install broadbean with test dependencies run: | - pip install -r requirements.txt - - name: install broadbean - run: | - pip install . + pip install .[test] -c requirements.txt - name: Run Mypy run: mypy -p broadbean - name: Run tests diff --git a/pyproject.toml b/pyproject.toml index 6318e0ba8..24a6fbcc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,12 @@ test = [ "jupyter>=1.0.0", "hypothesis>=5.49.0", ] +docs = [ + "sphinx", + "sphinx_rtd_theme", + "nbsphinx", + "sphinx-jsonschema", +] [tool.pytest.ini_options]