Skip to content

Commit

Permalink
🔖 bump version 2024.1 -> 2024.2 (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshuadavidthomas authored Feb 13, 2024
1 parent 9094ab2 commit 5507b9c
Show file tree
Hide file tree
Showing 39 changed files with 275 additions and 188 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).

## [Unreleased]


## [2024.2]

### Added

- Minimum Copier version set to 9.1.0.
Expand Down Expand Up @@ -75,3 +78,4 @@ Initial release! 🎉

[unreleased]: https://github.com/westerveltco/django-twc-project/compare/v2024.1...HEAD
[2024.1]: https://github.com/westerveltco/django-simple-nav/releases/tag/v2024.1
[2024.2]: https://github.com/westerveltco/django-twc-project.git/releases/tag/v2024.2
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2024.1
2024.2
2 changes: 1 addition & 1 deletion copier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ _secret_questions:
_subdirectory: src/django_twc_project

template_version:
default: "2024.1"
default: "2024.2"
when: false

# ----------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions examples/default/.copier/project.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Changes here will be overwritten by Copier; NEVER EDIT MANUALLY
_commit: 5f7d998
_commit: v2024.1-32-g21072fe
_src_path: .
admin_email: [email protected]
author_name: John Doe
current_version: 2024-2-1
current_version: 2024.2.1
default_from_email: [email protected]
django_version: '4.2'
domain_name: default.westervelt.com
Expand Down
2 changes: 1 addition & 1 deletion examples/default/.github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ updates:
patterns:
- "*"
exclude-patterns:
- "django-email-relay"
- "django-email-relay"
- package-ecosystem: npm
directory: "/"
schedule:
Expand Down
1 change: 1 addition & 0 deletions examples/default/.github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ jobs:
- name: Build staticfiles
run: |
python manage.py tailwind build
python manage.py collectstatic
# https://hynek.me/articles/ditch-codecov-python/
Expand Down
23 changes: 11 additions & 12 deletions examples/default/.pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,28 +11,28 @@ repos:
- id: check-yaml

- repo: https://github.com/adamchainz/django-upgrade
rev: 1.15.0
rev: 1.16.0
hooks:
- id: django-upgrade
args: [--target-version, "4.2"]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.1.3
rev: v0.2.1
hooks:
- id: ruff
args: [--fix]
- id: ruff-format

- repo: https://github.com/adamchainz/blacken-docs
rev: "1.16.0"
rev: 1.16.0
hooks:
- id: blacken-docs
alias: autoformat
additional_dependencies:
- black==22.12.0

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v3.0.3
rev: v4.0.0-alpha.8
hooks:
- id: prettier
# lint the following with prettier:
Expand All @@ -44,31 +44,30 @@ repos:
# ignore any minified code
files: '^(?!.*\.min\..*)(?P<name>[\w-]+(\.[\w-]+)*\.(js|jsx|ts|tsx|yml|yaml|css))$'

- repo: https://github.com/rtts/djhtml
rev: "3.0.6"
- repo: https://github.com/djlint/djLint
rev: v1.34.1
hooks:
- id: djhtml
entry: djhtml --tabwidth 2
alias: autoformat
- id: djlint-reformat-django
- id: djlint-django

- repo: local
hooks:
- id: rustywind
name: rustywind Tailwind CSS class linter
language: node
additional_dependencies:
- rustywind@0.16.0
- rustywind@0.21.0
entry: rustywind
args: [--write]
types_or: [html, jsx, tsx]

- repo: https://github.com/macisamuele/language-formatters-pre-commit-hooks
rev: v2.11.0
rev: v2.12.0
hooks:
- id: pretty-format-toml
args: [--autofix]

- repo: https://github.com/abravalheri/validate-pyproject
rev: v0.15
rev: v0.16
hooks:
- id: validate-pyproject
4 changes: 2 additions & 2 deletions examples/default/default/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from __future__ import annotations

__version__ = "2024-2-1"
__template_version__ = "2024.1"
__version__ = "2024.2.1"
__template_version__ = "2024.2"
20 changes: 16 additions & 4 deletions examples/default/default/core/views.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
from __future__ import annotations

from django.conf import settings
from pathlib import Path

from django.contrib.auth.decorators import login_required
from django.contrib.staticfiles import finders
from django.http import FileResponse
from django.http import HttpRequest
from django.http import HttpResponse
from django.http import HttpResponseNotFound
from django.shortcuts import redirect
from django.shortcuts import render
from django.utils import timezone
from django.views.decorators.cache import cache_control
Expand Down Expand Up @@ -45,10 +49,18 @@ def security_txt(request: HttpRequest) -> HttpResponse:

@require_GET
@cache_control(max_age=60 * 60 * 24, immutable=True, public=True) # one day
def favicon(request: HttpRequest) -> FileResponse:
def favicon(request: HttpRequest) -> HttpResponse | FileResponse:
name = request.path.lstrip("/")
file = (settings.BASE_DIR / "static" / "public" / name).open("rb")
return FileResponse(file)
path = finders.find(name)
if path:
file = Path(path).open("rb")
response = FileResponse(file)
else:
if name == "favicon.ico":
response = HttpResponseNotFound()
else:
response = redirect("favicon.ico")
return response


@require_GET
Expand Down
8 changes: 6 additions & 2 deletions examples/default/default/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
"email_relay.db.EmailDatabaseRouter",
]

DEFAULT_AUTO_FIELD = "django.db.models.BigAutoField"
DEFAULT_AUTO_FIELD = "django.db.models.AutoField"

DEFAULT_FROM_EMAIL = env(
"DEFAULT_FROM_EMAIL",
Expand All @@ -85,11 +85,15 @@
else "email_relay.backend.RelayDatabaseEmailBackend"
)

FORM_RENDERER = "django.forms.renderers.TemplatesSetting"

INSTALLED_APPS = [
# First Party
"default.core",
"default.users",
# Second Party
"django_q_registry",
"django_simple_nav",
"django_twc_ui",
"django_twc_ui.forms",
"email_relay",
Expand Down Expand Up @@ -332,7 +336,7 @@

ACCOUNT_USERNAME_REQUIRED = False

LOGIN_REDIRECT_URL = "dashboard"
LOGIN_REDIRECT_URL = "index"

SOCIALACCOUNT_PROVIDERS = {
"okta": {
Expand Down
2 changes: 1 addition & 1 deletion examples/default/default/users/migrations/0001_initial.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class Migration(migrations.Migration):
fields=[
(
"id",
models.BigAutoField(
models.AutoField(
auto_created=True,
primary_key=True,
serialize=False,
Expand Down
Empty file.
33 changes: 30 additions & 3 deletions examples/default/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,38 @@
[tool.bumpver]
commit = true
commit_message = ":bookmark: bump version {old_version} -> {new_version}"
current_version = "2024-2-1"
current_version = "2024.2.1"
push = false # set to false for CI
tag = true
tag = false
version_pattern = "YYYY.MM.INC1"

[tool.bumpver.file_patterns]
"default/__init__.py" = [
'__version__ = "{version}"'
]
"tests/test_version.py" = [
'assert __version__ == "{version}"'
]

[tool.coverage.run]
omit = [
"*/node_modules/*",
"default/*/migrations/*",
"default/asgi.py",
"default/wsgi.py",
"templates/*",
"tests/*",
"manage.py",
"requirements.txt"
]
plugins = ["django_coverage_plugin"]
source = ["default"]

[tool.django-stubs]
django_settings_module = "default.settings"

[tool.djlint]
ignore = "H031" # Don't require `meta` tag keywords
indent = 2

[tool.mypy]
Expand All @@ -41,6 +59,8 @@ module = [
ignore_missing_imports = true
module = [
"allauth.*",
"boto3.*",
"botocore.*",
"debug_toolbar.*",
"django_filters.*",
"django_q.*",
Expand Down Expand Up @@ -88,7 +108,6 @@ ignore = ["E501", "E741"] # temporary
indent-width = 4
# Same as Black.
line-length = 88
per-file-ignores = {}
select = [
"B", # flake8-bugbear
"E", # Pycodestyle
Expand All @@ -111,3 +130,11 @@ quote-style = "double"
force-single-line = true
known-first-party = ["default"]
required-imports = ["from __future__ import annotations"]

[tool.ruff.per-file-ignores]
# Tests can use magic values, assertions, and relative imports
"tests/**/*" = ["PLR2004", "S101", "TID252"]

[tool.ruff.pyupgrade]
# Preserve types, even if a file imports `from __future__ import annotations`.
keep-runtime-typing = true
3 changes: 3 additions & 0 deletions examples/default/requirements.in
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ django-flyio
django-health-check
django-htmx
django-q2
django-q-registry
django-simple-history
django-simple-nav
django-storages
django-stubs
django-tailwind-cli
django-template-partials
django-twc-toolbox
environs[django]
gunicorn
heroicons
Expand Down
14 changes: 6 additions & 8 deletions examples/default/templates/404.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{% extends "base.html" %}

{% block content %}
<h1>404</h1>

<p>Oops! The page you're looking for can't be found.</p>

<p>It looks like the page you were trying to reach doesn't exist or has been moved. Don't worry, this happens to the best of us.</p>

<p>
It looks like the page you were trying to reach doesn't exist or has been moved. Don't worry, this happens to the best of us.
</p>
<p>Here are some helpful links to get you back on track:</p>

<ul>
<li>Homepage: [Your Website URL]</li>
<li>About Us: [Your Website URL]/about-us</li>
<li>Contact Us: [Your Website URL]/contact-us</li>
</ul>

<p>If you still can't find what you're looking for, feel free to reach out to us at [Your Support Email]. We're always here to help.</p>
<p>
If you still can't find what you're looking for, feel free to reach out to us at [Your Support Email]. We're always here to help.
</p>
{% endblock content %}
14 changes: 6 additions & 8 deletions examples/default/templates/500.html
Original file line number Diff line number Diff line change
@@ -1,19 +1,17 @@
{% extends "base.html" %}

{% block content %}
<h1>500</h1>

<p>Uh oh! Something went wrong on our end.</p>

<p>We're sorry, but there seems to have been an error while processing your request. Our team has been notified and is working to resolve the issue as quickly as possible.</p>

<p>
We're sorry, but there seems to have been an error while processing your request. Our team has been notified and is working to resolve the issue as quickly as possible.
</p>
<p>In the meantime, please try one of the following options:</p>

<ul>
<li>Refresh the page: Simply clicking the refresh button in your browser may resolve the issue.</li>
<li>Try again later: The issue may be temporary, so please try again later.</li>
<li>Contact us: If the problem persists, please contact us at [Your Support Email]. Our team will be more than happy to assist you.</li>
<li>
Contact us: If the problem persists, please contact us at [Your Support Email]. Our team will be more than happy to assist you.
</li>
</ul>

<p>We apologize for the inconvenience and appreciate your patience as we work to resolve this issue.</p>
{% endblock content %}
Loading

0 comments on commit 5507b9c

Please sign in to comment.