| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,2 @@ | |||
| 1 | + [flake8] | ||
| 2 | + max-line-length = 88 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,20 @@ | |||
| 1 | + name: Lint | ||
| 2 | + | ||
| 3 | + on: [push, pull_request, workflow_dispatch] | ||
| 4 | + | ||
| 5 | + env: | ||
| 6 | + FORCE_COLOR: 1 | ||
| 7 | + | ||
| 8 | + permissions: | ||
| 9 | + contents: read | ||
| 10 | + | ||
| 11 | + jobs: | ||
| 12 | + lint: | ||
| 13 | + runs-on: ubuntu-latest | ||
| 14 | + | ||
| 15 | + steps: | ||
| 16 | + - uses: actions/checkout@v4 | ||
| 17 | + - uses: actions/setup-python@v4 | ||
| 18 | + with: | ||
| 19 | + python-version: "3.x" | ||
| 20 | + - uses: pre-commit/action@v3.0.0 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,7 +18,7 @@ jobs: | |||
| 18 | 18 | runs-on: ubuntu-latest | |
| 19 | 19 | ||
| 20 | 20 | steps: | |
| 21 | - - uses: actions/checkout@v3 | ||
| 21 | + - uses: actions/checkout@v4 | ||
| 22 | 22 | ||
| 23 | 23 | - uses: hynek/build-and-inspect-python-package@v1 | |
| 24 | 24 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,22 +1,25 @@ | |||
| 1 | 1 | name: Tests | |
| 2 | 2 | ||
| 3 | - on: | ||
| 4 | - push: | ||
| 5 | - pull_request: | ||
| 6 | - workflow_dispatch: | ||
| 3 | + on: [push, pull_request, workflow_dispatch] | ||
| 4 | + | ||
| 5 | + env: | ||
| 6 | + FORCE_COLOR: 1 | ||
| 7 | 7 | ||
| 8 | 8 | jobs: | |
| 9 | 9 | build_doc: | |
| 10 | 10 | name: Build CPython docs | |
| 11 | 11 | runs-on: ubuntu-latest | |
| 12 | 12 | strategy: | |
| 13 | + fail-fast: false | ||
| 13 | 14 | matrix: | |
| 14 | - branch: [origin/main, 3.12, 3.11, '3.10', 3.9, 3.8] | ||
| 15 | + branch: ["origin/main", "3.12", "3.11", "3.10", "3.9", "3.8"] | ||
| 15 | 16 | steps: | |
| 16 | - - uses: actions/checkout@v3 | ||
| 17 | + - uses: actions/checkout@v4 | ||
| 17 | 18 | - uses: actions/setup-python@v4 | |
| 18 | 19 | with: | |
| 19 | 20 | python-version: 3 | |
| 21 | + allow-prereleases: true | ||
| 22 | + cache: pip | ||
| 20 | 23 | - name: Clone docsbuild scripts | |
| 21 | 24 | run: | | |
| 22 | 25 | git clone https://github.com/python/docsbuild-scripts/ | |
@@ -26,15 +29,15 @@ jobs: | |||
| 26 | 29 | python -m pip install -r docsbuild-scripts/requirements.txt | |
| 27 | 30 | - name: Build documentation | |
| 28 | 31 | run: > | |
| 29 | - python ./docsbuild-scripts/build_docs.py | ||
| 30 | - --quick | ||
| 31 | - --build-root ./build_root | ||
| 32 | - --www-root ./www | ||
| 33 | - --log-directory ./logs | ||
| 34 | - --group $(id -g) | ||
| 35 | - --skip-cache-invalidation | ||
| 36 | - --theme $(pwd) | ||
| 37 | - --language en | ||
| 32 | + python ./docsbuild-scripts/build_docs.py | ||
| 33 | + --quick | ||
| 34 | + --build-root ./build_root | ||
| 35 | + --www-root ./www | ||
| 36 | + --log-directory ./logs | ||
| 37 | + --group $(id -g) | ||
| 38 | + --skip-cache-invalidation | ||
| 39 | + --theme $(pwd) | ||
| 40 | + --language en | ||
| 38 | 41 | --branch ${{ matrix.branch }} | |
| 39 | 42 | - name: Upload | |
| 40 | 43 | uses: actions/upload-artifact@v3 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,50 @@ | |||
| 1 | + repos: | ||
| 2 | + - repo: https://github.com/asottile/pyupgrade | ||
| 3 | + rev: v3.15.0 | ||
| 4 | + hooks: | ||
| 5 | + - id: pyupgrade | ||
| 6 | + args: [--py38-plus] | ||
| 7 | + | ||
| 8 | + - repo: https://github.com/psf/black-pre-commit-mirror | ||
| 9 | + rev: 23.9.1 | ||
| 10 | + hooks: | ||
| 11 | + - id: black | ||
| 12 | + | ||
| 13 | + - repo: https://github.com/PyCQA/isort | ||
| 14 | + rev: 5.12.0 | ||
| 15 | + hooks: | ||
| 16 | + - id: isort | ||
| 17 | + args: [--add-import=from __future__ import annotations] | ||
| 18 | + | ||
| 19 | + - repo: https://github.com/PyCQA/flake8 | ||
| 20 | + rev: 6.1.0 | ||
| 21 | + hooks: | ||
| 22 | + - id: flake8 | ||
| 23 | + additional_dependencies: | ||
| 24 | + [flake8-2020, flake8-implicit-str-concat, flake8-logging] | ||
| 25 | + | ||
| 26 | + - repo: https://github.com/pre-commit/pygrep-hooks | ||
| 27 | + rev: v1.10.0 | ||
| 28 | + hooks: | ||
| 29 | + - id: python-check-blanket-noqa | ||
| 30 | + | ||
| 31 | + - repo: https://github.com/pre-commit/pre-commit-hooks | ||
| 32 | + rev: v4.5.0 | ||
| 33 | + hooks: | ||
| 34 | + - id: check-case-conflict | ||
| 35 | + - id: check-executables-have-shebangs | ||
| 36 | + - id: check-merge-conflict | ||
| 37 | + - id: check-json | ||
| 38 | + - id: check-toml | ||
| 39 | + - id: check-yaml | ||
| 40 | + - id: debug-statements | ||
| 41 | + - id: end-of-file-fixer | ||
| 42 | + - id: trailing-whitespace | ||
| 43 | + | ||
| 44 | + - repo: https://github.com/abravalheri/validate-pyproject | ||
| 45 | + rev: v0.14 | ||
| 46 | + hooks: | ||
| 47 | + - id: validate-pyproject | ||
| 48 | + | ||
| 49 | + ci: | ||
| 50 | + autoupdate_schedule: quarterly | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -10,7 +10,7 @@ projects if you so choose, but please keep in mind that in doing so you're also | |||
| 10 | 10 | choosing to accept some of the responsibility for maintaining that collective | |
| 11 | 11 | trust. | |
| 12 | 12 | ||
| 13 | - To use the theme, install it into your docs build environment via ``pip`` | ||
| 13 | + To use the theme, install it into your docs build environment via ``pip`` | ||
| 14 | 14 | (preferably in a virtual environment). | |
| 15 | 15 | ||
| 16 | 16 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,4 +11,3 @@ which includes all infrastructure used in the development of Python itself | |||
| 11 | 11 | ||
| 12 | 12 | In general this means everyone is expected to be open, considerate, and | |
| 13 | 13 | respectful of others no matter what their position is within the project. | |
| 14 | - | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,43 +1,38 @@ | |||
| 1 | 1 | [build-system] | |
| 2 | - requires = ["flit_core>=3.7"] | ||
| 3 | 2 | build-backend = "flit_core.buildapi" | |
| 3 | + requires = [ | ||
| 4 | + "flit_core>=3.7", | ||
| 5 | + ] | ||
| 4 | 6 | ||
| 5 | - # project metadata | ||
| 6 | 7 | [project] | |
| 7 | 8 | name = "python-docs-theme" | |
| 8 | 9 | version = "2023.9" | |
| 9 | 10 | description = "The Sphinx theme for the CPython docs and related projects" | |
| 10 | 11 | readme = "README.rst" | |
| 11 | - urls.Code = "https://github.com/python/python-docs-theme" | ||
| 12 | - urls.Download = "https://pypi.org/project/python-docs-theme/" | ||
| 13 | - urls.Homepage = "https://github.com/python/python-docs-theme/" | ||
| 14 | - urls."Issue tracker" = "https://github.com/python/python-docs-theme/issues" | ||
| 15 | 12 | license.file = "LICENSE" | |
| 13 | + authors = [{name = "PyPA", email = "distutils-sig@python.org"}] | ||
| 16 | 14 | requires-python = ">=3.8" | |
| 17 | - | ||
| 18 | - # Classifiers list: https://pypi.org/classifiers/ | ||
| 19 | 15 | classifiers = [ | |
| 20 | - "Development Status :: 5 - Production/Stable", | ||
| 21 | - "Framework :: Sphinx :: Theme", | ||
| 22 | - "Intended Audience :: Developers", | ||
| 23 | - "License :: OSI Approved :: Python Software Foundation License", | ||
| 24 | - "Operating System :: OS Independent", | ||
| 25 | - "Topic :: Documentation", | ||
| 26 | - "Topic :: Software Development :: Documentation", | ||
| 27 | - "Programming Language :: Python", | ||
| 28 | - "Programming Language :: Python :: 3", | ||
| 29 | - "Programming Language :: Python :: 3.8", | ||
| 30 | - "Programming Language :: Python :: 3.9", | ||
| 31 | - "Programming Language :: Python :: 3.10", | ||
| 32 | - "Programming Language :: Python :: 3.11", | ||
| 33 | - "Programming Language :: Python :: 3.12", | ||
| 34 | - "Programming Language :: Python :: 3.13", | ||
| 16 | + "Development Status :: 5 - Production/Stable", | ||
| 17 | + "Framework :: Sphinx :: Theme", | ||
| 18 | + "Intended Audience :: Developers", | ||
| 19 | + "License :: OSI Approved :: Python Software Foundation License", | ||
| 20 | + "Operating System :: OS Independent", | ||
| 21 | + "Programming Language :: Python", | ||
| 22 | + "Programming Language :: Python :: 3 :: Only", | ||
| 23 | + "Programming Language :: Python :: 3.8", | ||
| 24 | + "Programming Language :: Python :: 3.9", | ||
| 25 | + "Programming Language :: Python :: 3.10", | ||
| 26 | + "Programming Language :: Python :: 3.11", | ||
| 27 | + "Programming Language :: Python :: 3.12", | ||
| 28 | + "Programming Language :: Python :: 3.13", | ||
| 29 | + "Topic :: Documentation", | ||
| 30 | + "Topic :: Software Development :: Documentation", | ||
| 35 | 31 | ] | |
| 36 | - | ||
| 37 | - [[project.authors]] | ||
| 38 | - name = "PyPA" | ||
| 39 | - email = "distutils-sig@python.org" | ||
| 40 | - | ||
| 32 | + urls.Code = "https://github.com/python/python-docs-theme" | ||
| 33 | + urls.Download = "https://pypi.org/project/python-docs-theme/" | ||
| 34 | + urls.Homepage = "https://github.com/python/python-docs-theme/" | ||
| 35 | + urls."Issue tracker" = "https://github.com/python/python-docs-theme/issues" | ||
| 41 | 36 | [project.entry-points."sphinx.html_themes"] | |
| 42 | 37 | python_docs_theme = 'python_docs_theme' | |
| 43 | 38 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,8 +1,10 @@ | |||
| 1 | + from __future__ import annotations | ||
| 2 | + | ||
| 1 | 3 | import hashlib | |
| 2 | 4 | import os | |
| 3 | 5 | from functools import lru_cache | |
| 4 | 6 | from pathlib import Path | |
| 5 | - from typing import Any, Dict, List | ||
| 7 | + from typing import Any | ||
| 6 | 8 | ||
| 7 | 9 | import sphinx.application | |
| 8 | 10 | from sphinx.builders.html import StandaloneHTMLBuilder | |
@@ -19,7 +21,7 @@ def _asset_hash(path: str) -> str: | |||
| 19 | 21 | return f"{path}?digest={digest}" | |
| 20 | 22 | ||
| 21 | 23 | ||
| 22 | - def _add_asset_hashes(static: List[str], add_digest_to: List[str]) -> None: | ||
| 24 | + def _add_asset_hashes(static: list[str], add_digest_to: list[str]) -> None: | ||
| 23 | 25 | for asset in add_digest_to: | |
| 24 | 26 | index = static.index(asset) | |
| 25 | 27 | static[index].filename = _asset_hash(asset) # type: ignore | |
@@ -29,7 +31,7 @@ def _html_page_context( | |||
| 29 | 31 | app: sphinx.application.Sphinx, | |
| 30 | 32 | pagename: str, | |
| 31 | 33 | templatename: str, | |
| 32 | - context: Dict[str, Any], | ||
| 34 | + context: dict[str, Any], | ||
| 33 | 35 | doctree: Any, | |
| 34 | 36 | ) -> None: | |
| 35 | 37 | if app.config.html_theme != "python_docs_theme": | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,4 +54,4 @@ document.addEventListener("DOMContentLoaded", function () { | |||
| 54 | 54 | closeMenu() | |
| 55 | 55 | } | |
| 56 | 56 | }) | |
| 57 | - }) | ||
| 57 | + }) | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments