Skip to content

Commit

Permalink
bump template to 2024.23 (#117)
Browse files Browse the repository at this point in the history
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
joshuadavidthomas and pre-commit-ci[bot] authored Aug 1, 2024
1 parent fbf94e8 commit c879c10
Show file tree
Hide file tree
Showing 22 changed files with 111 additions and 66 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
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@ and this project attempts to adhere to [Semantic Versioning](https://semver.org/

## [Unreleased]

### Added

- Support for Python 3.13.

### Changed

- Bumped `django-twc-package` template to v2024.23.
- Removed `westerveltco/setup-ci-action` from GitHub Actions workflows.

## [0.9.0]

### Changed
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
9 changes: 9 additions & 0 deletions example/templates/base.html
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
{# djlint:off D018,H021,H031 #}
{% load django_simple_nav %}

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width,initial-scale=1" />
<title>

{% block title %}
django-simple-nav Demo
{% endblock title %}

</title>
<meta name="description" content="A demo of django-simple-nav" />
<meta name="author" content="Josh Thomas" />
<link rel="icon" href="https://fav.farm/📃" />

{% block extra_head %}
<script src="https://cdn.tailwindcss.com?plugins=typography"></script>
<style type="text/tailwindcss">
Expand All @@ -39,11 +43,15 @@
integrity="sha384-Rpe/8orFUm5Q1GplYBHxbuA8Az8O8C5sAoOsdbRWkqPjKFaxPgGZipj4zeHL7lxX"
crossorigin="anonymous"></script>
{% endblock extra_head %}

</head>
<body>

{% block nav %}
{% endblock nav %}

<main>

{% block content %}
<div class="prose"
style="margin-left: 1rem;
Expand Down Expand Up @@ -71,6 +79,7 @@ <h1 class="mt-8">
{% django_simple_nav "navigation.ExampleListNav" %}
</div>
{% endblock content %}

</main>
</body>
</html>
3 changes: 3 additions & 0 deletions example/templates/basic.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{% extends "base.html" %}

{% load django_simple_nav %}

{% block extra_head %}
<style>
.active {
font-weight: bold;
}
</style>
{% endblock extra_head %}

{% block nav %}
{% django_simple_nav "navigation.BasicNav" %}
{% endblock nav %}
3 changes: 3 additions & 0 deletions example/templates/bootstrap4.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% load django_simple_nav %}

{% block extra_head %}
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
Expand All @@ -15,6 +17,7 @@
integrity="sha384-JZR6Spejh4U02d8jOt6vLEHfe/JQGiRRSQQxSfFWpi1MquVdAyjUar5+76PVCmYl"
crossorigin="anonymous"></script>
{% endblock extra_head %}

{% block nav %}
{% django_simple_nav "navigation.Bootstrap4Nav" %}
{% endblock nav %}
3 changes: 3 additions & 0 deletions example/templates/bootstrap5.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% load django_simple_nav %}

{% block extra_head %}
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css"
rel="stylesheet"
Expand All @@ -9,6 +11,7 @@
integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz"
crossorigin="anonymous"></script>
{% endblock extra_head %}

{% block nav %}
{% django_simple_nav "navigation.Bootstrap5Nav" "navs/bootstrap5.html" %}
{% endblock nav %}
3 changes: 3 additions & 0 deletions example/templates/extra_context.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{% extends "base.html" %}

{% load django_simple_nav %}

{% block extra_head %}
<style>
[data-foo="bar"] {
background-color: red;
}
</style>
{% endblock extra_head %}

{% block nav %}
{% django_simple_nav "navigation.ExtraContextNav" %}
{% endblock nav %}
1 change: 1 addition & 0 deletions example/templates/navs/nested.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{% load django_simple_nav %}

<nav>
<ul>
{% for item in items %}
Expand Down
1 change: 1 addition & 0 deletions example/templates/navs/tailwind_main.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{# djlint:off H006 #}
{% load django_simple_nav %}

<nav x-data="{ open: false }" x-menu class="bg-gray-800">
<div class="px-2 mx-auto max-w-7xl sm:px-6 lg:px-8">
<div class="flex relative justify-between items-center h-16">
Expand Down
3 changes: 3 additions & 0 deletions example/templates/nested.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{% extends "base.html" %}

{% load django_simple_nav %}

{% block extra_head %}
<style>
.active {
font-weight: bold;
}
</style>
{% endblock extra_head %}

{% block nav %}
{% django_simple_nav "navigation.NestedNav" %}
{% endblock nav %}
3 changes: 3 additions & 0 deletions example/templates/permissions.html
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
{% extends "base.html" %}

{% load django_simple_nav %}

{% block extra_head %}
<style>
.active {
font-weight: bold;
}
</style>
{% endblock extra_head %}

{% block nav %}
{% django_simple_nav "navigation.PermissionsNav" %}
<h2>Select a permission to see the nav for it</h2>
Expand Down
3 changes: 3 additions & 0 deletions example/templates/picocss.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
{% extends "base.html" %}

{% load django_simple_nav %}

{% block extra_head %}
<link rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@picocss/pico@2/css/pico.min.css" />
{% endblock extra_head %}

{% block nav %}
{% django_simple_nav "navigation.PicoCSSNav" "navs/picocss.html" %}
{% endblock nav %}
2 changes: 2 additions & 0 deletions example/templates/tailwind.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
{% extends "base.html" %}

{% load django_simple_nav %}

{% block nav %}
{% django_simple_nav "navigation.TailwindMainNav" %}
{% endblock nav %}
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
Loading

0 comments on commit c879c10

Please sign in to comment.