Skip to content

Commit

Permalink
Format code, update doc theme, fix CI (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-yin authored Nov 1, 2023
1 parent b456743 commit f16639d
Show file tree
Hide file tree
Showing 18 changed files with 673 additions and 769 deletions.
27 changes: 14 additions & 13 deletions .github/workflows/runtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,19 @@ on:

jobs:
runtests:

runs-on: ubuntu-latest

strategy:
matrix:
python-version: ['3.8', '3.9', '3.10' ]
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.x'
- name: Install dependencies
run: |
pip install tox tox-gh-actions
- name: Run tests
run: |
tox
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
pip install -r requirements-dev.txt
- name: Run tests
run: |
tox
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ celerybeat-schedule
:w
'
.tox

/venv/
24 changes: 14 additions & 10 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,20 +1,24 @@
repos:
- repo: https://github.com/pre-commit/mirrors-isort
rev: v4.3.21
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
- repo: https://github.com/ambv/black
rev: 20.8b1
- repo: https://github.com/psf/black
rev: 23.10.1
hooks:
- id: black
language_version: python3.9
#- repo: https://github.com/pre-commit/pre-commit-hooks
- repo: https://gitlab.com/pycqa/flake8
rev: 3.8.0a2
- repo: https://github.com/PyCQA/flake8
rev: 6.0.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-no-pep420
- flake8-print
- flake8-tidy-imports
- flake8-typing-imports
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.800
rev: v1.6.1
hooks:
- id: mypy

6 changes: 3 additions & 3 deletions doc/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
sphinx-autoapi==1.5.1
sphinx-rtd-theme==0.5.1
git+https://github.com/hotwire-django/sphinx-hotwire-theme.git
sphinx-autoapi==3.0.0
furo==2023.9.10
myst-parser
27 changes: 13 additions & 14 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# -- Path setup --------------------------------------------------------------

import datetime

# Standard Library
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
Expand All @@ -20,7 +22,7 @@
# -- Project information -----------------------------------------------------

project = "django-turbo-response"
copyright = "2021, Dan Jacob"
copyright = f"{datetime.datetime.now().year}, Dan Jacob"
author = "Dan Jacob"


Expand All @@ -30,8 +32,13 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.

extensions = ["sphinx.ext.autodoc", "autoapi.extension"]
extensions = ["sphinx.ext.autodoc", "autoapi.extension", "myst_parser"]

source_suffix = {
".rst": "restructuredtext",
".txt": "markdown",
".md": "markdown",
}

# Document Python Code
autoapi_type = "python"
Expand All @@ -45,26 +52,18 @@
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This pattern also affects html_static_path and html_extra_path.
exclude_patterns = []
exclude_patterns = [] # type: ignore

# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"

# -- Options for HTML output -------------------------------------------------

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
# html_theme = "alabaster_hotwire"
html_theme = "furo"

# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ["_static"]


html_context = {
'topbar' : [
{"url": "https://turbo-django.readthedocs.io/", "name": "Turbo Django"},
{"url": "https://django-turbo-response.readthedocs.io/", "name": "Django Turbo Response", "active": True},
{"name": "Stimulus Django"},
]
}
15 changes: 5 additions & 10 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,10 @@
django-turbo-response
==========================================

.. toctree::
:maxdepth: 2
:caption: Contents:

.. include:: ./main.rst
.. include:: ./main.md
:parser: myst

Indices and tables
==================
.. toctree::
:hidden:

* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
self
Loading

0 comments on commit f16639d

Please sign in to comment.