diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 00000000..14f01789 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,11 @@ +# To get started with Dependabot version updates, you'll need to specify which +# package ecosystems to update and where the package manifests are located. +# Please see the documentation for all configuration options: +# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates + +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" # Location of package manifests + schedule: + interval: "weekly" diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml new file mode 100644 index 00000000..b005cb83 --- /dev/null +++ b/.github/workflows/docs.yml @@ -0,0 +1,35 @@ +name: Docs + +on: [push, pull_request] + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + docs: + runs-on: ubuntu-latest + name: docs + steps: + - name: Checkout + uses: actions/checkout@v4 + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.12" + cache: 'pip' + - name: Cache dependencies + uses: actions/cache@v4 + with: + path: ~/.cache/pip + key: ${{ runner.os }}-pip-${{ hashFiles('docs/requirements.txt') }} + restore-keys: | + ${{ runner.os }}-pip- + - run: python -m pip install -r docs/requirements.txt + - run: python setup.py install + - run: codespell -w *.rst + - run: codespell -w --skip docs/spelling_wordlist docs + - name: Build docs + run: | + cd docs + sphinx-build -b dirhtml -n -d build/doctrees . build/dirhtml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..bcd3de1a --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,49 @@ +ci: + autofix_commit_msg: | + ci: auto fixes from pre-commit hooks + + for more information, see https://pre-commit.ci + autofix_prs: false + autoupdate_commit_msg: 'ci: pre-commit autoupdate' + autoupdate_schedule: monthly + +repos: + - repo: https://github.com/asottile/pyupgrade + rev: v2.31.0 + hooks: + - id: pyupgrade + args: ["--py37-plus"] + + - repo: https://github.com/adamchainz/django-upgrade + rev: '1.4.0' + hooks: + - id: django-upgrade + args: [--target-version, "2.2"] + + - repo: https://github.com/PyCQA/flake8 + rev: 4.0.1 + hooks: + - id: flake8 + + - repo: https://github.com/asottile/yesqa + rev: v1.3.0 + hooks: + - id: yesqa + + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.1.0 + hooks: + - id: check-merge-conflict + - id: debug-statements + - id: mixed-line-ending + - id: trailing-whitespace + + - repo: https://github.com/pycqa/isort + rev: 5.10.1 + hooks: + - id: isort + + - repo: https://github.com/codespell-project/codespell + rev: v2.1.0 + hooks: + - id: codespell diff --git a/.readthedocs.yaml b/.readthedocs.yaml new file mode 100644 index 00000000..e1bd672f --- /dev/null +++ b/.readthedocs.yaml @@ -0,0 +1,20 @@ +# Read the Docs configuration file +# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details +version: 2 + +build: + os: ubuntu-22.04 + tools: + python: "3.11" + +sphinx: + configuration: docs/conf.py + fail_on_warning: false + +formats: + - epub + - pdf + +python: + install: + - requirements: docs/requirements.txt diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 00000000..85c55ebc --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1,2 @@ +.env +.venv diff --git a/docs/conf.py b/docs/conf.py index 834c2434..1273cc40 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -62,7 +62,7 @@ # # This is also used if you do content translation via gettext catalogs. # Usually you set "language" from the command line for these cases. -language = None +language = "en" # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. @@ -78,7 +78,16 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = "alabaster" +try: + import furo + + html_theme = 'furo' + html_theme_options = { + "navigation_with_keys": True, + } +except ImportError: + html_theme = 'default' + # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the diff --git a/docs/requirements.in b/docs/requirements.in new file mode 100644 index 00000000..c9231608 --- /dev/null +++ b/docs/requirements.in @@ -0,0 +1,9 @@ +furo +Sphinx>=4.2.0 +sphinx-copybutton +sphinxext-opengraph +sphinxcontrib-spelling +sphinx-autobuild +codespell +pip-tools +docstrfmt diff --git a/docs/requirements.txt b/docs/requirements.txt new file mode 100644 index 00000000..537a0614 --- /dev/null +++ b/docs/requirements.txt @@ -0,0 +1,136 @@ +# +# This file is autogenerated by pip-compile with Python 3.11 +# by the following command: +# +# pip-compile +# +alabaster==0.7.16 + # via sphinx +babel==2.14.0 + # via sphinx +beautifulsoup4==4.12.3 + # via furo +black==23.12.1 + # via docstrfmt +build==1.0.3 + # via pip-tools +certifi==2023.11.17 + # via requests +charset-normalizer==3.3.2 + # via requests +click==8.1.7 + # via + # black + # docstrfmt + # pip-tools +codespell==2.2.6 + # via -r requirements.in +colorama==0.4.6 + # via sphinx-autobuild +docstrfmt==1.6.1 + # via -r requirements.in +docutils==0.20.1 + # via + # docstrfmt + # sphinx +furo==2023.9.10 + # via -r requirements.in +idna==3.6 + # via requests +imagesize==1.4.1 + # via sphinx +jinja2==3.1.3 + # via sphinx +libcst==1.1.0 + # via docstrfmt +livereload==2.6.3 + # via sphinx-autobuild +markupsafe==2.1.4 + # via jinja2 +mypy-extensions==1.0.0 + # via + # black + # typing-inspect +packaging==23.2 + # via + # black + # build + # sphinx +pathspec==0.12.1 + # via black +pip-tools==7.3.0 + # via -r requirements.in +platformdirs==4.1.0 + # via + # black + # docstrfmt +pyenchant==3.2.2 + # via sphinxcontrib-spelling +pygments==2.17.2 + # via + # furo + # sphinx +pyproject-hooks==1.0.0 + # via build +pyyaml==6.0.1 + # via libcst +requests==2.31.0 + # via sphinx +six==1.16.0 + # via livereload +snowballstemmer==2.2.0 + # via sphinx +soupsieve==2.5 + # via beautifulsoup4 +sphinx==7.2.6 + # via + # -r requirements.in + # docstrfmt + # furo + # sphinx-autobuild + # sphinx-basic-ng + # sphinx-copybutton + # sphinxcontrib-spelling + # sphinxext-opengraph +sphinx-autobuild==2021.3.14 + # via -r requirements.in +sphinx-basic-ng==1.0.0b2 + # via furo +sphinx-copybutton==0.5.2 + # via -r requirements.in +sphinxcontrib-applehelp==1.0.8 + # via sphinx +sphinxcontrib-devhelp==1.0.6 + # via sphinx +sphinxcontrib-htmlhelp==2.0.5 + # via sphinx +sphinxcontrib-jsmath==1.0.1 + # via sphinx +sphinxcontrib-qthelp==1.0.7 + # via sphinx +sphinxcontrib-serializinghtml==1.1.10 + # via sphinx +sphinxcontrib-spelling==8.0.0 + # via -r requirements.in +sphinxext-opengraph==0.9.1 + # via -r requirements.in +tabulate==0.9.0 + # via docstrfmt +toml==0.10.2 + # via docstrfmt +tornado==6.4 + # via livereload +typing-extensions==4.9.0 + # via + # libcst + # typing-inspect +typing-inspect==0.9.0 + # via libcst +urllib3==2.1.0 + # via requests +wheel==0.42.0 + # via pip-tools + +# The following packages are considered to be unsafe in a requirements file: +# pip +# setuptools diff --git a/setup.cfg b/setup.cfg index 5a79ae38..56767f48 100644 --- a/setup.cfg +++ b/setup.cfg @@ -7,6 +7,7 @@ exclude = **/migrations/, build/, .tox/, + docs/conf.py, node_modules/, [isort] diff --git a/setup.py b/setup.py index ddb3bae5..86e47922 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ INSTALL_REQUIREMENTS = [ - "Django>=2.2,<4.0", + "Django>=2.2", "django-cms", "django-sekizai>=0.7", "django-admin-sortable2>=0.6.4", diff --git a/tests/requirements/dj32_cms40.txt b/tests/requirements/dj32_cms40.txt index d19b191e..6dd211b1 100644 --- a/tests/requirements/dj32_cms40.txt +++ b/tests/requirements/dj32_cms40.txt @@ -2,5 +2,5 @@ Django>=3.2,<4.0 -django-admin-sortable2 +django-admin-sortable2<2 django_polymorphic