Skip to content

Commit

Permalink
bump template to v2024.27 and add support for Django 5.1 (#111)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas authored Sep 11, 2024
1 parent fa53eb1 commit ac65284
Show file tree
Hide file tree
Showing 15 changed files with 65 additions and 16 deletions.
3 changes: 2 additions & 1 deletion .copier/package.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v2024.24
_commit: v2024.27
_src_path: gh:westerveltco/django-twc-package
author_email: josh@joshthomas.dev
author_name: Josh Thomas
current_version: 0.15.0
django_versions:
- '4.2'
- '5.0'
- '5.1'
docs_domain: westervelt.dev
github_owner: westerveltco
github_repo: django-twc-toolbox
Expand Down
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
* @westerveltco/oss
/docs/ @westerveltco/web-dev-docs
3 changes: 2 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: 3.12
python-version: "3.13"
allow-prereleases: true

- name: Install dependencies
run: |
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.10"
allow-prereleases: true

- name: Install dependencies
run: |
Expand All @@ -47,7 +48,7 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
python-version: "${{ matrix.python-version }}"
allow-prereleases: true

- name: Install dependencies
Expand Down Expand Up @@ -78,7 +79,8 @@ jobs:

- uses: actions/setup-python@v5
with:
python-version: "3.12"
python-version: "3.13"
allow-prereleases: true

- name: Install dependencies
run: |
Expand All @@ -97,6 +99,7 @@ jobs:
- uses: actions/setup-python@v5
with:
python-version: "3.10"
allow-prereleases: true

- name: Install dependencies
run: |
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/
### Added

- A middleware `django_twc_toolbox.middleware.WwwRedirectMiddleware` for redirecting any request from a "www." subdomain to the bare domain. All credit to [Adam Johnson](https://github.com/adamchainz) -- [How to Make Django Redirect WWW to Your Bare Domain - Adam Johnson](https://adamj.eu/tech/2020/03/02/how-to-make-django-redirect-www-to-your-bare-domain/).
- Now supporting Django 5.1.

### Changed

- Bumped `django-twc-package` template version to v2024.27.

### Fixed

Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@

[![PyPI](https://img.shields.io/pypi/v/django-twc-toolbox)](https://pypi.org/project/django-twc-toolbox/)
![PyPI - Python Version](https://img.shields.io/pypi/pyversions/django-twc-toolbox)
![Django Version](https://img.shields.io/badge/django-4.2%20%7C%205.0-%2344B78B?labelColor=%23092E20)
![Django Version](https://img.shields.io/badge/django-4.2%20%7C%205.0%20%7C%205.1-%2344B78B?labelColor=%23092E20)
<!-- https://shields.io/badges -->
<!-- django-4.2 | 5.0-#44B78B -->
<!-- django-4.2 | 5.0 | 5.1-#44B78B -->
<!-- labelColor=%23092E20 -->

## Requirements

- Python 3.10, 3.11, 3.12, 3.13
- Django 4.2, 5.0
- Django 4.2, 5.0, 5.1

## Installation

Expand Down
12 changes: 7 additions & 5 deletions docs/_static/css/custom.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
// no idea if this will screw a lot up with the furo theme
// but this does fix the line of badges in the README. only
// one of them has a link which furo makes the vertical-align
// different than just a standard img
/*
no idea if this will screw a lot up with the furo theme
but this does fix the line of badges in the README. only
one of them has a link which furo makes the vertical-align
different than just a standard img
*/
p a.reference img {
vertical-align: inherit;
vertical-align: inherit;
}
8 changes: 6 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = [
"autodoc2",
"myst_parser",
"sphinx_copybutton",
"sphinx_inline_tabs",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
]

Expand All @@ -59,10 +59,14 @@
# -- MyST configuration ------------------------------------------------------
myst_heading_anchors = 3

# -- Options for autodoc2 -----------------------------------------------------
autodoc2_packages = [f"../src/{project.replace('-', '_')}"]
autodoc2_render_plugin = "myst"

# -- Options for sphinx_copybutton -----------------------------------------------------
copybutton_selector = "div.copy pre"
copybutton_prompt_text = "$ "


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

# The theme to use for HTML and HTML Help pages. See the documentation for
Expand Down
5 changes: 5 additions & 0 deletions docs/development/contributing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
```{include} ../../CONTRIBUTING.md
```

See the [documentation](./just.md) for more information.
3 changes: 3 additions & 0 deletions docs/development/releasing.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
```{include} ../../RELEASING.md
```
10 changes: 10 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,20 @@
```

```{toctree}
:hidden:
:maxdepth: 3
:caption: API Reference
apidocs/django_twc_toolbox/django_twc_toolbox.rst
```

```{toctree}
:hidden:
:maxdepth: 3
:caption: Development
development/contributing.md
development/just.md
Releasing <development/releasing.md>
```
3 changes: 2 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@

DJ42 = "4.2"
DJ50 = "5.0"
DJ51 = "5.1"
DJMAIN = "main"
DJMAIN_MIN_PY = PY310
DJ_VERSIONS = [DJ42, DJ50, DJMAIN]
DJ_VERSIONS = [DJ42, DJ50, DJ51, DJMAIN]
DJ_LTS = [DJ42]
DJ_DEFAULT = DJ_LTS[0]
DJ_LATEST = DJ_VERSIONS[-2]
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ classifiers = [
"Framework :: Django",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python",
Expand Down Expand Up @@ -64,6 +65,7 @@ docs = [
"myst-parser",
"sphinx",
"sphinx-autobuild",
"sphinx-autodoc2",
"sphinx-copybutton",
"sphinx-inline-tabs"
]
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from .settings import DEFAULT_SETTINGS

pytest_plugins = [] # type: ignore
pytest_plugins = []


def pytest_configure(config):
Expand Down
11 changes: 11 additions & 0 deletions tests/test_conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
from __future__ import annotations

import pytest

from django_twc_toolbox.conf import app_settings


def test_app_settings():
# stub test until `django-twc-toolbox` requires custom app settings
with pytest.raises(AttributeError):
assert app_settings.foo

0 comments on commit ac65284

Please sign in to comment.