diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..8452ef0 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,12 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: monthly + assignees: + - "ezio-melotti" + groups: + actions: + patterns: + - "*" diff --git a/.github/workflows/documentation-links.yml b/.github/workflows/documentation-links.yml new file mode 100644 index 0000000..f05df37 --- /dev/null +++ b/.github/workflows/documentation-links.yml @@ -0,0 +1,27 @@ +name: Read the Docs PR preview +# Automatically edits a pull request's descriptions with a link +# to the documentation's preview on Read the Docs. + +on: + pull_request_target: + types: + - opened + paths: + - 'Doc/**' + - '.github/workflows/doc.yml' + +permissions: + pull-requests: write + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + documentation-links: + runs-on: ubuntu-latest + steps: + - uses: readthedocs/actions/preview@v1 + with: + project-slug: "python-docs-theme-previews" + single-version: "true" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 8509763..88c0c7c 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -14,7 +14,7 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: "3.x" - - uses: pre-commit/action@v3.0.0 + - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/pypi-package.yml b/.github/workflows/pypi-package.yml index 355a35f..c7acc05 100644 --- a/.github/workflows/pypi-package.yml +++ b/.github/workflows/pypi-package.yml @@ -20,14 +20,16 @@ jobs: steps: - uses: actions/checkout@v4 - - uses: hynek/build-and-inspect-python-package@v1 + - uses: hynek/build-and-inspect-python-package@v2 # Upload to real PyPI on GitHub Releases. release-pypi: name: Publish to PyPI environment: release-pypi # Only run for published releases. - if: github.repository_owner == 'python' && github.event.action == 'published' + if: | + github.repository_owner == 'python' + && github.event.action == 'published' runs-on: ubuntu-latest needs: build-package @@ -36,7 +38,7 @@ jobs: steps: - name: Download packages built by build-and-inspect-python-package - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: Packages path: dist diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9407ac7..1b58d3e 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -12,10 +12,10 @@ jobs: strategy: fail-fast: false matrix: - branch: ["origin/main", "3.12", "3.11", "3.10", "3.9", "3.8"] + branch: ["origin/main", "3.12", "3.11", "3.10"] steps: - uses: actions/checkout@v4 - - uses: actions/setup-python@v4 + - uses: actions/setup-python@v5 with: python-version: 3 allow-prereleases: true @@ -44,7 +44,7 @@ jobs: run: | cat ./logs/docsbuild.log - name: Upload - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: - name: doc-html + name: doc-html-${{ matrix.branch }} path: www/ diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 008784c..70b4e19 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -6,18 +6,17 @@ repos: args: [--py38-plus] - repo: https://github.com/psf/black-pre-commit-mirror - rev: 23.9.1 + rev: 24.1.1 hooks: - id: black - repo: https://github.com/PyCQA/isort - rev: 5.12.0 + rev: 5.13.2 hooks: - id: isort - args: [--add-import=from __future__ import annotations] - repo: https://github.com/PyCQA/flake8 - rev: 6.1.0 + rev: 7.0.0 hooks: - id: flake8 additional_dependencies: @@ -32,19 +31,28 @@ repos: rev: v4.5.0 hooks: - id: check-case-conflict - - id: check-executables-have-shebangs - id: check-merge-conflict - - id: check-json - id: check-toml - id: check-yaml - id: debug-statements - id: end-of-file-fixer - id: trailing-whitespace + - repo: https://github.com/tox-dev/pyproject-fmt + rev: 1.7.0 + hooks: + - id: pyproject-fmt + args: [--max-supported-python=3.13] + - repo: https://github.com/abravalheri/validate-pyproject - rev: v0.14 + rev: v0.16 hooks: - id: validate-pyproject + - repo: meta + hooks: + - id: check-hooks-apply + - id: check-useless-excludes + ci: autoupdate_schedule: quarterly diff --git a/CHANGELOG.rst b/CHANGELOG.rst index 0b02c3f..07f7d4c 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,14 @@ Changelog ========= +`2024.3 `_ +---------------------------------------------------------------------------- + +- Modernise font: use system font stack to improve text readability and webpage performance (#174) + Contributed by Hugo van Kemenade +- Remove incorrect CSS property (#178) + Contributed by Kerim Kabirov + `2024.2 `_ ---------------------------------------------------------------------------- @@ -40,7 +48,7 @@ Changelog `2023.7 `_ ---------------------------------------------------------------------------- -- Fix compatability with Sphinx 7.1 (#137) +- Fix compatibility with Sphinx 7.1 (#137) Contributed by Pradyun Gedam - Enable the slash keypress to focus the search field (#141) Contributed by Mike Fiedler diff --git a/pyproject.toml b/pyproject.toml index dd228f4..fc5f551 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -6,7 +6,7 @@ requires = [ [project] name = "python-docs-theme" -version = "2024.2" +version = "2024.3" description = "The Sphinx theme for the CPython docs and related projects" readme = "README.rst" license.file = "LICENSE" @@ -43,3 +43,7 @@ name = "python_docs_theme" include = [ "python_docs_theme/", ] + +[tool.isort] +add_imports = "from __future__ import annotations" +profile = "black" diff --git a/python_docs_theme/static/pydoctheme.css b/python_docs_theme/static/pydoctheme.css index 87a0629..39c4e33 100644 --- a/python_docs_theme/static/pydoctheme.css +++ b/python_docs_theme/static/pydoctheme.css @@ -170,7 +170,7 @@ div.sphinxsidebar a:hover { form.inline-search input, div.sphinxsidebar input, div.related input { - font-family: 'Lucida Grande', Arial, sans-serif; + font-family: -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif; border: 1px solid #999999; font-size: smaller; border-radius: 3px; @@ -258,7 +258,7 @@ div.body a:hover { } tt, code, pre { - font-family: ui-monospace, "Cascadia Mono", "Segoe UI Mono", "Liberation Mono", Menlo, Monaco, Consolas, monospace; + font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; font-size: 96.5%; } @@ -361,8 +361,7 @@ div.genindex-jumpbox a { position: absolute; top: 0; right: 0; - text-size: 75%; - font-family: monospace; + font-family: Menlo, Consolas, Monaco, Liberation Mono, Lucida Console, monospace; padding-left: 0.2em; padding-right: 0.2em; border-radius: 0 3px 0 0; diff --git a/python_docs_theme/theme.conf b/python_docs_theme/theme.conf index 1fbcabc..5edf397 100644 --- a/python_docs_theme/theme.conf +++ b/python_docs_theme/theme.conf @@ -5,8 +5,8 @@ pygments_style = default pygments_dark_style = monokai [options] -bodyfont = 'Lucida Grande', Arial, sans-serif -headfont = 'Lucida Grande', Arial, sans-serif +bodyfont = -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif +headfont = -apple-system, BlinkMacSystemFont, avenir next, avenir, segoe ui, helvetica neue, helvetica, Cantarell, Ubuntu, roboto, noto, arial, sans-serif footerbgcolor = white footertextcolor = #555555 relbarbgcolor = white