From 88b28d8f762ab18f5996fca35e940121feca4b0a Mon Sep 17 00:00:00 2001 From: Shengyu Zhang Date: Sun, 19 Apr 2026 11:12:45 +0800 Subject: [PATCH] chore: Update project template to sphinx-notes/cookiecutter@4c6b17ae --- .cruft.json | 4 ++-- .github/workflows/test.yml | 11 ++++++++++- Makefile | 6 +++++- docs/conf.py | 6 ++++-- tests/test_always_pass.py | 9 +++++++++ 5 files changed, 30 insertions(+), 6 deletions(-) create mode 100644 tests/test_always_pass.py diff --git a/.cruft.json b/.cruft.json index fb8e1bc..f136678 100644 --- a/.cruft.json +++ b/.cruft.json @@ -1,6 +1,6 @@ { "template": "https://github.com/sphinx-notes/cookiecutter", - "commit": "634c4022e575bd086ea47f3b42feafe24e14a939", + "commit": "4c6b17aec1a4b8ddca95c4882c6bed2bc230d595", "checkout": null, "context": { "cookiecutter": { @@ -20,7 +20,7 @@ "sphinx_version": "7.0", "development_status": "3 - Alpha", "_template": "https://github.com/sphinx-notes/cookiecutter", - "_commit": "634c4022e575bd086ea47f3b42feafe24e14a939" + "_commit": "4c6b17aec1a4b8ddca95c4882c6bed2bc230d595" } }, "directory": null diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 638156d..7f56f2c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -12,5 +12,14 @@ jobs: - uses: actions/setup-python@v5 with: python-version-file: 'pyproject.toml' - - run: python3 -m pip install .[dev] + - run: python3 -m pip install .[test] - run: make test + doctest: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - uses: actions/setup-python@v5 + with: + python-version-file: 'pyproject.toml' + - run: python3 -m pip install .[docs] + - run: make doctest diff --git a/Makefile b/Makefile index 06a9e9d..6e7539a 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,11 @@ fmt: .PHONY: test test: - $(PY) -m unittest discover -s tests -v + $(PY) -m pytest tests/ -v + +.PHONY: doctest +doctest: + $(MAKE) doctest -C docs/ ################################################################################ # Distribution Package diff --git a/docs/conf.py b/docs/conf.py index 9e3af40..fc2b8be 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -23,6 +23,8 @@ # ones. extensions = [ 'sphinx.ext.githubpages', + 'sphinx.ext.doctest', + 'sphinx.ext.viewcode', 'sphinx_design', 'sphinx_copybutton', 'sphinx_last_updated_by_git', @@ -114,8 +116,8 @@ # documentation root, use os.path.abspath to make it absolute, like shown here. import os import sys -sys.path.insert(0, os.path.abspath('../src/sphinxnotes')) -extensions.append('any') +sys.path.insert(0, os.path.abspath('../src/')) +extensions.append('sphinxnotes.any') # CUSTOM CONFIGURATION diff --git a/tests/test_always_pass.py b/tests/test_always_pass.py new file mode 100644 index 0000000..9a05eb7 --- /dev/null +++ b/tests/test_always_pass.py @@ -0,0 +1,9 @@ +# This file is generated from sphinx-notes/cookiecutter. +# DO NOT EDIT. + +import unittest + + +class TestAlwaysPass(unittest.TestCase): + def test_dummy(self): + self.assertTrue(True)