Skip to content

Commit

Permalink
Move to my new standard project template and get things passing.
Browse files Browse the repository at this point in the history
  • Loading branch information
ubernostrum committed Jun 10, 2023
1 parent 6ff2a6f commit 92ca0e7
Show file tree
Hide file tree
Showing 35 changed files with 1,160 additions and 564 deletions.
23 changes: 23 additions & 0 deletions .editorconfig
@@ -0,0 +1,23 @@
# https://editorconfig.org/

root = true

[*]
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true
end_of_line = lf
charset = utf-8

[*.py]
max_line_length = 88

[*.toml]
indent_size = 2

[docs/**.rst]
max_line_length = 79

[*.{yaml,yml}]
indent_size = 2
5 changes: 5 additions & 0 deletions .flake8
@@ -0,0 +1,5 @@
[flake8]
extend-ignore = E203, E501, W503
max-complexity = 13
max-line-length = 88
select = C,E,F,W,B,B950
140 changes: 131 additions & 9 deletions .gitignore
@@ -1,11 +1,133 @@
*.pyc
__pycache__
*.egg-info
docs/_build/
.coverage
# Adapted from https://github.com/github/gitignore/blob/main/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
.python-version
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
categories.json
confusables.json
.mypy_cache
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
.python-version

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/
39 changes: 39 additions & 0 deletions .pre-commit-config.yaml
@@ -0,0 +1,39 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: check-added-large-files
- id: check-ast
- id: check-byte-order-marker
- id: check-case-conflict
- id: check-docstring-first
- id: check-merge-conflict
- id: check-toml
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/psf/black
rev: 23.1.0
hooks:
- id: black
language_version: python3.7
name: black (Python formatter)
- repo: https://github.com/pycqa/flake8
rev: 6.0.0
hooks:
- id: flake8
name: flake8 (Python linter)
- repo: https://github.com/econchick/interrogate
rev: 1.5.0
hooks:
- id: interrogate
name: interrogate (Python docstring enforcer)
args: [--quiet]
- repo: https://github.com/pycqa/isort
rev: 5.12.0
hooks:
- id: isort
name: isort (Python formatter)
18 changes: 18 additions & 0 deletions .readthedocs.yaml
@@ -0,0 +1,18 @@
# .readthedocs.yaml
# 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

python:
install:
- method: pip
path: .[docs]
12 changes: 9 additions & 3 deletions MANIFEST.in
@@ -1,8 +1,14 @@
include LICENSE
include MANIFEST.in
include AUTHORS
recursive-include docs *
include tox.ini
include .editorconfig
include *.yaml
include docs/*.rst docs/*.txt docs/*.py docs/*.bat docs/Makefile
include .flake8
include pyproject.toml
include noxfile.py
include runtests.py
include tox.ini
graft src
graft tests
global-exclude *.pyc
prune docs/_build
40 changes: 28 additions & 12 deletions docs/conf.py
@@ -1,19 +1,33 @@
"""
Configuration file for the Sphinx documentation builder:
https://www.sphinx-doc.org/
"""
import os
import sys

on_rtd = os.environ.get("READTHEDOCS", None) == "True"

extensions = ["sphinx.ext.intersphinx"]
extensions = [
"notfound.extension",
"sphinx.ext.autodoc",
"sphinx.ext.intersphinx",
"sphinx.ext.viewcode",
"sphinxcontrib_django",
"sphinxext.opengraph",
"sphinx_copybutton",
"sphinx_inline_tabs",
]
templates_path = ["_templates"]
source_suffix = ".rst"
master_doc = "index"
project = "django-registration"
copyright = "2007-2022, James Bennett"
version = "3.3"
release = "3.3"
copyright = "2007, James Bennett"
version = "3.4"
release = "3.4a1"
exclude_trees = ["_build"]
pygments_style = "sphinx"
htmlhelp_basename = "django-registrationdoc"
html_theme = "furo"
latex_documents = [
(
"index",
Expand All @@ -32,12 +46,6 @@
"python": ("https://docs.python.org/3", None),
}

if not on_rtd:
import sphinx_rtd_theme

html_theme = "sphinx_rtd_theme"
html_theme_path = [sphinx_rtd_theme.get_html_theme_path()]

# Spelling check needs an additional module that is not installed by default.
# Add it only if spelling check is requested so docs can be generated without it.
if "spelling" in sys.argv:
Expand All @@ -48,3 +56,11 @@

# Location of word list.
spelling_word_list_filename = "spelling_wordlist.txt"

# OGP metadata configuration.
ogp_enable_meta_description = True
ogp_site_url = "https://django-registration.readthedocs.io/"

# Django settings for sphinxcontrib-django.
sys.path.insert(0, os.path.abspath("."))
django_settings = "docs_settings"
6 changes: 6 additions & 0 deletions docs/docs_settings.py
@@ -0,0 +1,6 @@
"""
Minimal Django settings file for documentation builds.
"""

INSTALLED_APPS = ["django_registration"]

0 comments on commit 92ca0e7

Please sign in to comment.