Skip to content

Commit

Permalink
Support docsearch
Browse files Browse the repository at this point in the history
  • Loading branch information
BattlefieldDuck committed Feb 13, 2024
1 parent 83b2bdb commit 89ea90c
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 37 deletions.
51 changes: 25 additions & 26 deletions .github/workflows/python-package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,39 +5,38 @@ name: Python Package

on:
push:
branches: [ main ]
branches: [main]
pull_request:
branches: [ main ]
branches: [main]

jobs:
build:

runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', 3.11]
python-version: [3.7, 3.8, 3.9, "3.10", 3.11]

steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install .
if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=221 --statistics --exclude tests
- name: Test with pytest
run: |
pytest
env:
STEAM_API_KEY: ${{ secrets.STEAM_API_KEY }}
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install flake8 pytest
python -m pip install .
if [ -f requirements.txt ]; then pip install --no-cache-dir -r requirements.txt; fi
- name: Lint with flake8
run: |
# stop the build if there are Python syntax errors or undefined names
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=221 --statistics --exclude tests
- name: Test with pytest
run: |
pytest
env:
STEAM_API_KEY: ${{ secrets.STEAM_API_KEY }}
26 changes: 15 additions & 11 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,31 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'OpenGSQ Python'
copyright = '2024, OpenGSQ, BattlefieldDuck'
author = 'OpenGSQ, BattlefieldDuck'
release = '2.3.1'
project = "OpenGSQ Python"
copyright = "2024, OpenGSQ, BattlefieldDuck"
author = "OpenGSQ, BattlefieldDuck"
release = "2.3.1"

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = ['sphinx_rtd_theme', 'sphinx.ext.autodoc']
extensions = ["sphinx_rtd_theme", "sphinx.ext.autodoc", "sphinx_docsearch"]

templates_path = ['_templates']
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
autodoc_member_order = 'bysource'
templates_path = ["_templates"]
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
autodoc_member_order = "bysource"

docsearch_app_id = "Z4FH0B65P0"
docsearch_api_key = "703d26db3f2af38cbcb3b92d79a048bc"
docsearch_index_name = "python-opengsq"


# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'sphinx_rtd_theme'
html_favicon = 'favicon.ico'
html_static_path = ['_static']
html_theme = "sphinx_rtd_theme"
html_favicon = "favicon.ico"
html_static_path = ["_static"]

# Enabling the extension only when building on GitHub Actions
if os.getenv("GITHUB_ACTIONS"):
Expand Down
1 change: 1 addition & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
sphinx-rtd-theme==2.0.0
sphinxcontrib-googleanalytics==0.4
sphinx-docsearch==0.0.4

0 comments on commit 89ea90c

Please sign in to comment.