diff --git a/.github/workflows/assets.yml b/.github/workflows/assets.yml index e301078..00b7344 100644 --- a/.github/workflows/assets.yml +++ b/.github/workflows/assets.yml @@ -20,7 +20,7 @@ jobs: uv sync -U - name: Update assets run: | - uv run --with httpx update_assets.py + uv run update_assets.py - name: Create PR env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/docs/requirements.txt b/docs/requirements.txt index 54ea550..f7afd61 100644 --- a/docs/requirements.txt +++ b/docs/requirements.txt @@ -2,13 +2,14 @@ # uv export --group=docs --no-hashes --output-file=docs/requirements.txt -e . accessible-pygments==0.0.5 -alabaster==0.7.16 -anyio==4.6.2.post1 +alabaster==0.7.16 ; python_full_version < '3.10' +alabaster==1.0.0 ; python_full_version >= '3.10' +anyio==4.8.0 babel==2.16.0 -beautifulsoup4==4.9.3 -certifi==2024.8.30 -charset-normalizer==3.4.0 -click==8.1.7 +beautifulsoup4==4.12.3 +certifi==2024.12.14 +charset-normalizer==3.4.1 +click==8.1.8 colorama==0.4.6 docutils==0.21.2 exceptiongroup==1.2.2 ; python_full_version < '3.11' @@ -17,22 +18,24 @@ h11==0.14.0 idna==3.10 imagesize==1.4.1 importlib-metadata==8.5.0 ; python_full_version < '3.10' -jinja2==3.1.4 +jinja2==3.1.5 markdown-it-py==3.0.0 markupsafe==3.0.2 mdit-py-plugins==0.4.2 mdurl==0.1.2 -myst-parser==3.0.1 +myst-parser==3.0.1 ; python_full_version < '3.10' +myst-parser==4.0.0 ; python_full_version >= '3.10' packaging==24.2 -pydata-sphinx-theme==0.16.0 -pygments==2.18.0 +pydata-sphinx-theme==0.16.1 +pygments==2.19.1 python-dotenv==1.0.1 pyyaml==6.0.2 requests==2.32.3 sniffio==1.3.1 snowballstemmer==2.2.0 soupsieve==2.6 -sphinx==7.4.7 +sphinx==7.4.7 ; python_full_version < '3.10' +sphinx==8.1.3 ; python_full_version >= '3.10' sphinx-autobuild==2024.10.3 sphinx-basic-ng==1.0.0b2 sphinx-rtd-theme==3.0.2 @@ -44,11 +47,11 @@ sphinxcontrib-jquery==4.1 sphinxcontrib-jsmath==1.0.1 sphinxcontrib-qthelp==2.0.0 sphinxcontrib-serializinghtml==2.0.0 -starlette==0.41.3 +starlette==0.45.2 tomli==2.2.1 ; python_full_version < '3.11' typing-extensions==4.12.2 -urllib3==2.2.3 -uvicorn==0.32.1 -watchfiles==1.0.0 +urllib3==2.3.0 +uvicorn==0.34.0 +watchfiles==1.0.3 websockets==14.1 zipp==3.21.0 ; python_full_version < '3.10' diff --git a/pyproject.toml b/pyproject.toml index e576930..300a4b4 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "sphinx-docsearch" -version = "0.2.0b1" +version = "0.2.0b2" description = "A Sphinx extension for replacing the built-in search with Algolia DocSearch" readme = "README.md" authors = [ diff --git a/src/sphinx_docsearch/static/docsearch_config.js_t b/src/sphinx_docsearch/static/docsearch_config.js_t index 2097248..928903a 100644 --- a/src/sphinx_docsearch/static/docsearch_config.js_t +++ b/src/sphinx_docsearch/static/docsearch_config.js_t @@ -13,11 +13,11 @@ docsearch({ searchParameters: {{ docsearch_search_parameters | tojson }}, {%- endif %} {%- if docsearch_max_results_per_group %} - maxResultsPerGroup: {{ docsearch_max_results_per_group }} + maxResultsPerGroup: {{ docsearch_max_results_per_group }}, {%- endif %} {%- if docsearch_missing_results_url %} getMissingResultsUrl({ query }) { return `{{ docsearch_missing_results_url }}` - } + }, {%- endif %} }); diff --git a/tests/test_builder.py b/tests/test_builder.py index dcfc7a1..3a034ef 100644 --- a/tests/test_builder.py +++ b/tests/test_builder.py @@ -9,7 +9,7 @@ @pytest.mark.sphinx("html", confoverrides={"extensions": ["sphinx_docsearch"]}) def test_no_builtin_search(app: Sphinx) -> None: - """It adds all the DocSearch assets to the HTML output.""" + """It doesn't add the builtin search assets to the HTML output.""" app.build() assert app.builder.search is False # type: ignore assert not os.path.exists(Path(app.outdir) / "search.html") diff --git a/tests/test_config.py b/tests/test_config.py index c9411d5..e7a5b0f 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -12,7 +12,7 @@ def test_returns_version() -> None: """It returns the correct version.""" - assert sphinx_docsearch.__version__ == "0.2.0b1" + assert sphinx_docsearch.__version__ == "0.2.0b2" @pytest.mark.sphinx("html", confoverrides={"extensions": ["sphinx_docsearch"]}) diff --git a/tests/test_dom.py b/tests/test_dom.py index 8aa262c..a5fc4fb 100644 --- a/tests/test_dom.py +++ b/tests/test_dom.py @@ -16,7 +16,7 @@ }, ) def test_no_builtin_search(app: Sphinx) -> None: - """It adds all the DocSearch assets to the HTML output.""" + """It adds the docsearch container to the DOM.""" app.build() test_file = read_as_html(Path(app.outdir) / "index.html") diff --git a/update_assets.py b/update_assets.py index 0bce561..2c754ff 100644 --- a/update_assets.py +++ b/update_assets.py @@ -1,3 +1,9 @@ +# /// script +# dependencies = [ +# "httpx", +# ] +# /// + """Update DocSearch assets from jsDelivr. This extension bundles the JavaScript and CSS for DocSearch. diff --git a/uv.lock b/uv.lock index 58b9a47..2c3d5df 100644 --- a/uv.lock +++ b/uv.lock @@ -43,7 +43,7 @@ wheels = [ [[package]] name = "anyio" -version = "4.7.0" +version = "4.8.0" source = { registry = "https://pypi.org/simple" } dependencies = [ { name = "exceptiongroup", marker = "python_full_version < '3.11'" }, @@ -51,9 +51,9 @@ dependencies = [ { name = "sniffio" }, { name = "typing-extensions", marker = "python_full_version < '3.13'" }, ] -sdist = { url = "https://files.pythonhosted.org/packages/f6/40/318e58f669b1a9e00f5c4453910682e2d9dd594334539c7b7817dabb765f/anyio-4.7.0.tar.gz", hash = "sha256:2f834749c602966b7d456a7567cafcb309f96482b5081d14ac93ccd457f9dd48", size = 177076 } +sdist = { url = "https://files.pythonhosted.org/packages/a3/73/199a98fc2dae33535d6b8e8e6ec01f8c1d76c9adb096c6b7d64823038cde/anyio-4.8.0.tar.gz", hash = "sha256:1d9fe889df5212298c0c0723fa20479d1b94883a2df44bd3897aa91083316f7a", size = 181126 } wheels = [ - { url = "https://files.pythonhosted.org/packages/a0/7a/4daaf3b6c08ad7ceffea4634ec206faeff697526421c20f07628c7372156/anyio-4.7.0-py3-none-any.whl", hash = "sha256:ea60c3723ab42ba6fff7e8ccb0488c898ec538ff4df1f1d5e642c3601d07e352", size = 93052 }, + { url = "https://files.pythonhosted.org/packages/46/eb/e7f063ad1fec6b3178a3cd82d1a3c4de82cccf283fc42746168188e1cdd5/anyio-4.8.0-py3-none-any.whl", hash = "sha256:b5011f270ab5eb0abf13385f851315585cc37ef330dd88e27ec3d34d651fd47a", size = 96041 }, ] [[package]] @@ -630,11 +630,11 @@ wheels = [ [[package]] name = "pygments" -version = "2.18.0" +version = "2.19.1" source = { registry = "https://pypi.org/simple" } -sdist = { url = "https://files.pythonhosted.org/packages/8e/62/8336eff65bcbc8e4cb5d05b55faf041285951b6e80f33e2bff2024788f31/pygments-2.18.0.tar.gz", hash = "sha256:786ff802f32e91311bff3889f6e9a86e81505fe99f2735bb6d60ae0c5004f199", size = 4891905 } +sdist = { url = "https://files.pythonhosted.org/packages/7c/2d/c3338d48ea6cc0feb8446d8e6937e1408088a72a39937982cc6111d17f84/pygments-2.19.1.tar.gz", hash = "sha256:61c16d2a8576dc0649d9f39e089b5f02bcd27fba10d8fb4dcc28173f7a45151f", size = 4968581 } wheels = [ - { url = "https://files.pythonhosted.org/packages/f7/3f/01c8b82017c199075f8f788d0d906b9ffbbc5a47dc9918a945e13d5a2bda/pygments-2.18.0-py3-none-any.whl", hash = "sha256:b8e6aca0523f3ab76fee51799c488e38782ac06eafcf95e7ba832985c8e7b13a", size = 1205513 }, + { url = "https://files.pythonhosted.org/packages/8a/0b/9fcc47d19c48b59121088dd6da2488a49d5f72dacf8262e2790a1d2c7d15/pygments-2.19.1-py3-none-any.whl", hash = "sha256:9ea1544ad55cecf4b8242fab6dd35a93bbce657034b0611ee383099054ab6d8c", size = 1225293 }, ] [[package]] @@ -905,7 +905,7 @@ wheels = [ [[package]] name = "sphinx-docsearch" -version = "0.2.0b1" +version = "0.2.0b2" source = { editable = "." } dependencies = [ { name = "sphinx", version = "7.4.7", source = { registry = "https://pypi.org/simple" }, marker = "python_full_version < '3.10'" },