diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4c715e..7a873fc 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -10,9 +10,13 @@ jobs: runs-on: ubuntu-latest strategy: matrix: - # Builds are failing with py3.9+ because sphinx templates are different. - # python: ['3.7', '3.8', '3.9', '3.10', '3.11'] - python: ['3.7', '3.8'] + python: + - '3.7' + - '3.8' + - '3.9' + - '3.10' + - 'latest' # hardcoded below as '3.11' + - 'beta' # hardcoded below as '3.12' fail-fast: false permissions: @@ -23,7 +27,8 @@ jobs: - uses: actions/setup-python@v4 with: - python-version: ${{ matrix.python }} + python-version: ${{ matrix.python == 'latest' && '3.11' || (matrix.python == 'beta' && '3.12' || matrix.python) }} + allow-prereleases: true - name: Install tools run: | @@ -41,28 +46,29 @@ jobs: cd test find . -name '*.html' -exec rm {} \; - sed -i 's~, "log\.md"~~' conf.py - make html SPHINXOPTS='' 2>&1 | tee log.txt + sed -i 's~, "logging\.md"~~' conf.py + make html SPHINXOPTS='' 2>&1 | tee baseline.txt git restore conf.py (cd _build/html && rm genindex.html index.html search.html php-modindex.html) (cd _build/html && find . -name '*.html' -exec sh -c 'xmllint {} --xpath '"'"'//div[@role="main"]'"'"' | xmllint --format - > ../../{}' \;) - sed -i -r 's~.*/(test/)~\1~;t;d' log.txt + sed -i -r 's~[^:]*/(test/)~\1~;t;d' baseline.txt - name: Apply Coding Style - if: matrix.python == '3.11' + if: matrix.python == 'latest' run: | pip install black python -m black . - name: Diff Unit Tests Output and Coding Style + if: matrix.python == 'latest' run: | cd test rm -r _build git add . -N && git diff --exit-code - name: Push Unit Tests Output - if: failure() && github.repository_owner != 'markstory' && matrix.python == '3.11' + if: failure() && github.repository_owner != 'markstory' && matrix.python == 'latest' uses: stefanzweifel/git-auto-commit-action@v4 with: branch: ${{ github.head_ref || github.ref_name }}.changes @@ -78,7 +84,7 @@ jobs: cd test make html SPHINXOPTS='-W' - sed -i 's~, "log\.md"~~' conf.py + sed -i 's~, "logging\.md"~~' conf.py ! make html SPHINXOPTS='-W' || (echo 'Unexpected zero exit code'; false) git restore conf.py diff --git a/setup.py b/setup.py index e6039e2..8d048f8 100644 --- a/setup.py +++ b/setup.py @@ -28,14 +28,14 @@ """ setup( - name='sphinxcontrib-phpdomain', - version='0.11.2', - url='https://github.com/markstory/sphinxcontrib-phpdomain', - download_url='http://pypi.python.org/pypi/sphinxcontrib-phpdomain', - license='BSD', - author='Mark Story', - author_email='mark@mark-story.com', - description='Sphinx extension to enable documenting PHP code', + name="sphinxcontrib-phpdomain", + version="0.11.2", + url="https://github.com/markstory/sphinxcontrib-phpdomain", + download_url="http://pypi.python.org/pypi/sphinxcontrib-phpdomain", + license="BSD", + author="Mark Story", + author_email="mark@mark-story.com", + description="Sphinx extension to enable documenting PHP code", long_description=long_desc, project_urls={ "Documentation": "https://markstory.github.io/sphinxcontrib-phpdomain/", diff --git a/sphinxcontrib/phpdomain.py b/sphinxcontrib/phpdomain.py index 8dc5e84..3594de3 100644 --- a/sphinxcontrib/phpdomain.py +++ b/sphinxcontrib/phpdomain.py @@ -1,6 +1,6 @@ """ Sphinx PHP domain. - + The PHP domain. Based off of the rubydomain by SHIBUKAWA Yoshiki :copyright: Copyright 2016 by Mark Story diff --git a/test/log.txt b/test/baseline.txt similarity index 53% rename from test/log.txt rename to test/baseline.txt index 12ca82b..2c680ef 100644 --- a/test/log.txt +++ b/test/baseline.txt @@ -1,9 +1,9 @@ -test/log.md:3: WARNING: Unknown directive type: 'php:namespacee' [myst.directive_unknown] -test/log.md:8: WARNING: [phpdomain] Invalid signature -test/log.md:13: [phpdomain] Target Foo\Aa not found -test/log.md:15: [phpdomain] Target Foo\A::simplifyy not found -test/log.md:20: [phpdomain] Target Foo\Foo\A::simplify not found - did you mean to write A::simplify? -test/log.md:25: [phpdomain] Target Fooo\Foo\A::simplify not found - did you mean to write \Foo\A::simplify? +test/logging.md:3: WARNING: Unknown directive type: 'php:namespacee' [myst.directive_unknown] +test/logging.md:8: WARNING: [phpdomain] Invalid signature +test/logging.md:13: [phpdomain] Target Foo\Aa not found +test/logging.md:15: [phpdomain] Target Foo\A::simplifyy not found +test/logging.md:20: [phpdomain] Target Foo\Foo\A::simplify not found - did you mean to write A::simplify? +test/logging.md:25: [phpdomain] Target Fooo\Foo\A::simplify not found - did you mean to write \Foo\A::simplify? test/ns.md:48: [phpdomain] Target A2::simplify not found test/ns.md:53: [phpdomain] Target Bar2\A::simplify not found test/rst_doc.md:506: [phpdomain] Target OtherLibrary\int|string|ReturnedClass|\LibraryName\SubPackage\SubpackageInterface|null not found diff --git a/test/conf.py b/test/conf.py index 2be6ab3..208bb41 100644 --- a/test/conf.py +++ b/test/conf.py @@ -12,6 +12,6 @@ source_suffix = ".md" master_doc = "index" -exclude_patterns = ["_build", "log.md"] +exclude_patterns = ["_build", "logging.md"] html_theme = "default" diff --git a/test/log.html b/test/logging.html similarity index 83% rename from test/log.html rename to test/logging.html index b6a2cb3..f9ff0e9 100644 --- a/test/log.html +++ b/test/logging.html @@ -1,10 +1,10 @@
-

Invalid domain type

+

Invalid domain type

-

Invalid signature

+

Invalid signature

@@ -15,7 +15,7 @@

Invalid signature -

Unresolved references

+

Unresolved references

  • @@ -32,8 +32,7 @@

    Unresolved references

- -
-

Cross linking

+

Cross linking