diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 80acd19..a3476df 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,14 +20,14 @@ jobs: - uses: astral-sh/setup-uv@v6 with: enable-cache: true - - run: uv python install 3.11 + - run: uv python install 3.12 - run: make install-docs - run: make doc - - name: Deploy - uses: peaceiris/actions-gh-pages@v4 - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - publish_dir: ./docs/build - keep_files: true +# - name: Deploy +# uses: peaceiris/actions-gh-pages@v4 +# with: +# github_token: ${{ secrets.GITHUB_TOKEN }} +# publish_dir: ./docs/build +# keep_files: true diff --git a/Makefile b/Makefile index 2638349..3a33b5a 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,25 @@ check: coverage: uv run pytest --cov=my_pkg --cov-report=xml # todo: change my_pkg to the actual package name +cov: + uv run pytest --cov=my_pkg --cov-report=term-missing # todo: change my_pkg to the actual package name + mypy: - uv tool run mypy my_pkg --config-file pyproject.toml # todo: chanege my_pkg to the actual package name + uv tool run mypy my_pkg --config-file pyproject.toml +# todo: chanege my_pkg to the actual package name doc: uv run sphinx-build -M html docs/source docs/build/ + + +doctest: + uv run sphinx-build -M doctest docs/source docs/build/ -W --keep-going + +# Optional target that builds docs but ignores warnings +doc-build: + uv run sphinx-build -M html docs/source docs/build/ + + +doc: doctest doc-build + +check-all: check test mypy doc diff --git a/docs/source/conf.py b/docs/source/conf.py index f0b3e1d..c470603 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -42,4 +42,4 @@ html_theme = "sphinx_rtd_theme" master_doc = "index" -html_static_path = ["_static"] +# html_static_path = ["_static"] diff --git a/renovate.json b/renovate.json index 27facec..661e8dd 100644 --- a/renovate.json +++ b/renovate.json @@ -42,10 +42,14 @@ }, { "matchManagers": [ - "pep621", "pep723" + "pip-compile", + "pip_requirements", + "pip_setup", + "pipenv", + "poetry" ], "labels": [ - "uv-lock", + "python", "renovate" ] } diff --git a/tests/docs/__init__.py b/tests/docs/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/tests/docs/test_docs.py b/tests/docs/test_docs.py deleted file mode 100644 index 7a4f463..0000000 --- a/tests/docs/test_docs.py +++ /dev/null @@ -1,41 +0,0 @@ -from pathlib import Path - -import pytest -from sybil import Sybil -from sybil.parsers.codeblock import PythonCodeBlockParser -from sybil.parsers.doctest import DocTestParser - - -def collect_examples(folder_name): - docs_folder_path = Path(__file__).parent.parent.parent / "docs" / "source" - models_folder_path = docs_folder_path / folder_name - assert docs_folder_path.exists(), f"Docs path doesn't exist: {docs_folder_path.resolve()}" - - all_rst_files = list(docs_folder_path.glob("*.rst")) - all_rst_files.extend(list(models_folder_path.glob("*.rst"))) - print(f"Found {len(all_rst_files)} .rst files in docs folder.") - # Configure Sybil - sybil = Sybil( - parsers=[ - DocTestParser(), - PythonCodeBlockParser(), - ], - pattern="*.rst", - path=docs_folder_path.as_posix(), - ) - examples_list = [] - for f_path in all_rst_files: - document_ = sybil.parse(f_path) - - examples_ = list(document_) - examples_files = [e.path for e in examples_] - examples_start_lines = [e.start for e in examples_] - - examples_list.extend(zip(examples_files, examples_start_lines, examples_)) - # examples_list=[example for example in examples_] - return examples_list - - -@pytest.mark.parametrize("file_path, line, example", collect_examples("")) -def test_doc_examples(file_path, line, example): - example.evaluate()