Skip to content

Commit

Permalink
Add Django 4.2, 5.0 to classifiers (#34)
Browse files Browse the repository at this point in the history
Add Python 3.12 and Django 4.2 and 5.0 to the build matrix and classifiers.

Bump version to v6.0
  • Loading branch information
hugorodgerbrown authored Nov 7, 2023
1 parent c97e5e7 commit 5d227d0
Show file tree
Hide file tree
Showing 13 changed files with 89 additions and 141 deletions.
56 changes: 0 additions & 56 deletions .flake8

This file was deleted.

46 changes: 38 additions & 8 deletions .github/workflows/tox.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,39 @@ jobs:
name: Check formatting
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
toxenv: [fmt, lint, mypy]
env:
TOXENV: ${{ matrix.toxenv }}

steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python 3.11
- name: Set up Python (3.11)
uses: actions/setup-python@v4
with:
python-version: "3.11"

- name: Install and run tox
run: |
pip install tox
tox
checks:
name: Run Django checks
runs-on: ubuntu-latest
strategy:
matrix:
toxenv: ["django-checks"]
env:
TOXENV: ${{ matrix.toxenv }}

steps:
- name: Check out the repository
uses: actions/checkout@v4

- name: Set up Python (3.11)
uses: actions/setup-python@v4
with:
python-version: "3.11"
Expand All @@ -37,20 +59,28 @@ jobs:
name: Run tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.9", "3.10", "3.11"]
django: ["40", "41", "42", "main"]
python: ["3.9", "3.10", "3.11", "3.12"]
# build LTS version, next version, HEAD
django: ["32", "42", "50", "main"]
exclude:
- python: "3.9"
django: "50"
- python: "3.9"
django: "main"
- python: "3.10"
django: "main"
- python: "3.11"
django: "32"
- python: "3.12"
django: "32"

env:
TOXENV: py${{ matrix.python }}-django${{ matrix.django }}
TOXENV: django${{ matrix.django }}-py${{ matrix.python }}

steps:
- name: Check out the repository
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python }}
uses: actions/setup-python@v4
Expand Down
7 changes: 4 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
*.pyc
*.egg-info
.coverage
.tox
static
*.egg-info
*.pyc
dist
poetry.lock
static
test.db
8 changes: 0 additions & 8 deletions .isort.cfg

This file was deleted.

31 changes: 7 additions & 24 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,36 +1,20 @@
repos:
# python import sorting - will amend files
- repo: https://github.com/pre-commit/mirrors-isort
rev: v5.10.1
hooks:
- id: isort

# python code formatting - will amend files
- repo: https://github.com/ambv/black
rev: 22.10.0
rev: 23.10.1
hooks:
- id: black

- repo: https://github.com/asottile/pyupgrade
rev: v3.1.0
hooks:
- id: pyupgrade

# Flake8 includes pyflakes, pycodestyle, mccabe, pydocstyle, bandit
- repo: https://github.com/PyCQA/flake8
rev: 5.0.4
- repo: https://github.com/charliermarsh/ruff-pre-commit
# Ruff version.
rev: "v0.1.4"
hooks:
- id: flake8
additional_dependencies:
- flake8-bandit
- flake8-blind-except
- flake8-docstrings
- flake8-logging-format
- flake8-print
- id: ruff
args: [--fix, --exit-non-zero-on-fix]

# python static type checking
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.982
rev: v1.6.1
hooks:
- id: mypy
args:
Expand All @@ -40,4 +24,3 @@ repos:
- --no-implicit-optional
- --ignore-missing-imports
- --follow-imports=silent
exclude: ^tests
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to this project will be documented in this file.

## v6.0.0

* Add support for Django 5.0
* Add Python 3.12 to classifiers and build matrix

## v5.0.0

* Improve LoggedMessage admin list page performance.
Expand Down
11 changes: 0 additions & 11 deletions appmail/CHANGELOG.md

This file was deleted.

3 changes: 0 additions & 3 deletions appmail/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +0,0 @@
__version__ = "5.0.0"

default_app_config = "appmail.apps.AppmailConfig"
2 changes: 2 additions & 0 deletions appmail/apps.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,5 @@

class AppmailConfig(AppConfig):
name = "appmail"
verbose_name = "Application Mail"
default_auto_field = "django.db.models.AutoField"
1 change: 0 additions & 1 deletion appmail/tests/fixtures/templates.json

This file was deleted.

18 changes: 7 additions & 11 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "django-appmail"
version = "5.0.0"
version = "6.0"
description = "Django app for managing localised email templates."
authors = ["YunoJuno <[email protected]>"]
license = "MIT"
Expand All @@ -12,35 +12,31 @@ classifiers = [
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Operating System :: OS Independent",
"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",
]
packages = [{ include = "appmail" }]

[tool.poetry.dependencies]
python = "^3.8"
django = "^3.2 || ^4.0"
python = "^3.9"
django = "^3.2 || ^4.0 || ^5.0"

[tool.poetry.dev-dependencies]
black = "*"
coverage = "*"
flake8 = "*"
flake8-bandit = "*"
flake8-blind-except = "*"
flake8-docstrings = "*"
flake8-logging-format = "*"
flake8-print = "*"
freezegun = "*"
isort = "*"
mypy = "*"
pre-commit = "*"
pytest = "*"
pytest-cov = "*"
pytest-django = "*"
ruff = "*"
tox = "*"

[build-system]
Expand Down
1 change: 0 additions & 1 deletion tests/test_helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ def test_merge_dicts(self):
self.assertEqual(helpers.merge_dicts({"foo": 1}, {"foo": 2}), {"foo": 2})

def test_patch_context(self):

foo = {"foo": 1}
bar = {"bar": 2}
baz = {"baz": 3}
Expand Down
41 changes: 26 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
[tox]
isolated_build = true
envlist = fmt, lint, mypy, py{3.9,3.10,3.11}-django{40,41,42,main}
isolated_build = True
envlist =
fmt, lint, mypy,
django-checks,
; https://docs.djangoproject.com/en/5.0/releases/
django32-py{39,310}
django40-py{39,310}
django41-py{39,310,311}
django42-py{39,310,311}
django50-py{310,311,312}
djangomain-py{311,312}

[testenv]
deps =
Expand All @@ -11,35 +20,37 @@ deps =
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
django42: Django>=4.2,<4.3
django50: https://github.com/django/django/archive/stable/5.0.x.tar.gz
djangomain: https://github.com/django/django/archive/main.tar.gz

commands =
pytest --ds=tests.settings --cov=appmail --verbose tests
pytest --cov=appmail --verbose tests/

[testenv:django-checks]
description = Django system checks and missing migrations
deps = Django
commands =
python manage.py check --fail-level WARNING
python manage.py makemigrations --dry-run --check --verbosity 3

[testenv:fmt]
description = 'Source file formatting'
description = Python source code formatting (black)
deps =
isort
black

commands =
isort --recursive appmail
black appmail
black --check appmail

[testenv:lint]
description = 'Source file linting'
description = Python source code linting (ruff)
deps =
flake8
flake8-bandit
flake8-blind-except
flake8-docstrings
flake8-logging-format
flake8-print
ruff

commands =
flake8 appmail
ruff appmail

[testenv:mypy]
description = Python source code type hints (mypy)
deps =
mypy

Expand Down

0 comments on commit 5d227d0

Please sign in to comment.