Skip to content

Commit

Permalink
bump template to 2024.23
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas committed Aug 1, 2024
1 parent fbf94e8 commit e7ac7ff
Show file tree
Hide file tree
Showing 9 changed files with 76 additions and 88 deletions.
3 changes: 2 additions & 1 deletion .copier/package.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: v2024.20
_commit: v2024.23
_src_path: gh:westerveltco/django-twc-package
author_email: [email protected]
author_name: Josh Thomas
Expand All @@ -19,5 +19,6 @@ python_versions:
- '3.10'
- '3.11'
- '3.12'
- '3.13'
test_django_main: true
versioning_scheme: SemVer
47 changes: 13 additions & 34 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,53 +4,32 @@ on:
release:
types: [released]

jobs:
check:
runs-on: ubuntu-latest
permissions:
actions: read
contents: read
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v4
permissions:
contents: write

- name: Check most recent test run on `main`
id: latest-test-result
run: |
echo "result=$(gh run list \
--branch=main \
--workflow=test.yml \
--json headBranch,workflowName,conclusion \
--jq '.[] | select(.headBranch=="main" and .conclusion=="success") | .conclusion' \
| head -n 1)" >> $GITHUB_OUTPUT
- name: OK
if: ${{ (contains(steps.latest-test-result.outputs.result, 'success')) }}
run: exit 0

- name: Fail
if: ${{ !contains(steps.latest-test-result.outputs.result, 'success') }}
run: exit 1
jobs:
test:
uses: ./.github/workflows/test.yml

pypi:
if: ${{ github.event_name == 'release' }}
runs-on: ubuntu-latest
needs: check
needs: test
environment: release
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: westerveltco/setup-ci-action@v0
- uses: actions/setup-python@v5
with:
python-version: 3.12
extra-python-dependencies: hatch
use-uv: true
python-version: 3.13

- name: Install dependencies
run: |
python -m pip install -U pip uv
python -m uv pip install --system hatch
- name: Build package
run: |
Expand Down
45 changes: 25 additions & 20 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,15 @@ jobs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: westerveltco/setup-ci-action@v0
- uses: actions/setup-python@v5
with:
python-version: 3.8
extra-python-dependencies: nox
use-uv: true

- name: Install dependencies
run: |
python -m pip install -U pip uv
python -m uv pip install --system nox
- id: set-matrix
run: |
Expand All @@ -42,14 +43,16 @@ jobs:
matrix: ${{ fromJSON(needs.generate-matrix.outputs.matrix) }}
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: westerveltco/setup-ci-action@v0
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
extra-python-dependencies: nox
use-uv: true
allow-prereleases: true

- name: Install dependencies
run: |
python -m pip install -U pip uv
python -m uv pip install --system nox
- name: Run tests
run: |
Expand All @@ -71,14 +74,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: westerveltco/setup-ci-action@v0
- uses: actions/setup-python@v5
with:
python-version: 3.8
extra-python-dependencies: nox
use-uv: true

- name: Install dependencies
run: |
python -m pip install -U pip uv
python -m uv pip install --system nox
- name: Run mypy
run: |
Expand All @@ -88,14 +92,15 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false

- uses: westerveltco/setup-ci-action@v0
- uses: actions/setup-python@v5
with:
python-version: 3.8
extra-python-dependencies: nox
use-uv: true

- name: Install dependencies
run: |
python -m pip install -U pip uv
python -m uv pip install --system nox
- name: Run coverage
run: |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@

## Requirements

- Python 3.8, 3.9, 3.10, 3.11, 3.12
- Python 3.8, 3.9, 3.10, 3.11, 3.12, 3.13
- Django 4.2, 5.0

## Getting Started
## Installation

<!-- getting-started-start -->
1. **Install the package from PyPI.**
Expand Down Expand Up @@ -52,7 +52,7 @@
If you do not add `django.contrib.auth` to your `INSTALLED_APPS` and you define any permissions for your navigation items, `django-simple-nav` will simply ignore the permissions and render all items regardless of whether the permission check is `True` or `False.`
<!-- getting-started-end -->

## Usage
## Getting Started

<!-- usage-start -->
1. **Create a navigation definition.**
Expand Down
3 changes: 2 additions & 1 deletion noxfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
PY310 = "3.10"
PY311 = "3.11"
PY312 = "3.12"
PY_VERSIONS = [PY38, PY39, PY310, PY311, PY312]
PY313 = "3.13"
PY_VERSIONS = [PY38, PY39, PY310, PY311, PY312, PY313]
PY_DEFAULT = PY_VERSIONS[0]
PY_LATEST = PY_VERSIONS[-1]

Expand Down
20 changes: 18 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ classifiers = [
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Python :: Implementation :: CPython"
]
dependencies = [
Expand Down Expand Up @@ -114,7 +115,12 @@ django_settings_module = "tests.settings"
strict_settings = false

[tool.djlint]
blank_line_after_tag = "endblock,endpartialdef,extends,load"
blank_line_before_tag = "block,partialdef"
custom_blocks = "partialdef"
ignore = "H031" # Don't require `meta` tag keywords
indent = 2
profile = "django"

[tool.hatch.build]
exclude = [".*", "Justfile"]
Expand All @@ -127,7 +133,13 @@ path = "src/django_simple_nav/__init__.py"

[tool.mypy]
check_untyped_defs = true
exclude = "docs/.*\\.py$"
exclude = [
"docs",
"tests",
"migrations",
"venv",
".venv"
]
mypy_path = "src/"
no_implicit_optional = true
plugins = ["mypy_django_plugin.main"]
Expand All @@ -138,7 +150,11 @@ warn_unused_ignores = true
[[tool.mypy.overrides]]
ignore_errors = true
ignore_missing_imports = true
module = ["django_simple_nav.*.migrations.*", "tests.*"]
module = [
"*.migrations.*",
"tests.*",
"docs.*"
]

[tool.mypy_django_plugin]
ignore_missing_model_attributes = true
Expand Down
26 changes: 0 additions & 26 deletions src/django_simple_nav/_type_utils.py

This file was deleted.

12 changes: 12 additions & 0 deletions src/django_simple_nav/_typing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from __future__ import annotations

import sys

if sys.version_info >= (3, 12):
from typing import override as typing_override
else: # pragma: no cover
from typing_extensions import (
override as typing_override, # pyright: ignore[reportUnreachable]
)

override = typing_override
2 changes: 1 addition & 1 deletion src/django_simple_nav/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from django.conf import settings

from django_simple_nav._type_utils import override
from ._typing import override

DJANGO_SIMPLE_NAV_SETTINGS_NAME = "DJANGO_SIMPLE_NAV"

Expand Down

0 comments on commit e7ac7ff

Please sign in to comment.