From d12448f41de72ad4b3d577833e7be04e6f0ab99e Mon Sep 17 00:00:00 2001 From: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> Date: Tue, 6 May 2025 13:20:39 +0300 Subject: [PATCH 1/4] Refactor test files and improve build processes Removed unused Python documentation-related test files, optimized TypeScript tests by updating message formatting utility and error handling, and enhanced Sphinx documentation targets in the Makefile. Fixed module alias usage in test setups and updated Renovate configuration for Python package managers. Signed-off-by: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> --- Makefile | 15 +++++++++++++++ renovate.json | 8 ++++++-- tests/docs/__init__.py | 0 tests/docs/test_docs.py | 41 ----------------------------------------- 4 files changed, 21 insertions(+), 43 deletions(-) delete mode 100644 tests/docs/__init__.py delete mode 100644 tests/docs/test_docs.py diff --git a/Makefile b/Makefile index 2638349..cf4ebc3 100644 --- a/Makefile +++ b/Makefile @@ -25,8 +25,23 @@ 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 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 + +# Update doc target to run doctests as part of documentation build +doc: doctest + uv run sphinx-build -M html docs/source docs/build/ -W --keep-going + +# Optional target that builds docs but ignores warnings +doc-ignore-warnings: + uv run sphinx-build -M html docs/source docs/build/ 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() From aa1905825d4d6e3c3bceb6817738adceb610b81c Mon Sep 17 00:00:00 2001 From: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> Date: Tue, 6 May 2025 13:33:00 +0300 Subject: [PATCH 2/4] Refactor Makefile and comment out deployment in docs workflow Reorganized Makefile targets for better clarity and functionality, adding a new `doc-build` target and updating `check-all` to include all checks. Commented out Signed-off-by: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> --- .github/workflows/docs.yml | 12 ++++++------ Makefile | 14 ++++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 80acd19..acc32e2 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -25,9 +25,9 @@ jobs: - 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 cf4ebc3..3a33b5a 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,8 @@ 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/ @@ -38,10 +39,11 @@ doc: doctest: uv run sphinx-build -M doctest docs/source docs/build/ -W --keep-going -# Update doc target to run doctests as part of documentation build -doc: doctest - uv run sphinx-build -M html docs/source docs/build/ -W --keep-going - # Optional target that builds docs but ignores warnings -doc-ignore-warnings: +doc-build: uv run sphinx-build -M html docs/source docs/build/ + + +doc: doctest doc-build + +check-all: check test mypy doc From 986b29539c2533c4c322b21f7434abb3b74cda82 Mon Sep 17 00:00:00 2001 From: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> Date: Tue, 6 May 2025 13:35:27 +0300 Subject: [PATCH 3/4] Update Python version in documentation workflow to 3.12 Signed-off-by: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index acc32e2..a3476df 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -20,7 +20,7 @@ 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 From 6ba8e3d8d231e306d514caf470fc00c68f0a94eb Mon Sep 17 00:00:00 2001 From: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> Date: Tue, 6 May 2025 13:45:48 +0300 Subject: [PATCH 4/4] Comment out html_static_path configuration in conf.py Signed-off-by: DanielAvdar <66269169+DanielAvdar@users.noreply.github.com> --- docs/source/conf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"]