Skip to content

Commit

Permalink
Maintenance update
Browse files Browse the repository at this point in the history
  • Loading branch information
MrThearMan committed Oct 30, 2023
1 parent 6bb0116 commit ab8c981
Show file tree
Hide file tree
Showing 29 changed files with 877 additions and 639 deletions.
File renamed without changes.
57 changes: 57 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
# Default behavior
# ============
* text=auto

# Source files
# ============
*manage.py text diff=python eol=lf
*.py text diff=python
*.pxd text diff=python
*.py3 text diff=python
*.pyw text diff=python
*.pyx text diff=python
*.pyz text diff=python
*.pyi text diff=python

# Plain text
# ============
*.js text diff=js
*.css text diff=css
*.html text diff=html
*.md text diff=markdown
*.json text diff=json eol=lf
*.toml text diff=toml eol=lf
*.yml text diff=yaml eol=lf
*.yaml text diff=yaml eol=lf

# Archives
# ============
*.7z filter=lfs diff=lfs merge=lfs -text
*.br filter=lfs diff=lfs merge=lfs -text
*.gz filter=lfs diff=lfs merge=lfs -text
*.tar filter=lfs diff=lfs merge=lfs -text
*.zip filter=lfs diff=lfs merge=lfs -text

# Binary files
# ============
*.db binary
*.p binary
*.pkl binary
*.pickle binary
*.pyc binary export-ignore
*.pyo binary export-ignore
*.pyd binary
*.png binary
*.jpg binary

# Unix specific
# ============
*.sh text eol=lf
*.bash text eol=lf
*.fish text eol=lf

# Windows specific
# ============
*.cmd text eol=crlf
*.bat text eol=crlf
*.ps1 text eol=crlf
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,10 @@ body:
description: >-
Please note that python versions not available below are not supported.
options:
- "3.12"
- "3.11"
- "3.10"
- "3.9"
- "3.8"
validations:
required: true
- type: dropdown
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,4 @@ jobs:
test:
uses: MrThearMan/CI/.github/workflows/[email protected]
with:
python-version: '["3.8", "3.9", "3.10", "3.11"]'
exclude: '[{"os": "windows-latest", "python-version": "3.8"}]'
python-version: '["3.9", "3.10", "3.11", "3.12"]'
10 changes: 3 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v4.5.0
hooks:
- id: check-toml
- id: check-yaml
Expand All @@ -15,11 +15,7 @@ repos:
]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.0.278
rev: v0.1.3
hooks:
- id: ruff

- repo: https://github.com/psf/black
rev: 23.7.0
hooks:
- id: black
- id: ruff-format
15 changes: 5 additions & 10 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export DJANGO_SETTINGS_MODULE = tests.django.settings
export DJANGO_SETTINGS_MODULE = tests.project.settings

.PHONY: help
.PHONY: dev
Expand All @@ -7,8 +7,7 @@ export DJANGO_SETTINGS_MODULE = tests.django.settings
.PHONY: test
.PHONY: tox
.PHONY: hook
.PHONY: pre-commit
.PHONY: pre-commit-update
.PHONY: lint
.PHONY: mypy
.PHONY: Makefile

Expand All @@ -30,8 +29,7 @@ define helptext
test <name> Run all tests maching the given <name>
tox <args> Run all tests with tox.
hook Install pre-commit hook.
pre-commit <hook> Run pre-commit hooks on all files.
pre-commit-update Update all pre-commit hooks to latest versions.
lint Run pre-commit hooks on all files.
mypy Run mypy on all files.

Use quotes (" ") if command contains flags (-h / --help)
Expand Down Expand Up @@ -60,11 +58,8 @@ tox:
hook:
@poetry run pre-commit install

pre-commit:
@poetry run pre-commit run --all-files $(call args, "")

pre-commit-update:
@poetry run pre-commit autoupdate
lint:
@poetry run pre-commit run --all-files

mypy:
@poetry run mypy django_signal_webhooks/
11 changes: 4 additions & 7 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,14 @@
import sys


def main():
def main() -> None:
"""Run administrative tasks."""
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.django.settings")
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "tests.project.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
"available on your PYTHONPATH environment variable? Did you "
"forget to activate a virtual environment?"
) from exc
msg = "Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?"
raise ImportError(msg) from exc
execute_from_command_line(sys.argv)


Expand Down
858 changes: 430 additions & 428 deletions poetry.lock

Large diffs are not rendered by default.

114 changes: 81 additions & 33 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,10 @@ classifiers = [
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
Expand All @@ -47,7 +47,7 @@ exclude = [
"Bug Tracker" = "https://github.com/MrThearMan/django-signal-webhooks/issues"

[tool.poetry.dependencies]
python = ">=3.8,<4"
python = ">=3.9,<4"
Django = ">=3.2"
asgiref = ">=3.5.0"
httpx = ">=0.23.0"
Expand All @@ -56,49 +56,101 @@ django-settings-holder = ">=0.1.0"
djangorestframework = { version = ">=3.13.0", optional = true}

[tool.poetry.group.test.dependencies]
pytest = "7.4.0"
coverage = "7.2.7"
pytest = "7.4.3"
coverage = "7.3.2"
pytest-django = "4.5.2"
pytest-freezegun = "0.4.2"
pre-commit = "3.3.3"
tox = "4.6.4"
pre-commit = "3.5.0"
tox = "4.11.3"
tox-gh-actions = "3.1.3"

[tool.poetry.group.docs.dependencies]
mkdocs = "1.4.3"
pymdown-extensions = "10.1"
mkdocs-mermaid2-plugin = "1.0.1"
mkdocs = "1.5.3"
pymdown-extensions = "10.3.1"
mkdocs-mermaid2-plugin = "1.1.1"

[tool.poetry.group.lint.dependencies]
mypy = "1.4.1"
django-stubs = "4.2.3"
djangorestframework-stubs = "3.14.2"
mypy = "1.6.1"
django-stubs = "4.2.6"
djangorestframework-stubs = "3.14.4"

[tool.poetry.extras]
drf = ["djangorestframework"]

[tool.black]
line-length = 120

[tool.ruff]
fix = true
line-length = 120
exclude = [
"tests/*",
]
select = [
"F", # pyflakes
"E", # pycodestyle errors
"I", # isort
"S", # flake8-bandit
"C", # flake8-comprehensions
"B", # flake8-bugbear
"T", # flake8-print
"W", # pycodestyle warnings
"A", # flake8-builtins
"ANN", # flake8-annotations
"ARG", # flake8-unused-arguments
"B", # flake8-bugbear
"BLE", # flake8-blind-except
"C90", # mccabe
"C4", # flake8-comprehensions
"COM", # flake8-commas
"D200", # pydocstyle: One-line docstring should fit on one line
"D201", # pydocstyle: No blank lines allowed before function docstring (found {num_lines})
"D202", # pydocstyle: No blank lines allowed after function docstring (found {num_lines})
"D209", # pydocstyle: Multi-line docstring closing quotes should be on a separate line
"D213", # pydocstyle: Multi-line docstring summary should start at the second line
"DTZ", # flake8-datetimez
"E", # pycodestyle errors
"EM", # flake8-errmsg
"F", # pyflakes
"FBT", # flake8-boolean-trap
"I", # isort
"INP", # flake8-no-pep420
"ISC", # flake8-implicit-str-concat
"N", # pep8-naming
"PERF", # perflint
"PGH", # pygrep-hooks
"PIE", # flake8-pie
"PL", # pylint
"PT", # flake8-pytest-style
"PTH", # flake8-use-pathlib
"PYI", # flake8-pyi
"Q", # flake8-quotes
"RET", # flake8-return
"RSE", # flake8-raise
"RUF", # ruff-specific rules
"S", # flake8-bandit
"SIM", # flake8-simplify
"T20", # flake8-print
"TCH", # flake8-type-checking
"TRY", # tryceratops
"UP", # pyupgrade
"W", # pycodestyle warnings
]
ignore = [
"S101", # assert is OK
"S105", # no hardcoded passwords
"S101", # assert is OK
"S105", # no hardcoded passwords
"S311", # random-module is OK.
"ARG001", # Anused function argument
"ANN101", # Missing type annotation for `self` in method
"ANN102", # Missing type annotation for `cls` in classmethod
"ANN401", # Any is allowed
"RUF012", # No ClassVar required
#
# Conflicting with ruff-format
#
"COM812", # missing-trailing-comma
"COM819", # prohibited-trailing-comma
"D206", # indent-with-spaces
"D300", # triple-single-quotes
"E111", # indentation-with-invalid-multiple
"E114", # indentation-with-invalid-multiple-comment
"E117", # over-indented
"ISC001", # single-line-implicit-string-concatenation
"ISC002", # multi-line-implicit-string-concatenation
"Q000", # bad-quotes-inline-string
"Q001", # bad-quotes-multiline-string
"Q002", # bad-quotes-docstring
"Q003", # avoidable-escaped-quote
"W191", # tab-indentation
]

[tool.ruff.per-file-ignores]
Expand All @@ -115,7 +167,7 @@ known-third-party = [
]

[tool.mypy]
python_version = "3.11"
python_version = "3.12"
warn_return_any = "True"
warn_unused_configs = "True"
plugins = [
Expand Down Expand Up @@ -146,20 +198,20 @@ markers = [
]

[tool.django-stubs]
django_settings_module = "tests.django.settings"
django_settings_module = "tests.project.settings"

[tool.tox]
legacy_tox_ini = """
[tox]
envlist = py{38, 39, 310, 311}-django{32, 40, 41, 42}
envlist = py{39, 310, 311, 312}-django{32, 40, 41, 42}
isolated_build = true
[gh-actions]
python =
3.8: py38
3.9: py39
3.10: py310
3.11: py311
3.12: py312
[testenv]
allowlist_externals =
Expand All @@ -184,10 +236,6 @@ deps =
pytest-freezegun
commands =
coverage run -m pytest -m "not e2e"
[testenv:py38-django{32, 40, 41, 42}]
platform =
^(?!win32).*$
"""

[build-system]
Expand Down
Loading

0 comments on commit ab8c981

Please sign in to comment.