mirror of
https://github.com/cookiecutter/cookiecutter-django.git
synced 2025-09-20 10:52:34 +03:00
Merge 9e8761c267
into aaec141b7e
This commit is contained in:
commit
b979c62fb0
2
.github/workflows/ci.yml
vendored
2
.github/workflows/ci.yml
vendored
|
@ -96,7 +96,7 @@ jobs:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v6
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.13"
|
||||||
- name: Install uv
|
- name: Install uv
|
||||||
uses: astral-sh/setup-uv@v6
|
uses: astral-sh/setup-uv@v6
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
|
|
2
.github/workflows/pre-commit-autoupdate.yml
vendored
2
.github/workflows/pre-commit-autoupdate.yml
vendored
|
@ -24,7 +24,7 @@ jobs:
|
||||||
- uses: actions/checkout@v5
|
- uses: actions/checkout@v5
|
||||||
- uses: actions/setup-python@v6
|
- uses: actions/setup-python@v6
|
||||||
with:
|
with:
|
||||||
python-version: "3.12"
|
python-version: "3.13"
|
||||||
|
|
||||||
- name: Install pre-commit
|
- name: Install pre-commit
|
||||||
run: pip install pre-commit
|
run: pip install pre-commit
|
||||||
|
|
|
@ -3,7 +3,7 @@ default_stages: [pre-commit]
|
||||||
minimum_pre_commit_version: "3.2.0"
|
minimum_pre_commit_version: "3.2.0"
|
||||||
|
|
||||||
default_language_version:
|
default_language_version:
|
||||||
python: python3.12
|
python: python3.13
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
|
|
@ -8,7 +8,7 @@ version: 2
|
||||||
build:
|
build:
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
tools:
|
tools:
|
||||||
python: "3.12"
|
python: "3.13"
|
||||||
commands:
|
commands:
|
||||||
- asdf plugin add uv
|
- asdf plugin add uv
|
||||||
- asdf install uv latest
|
- asdf install uv latest
|
||||||
|
|
|
@ -18,7 +18,7 @@ This last step is very important, don't start developing from main, it'll cause
|
||||||
|
|
||||||
## Testing
|
## Testing
|
||||||
|
|
||||||
You'll need to run the tests using Python 3.12. We recommend using [tox](https://tox.readthedocs.io/en/latest/) to run the tests. It will automatically create a fresh virtual environment and install our test dependencies, such as [pytest-cookies](https://pypi.python.org/pypi/pytest-cookies/) and [flake8](https://pypi.python.org/pypi/flake8/).
|
You'll need to run the tests using Python 3.13. We recommend using [tox](https://tox.readthedocs.io/en/latest/) to run the tests. It will automatically create a fresh virtual environment and install our test dependencies, such as [pytest-cookies](https://pypi.python.org/pypi/pytest-cookies/) and [flake8](https://pypi.python.org/pypi/flake8/).
|
||||||
|
|
||||||
We'll also run the tests on GitHub actions when you send your pull request, but it's a good idea to run them locally before you send it.
|
We'll also run the tests on GitHub actions when you send your pull request, but it's a good idea to run them locally before you send it.
|
||||||
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ production-ready Django projects quickly.
|
||||||
## Features
|
## Features
|
||||||
|
|
||||||
- For Django 5.2
|
- For Django 5.2
|
||||||
- Works with Python 3.12
|
- Works with Python 3.13
|
||||||
- Renders Django projects with 100% starting test coverage
|
- Renders Django projects with 100% starting test coverage
|
||||||
- Twitter [Bootstrap](https://github.com/twbs/bootstrap) v5
|
- Twitter [Bootstrap](https://github.com/twbs/bootstrap) v5
|
||||||
- [12-Factor](https://12factor.net) based settings via [django-environ](https://github.com/joke2k/django-environ)
|
- [12-Factor](https://12factor.net) based settings via [django-environ](https://github.com/joke2k/django-environ)
|
||||||
|
|
|
@ -110,7 +110,7 @@ We recommend to signup to a separate service offering hosted Redis (e.g. `Redisl
|
||||||
Configure the PythonAnywhere Web Tab
|
Configure the PythonAnywhere Web Tab
|
||||||
------------------------------------
|
------------------------------------
|
||||||
|
|
||||||
Go to the PythonAnywhere **Web tab**, hit **Add new web app**, and choose **Manual Config**, and then the Pthon 3.12.
|
Go to the PythonAnywhere **Web tab**, hit **Add new web app**, and choose **Manual Config**, and then the Python 3.13.
|
||||||
|
|
||||||
.. note:: If you're using a custom domain (not on \*.pythonanywhere.com), then you'll need to set up a CNAME with your domain registrar.
|
.. note:: If you're using a custom domain (not on \*.pythonanywhere.com), then you'll need to set up a CNAME with your domain registrar.
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@ license = { text = "BSD" }
|
||||||
authors = [
|
authors = [
|
||||||
{ name = "Daniel Roy Greenfeld", email = "pydanny@gmail.com" },
|
{ name = "Daniel Roy Greenfeld", email = "pydanny@gmail.com" },
|
||||||
]
|
]
|
||||||
requires-python = ">=3.12,<3.13"
|
requires-python = "==3.13.*"
|
||||||
classifiers = [
|
classifiers = [
|
||||||
"Development Status :: 4 - Beta",
|
"Development Status :: 4 - Beta",
|
||||||
"Environment :: Console",
|
"Environment :: Console",
|
||||||
|
@ -24,7 +24,7 @@ classifiers = [
|
||||||
"Natural Language :: English",
|
"Natural Language :: English",
|
||||||
"Programming Language :: Python",
|
"Programming Language :: Python",
|
||||||
"Programming Language :: Python :: 3 :: Only",
|
"Programming Language :: Python :: 3 :: Only",
|
||||||
"Programming Language :: Python :: 3.12",
|
"Programming Language :: Python :: 3.13",
|
||||||
"Programming Language :: Python :: Implementation :: CPython",
|
"Programming Language :: Python :: Implementation :: CPython",
|
||||||
"Topic :: Software Development",
|
"Topic :: Software Development",
|
||||||
]
|
]
|
||||||
|
|
2
tox.ini
2
tox.ini
|
@ -1,6 +1,6 @@
|
||||||
[tox]
|
[tox]
|
||||||
skipsdist = true
|
skipsdist = true
|
||||||
envlist = py312
|
envlist = py313
|
||||||
|
|
||||||
[testenv]
|
[testenv]
|
||||||
passenv = AUTOFIXABLE_STYLES
|
passenv = AUTOFIXABLE_STYLES
|
||||||
|
|
|
@ -13,7 +13,7 @@ environment:
|
||||||
steps:
|
steps:
|
||||||
- name: lint
|
- name: lint
|
||||||
pull: if-not-exists
|
pull: if-not-exists
|
||||||
image: ghcr.io/astral-sh/uv:python3.12
|
image: ghcr.io/astral-sh/uv:python3.13
|
||||||
environment:
|
environment:
|
||||||
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
|
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
|
||||||
volumes:
|
volumes:
|
||||||
|
@ -37,7 +37,7 @@ steps:
|
||||||
- docker-compose -f docker-compose.local.yml up -d
|
- docker-compose -f docker-compose.local.yml up -d
|
||||||
- docker-compose -f docker-compose.local.yml run django pytest
|
- docker-compose -f docker-compose.local.yml run django pytest
|
||||||
{%- else %}
|
{%- else %}
|
||||||
image: ghcr.io/astral-sh/uv:python3.12
|
image: ghcr.io/astral-sh/uv:python3.13
|
||||||
commands:
|
commands:
|
||||||
- uv sync --locked
|
- uv sync --locked
|
||||||
- uv run pytest
|
- uv run pytest
|
||||||
|
|
|
@ -13,7 +13,7 @@ variables:
|
||||||
|
|
||||||
precommit:
|
precommit:
|
||||||
stage: lint
|
stage: lint
|
||||||
image: ghcr.io/astral-sh/uv:python3.12
|
image: ghcr.io/astral-sh/uv:python3.13
|
||||||
variables:
|
variables:
|
||||||
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
|
PRE_COMMIT_HOME: ${CI_PROJECT_DIR}/.cache/pre-commit
|
||||||
cache:
|
cache:
|
||||||
|
@ -39,7 +39,7 @@ pytest:
|
||||||
script:
|
script:
|
||||||
- docker compose -f docker-compose.local.yml run django pytest
|
- docker compose -f docker-compose.local.yml run django pytest
|
||||||
{%- else %}
|
{%- else %}
|
||||||
image: ghcr.io/astral-sh/uv:python3.12
|
image: ghcr.io/astral-sh/uv:python3.13
|
||||||
services:
|
services:
|
||||||
- postgres:{{ cookiecutter.postgresql_version }}
|
- postgres:{{ cookiecutter.postgresql_version }}
|
||||||
variables:
|
variables:
|
||||||
|
|
|
@ -3,7 +3,7 @@ default_stages: [pre-commit]
|
||||||
minimum_pre_commit_version: "3.2.0"
|
minimum_pre_commit_version: "3.2.0"
|
||||||
|
|
||||||
default_language_version:
|
default_language_version:
|
||||||
python: python3.12
|
python: python3.13
|
||||||
|
|
||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
3.12
|
3.13
|
||||||
|
|
|
@ -8,7 +8,7 @@ version: 2
|
||||||
build:
|
build:
|
||||||
os: ubuntu-22.04
|
os: ubuntu-22.04
|
||||||
tools:
|
tools:
|
||||||
python: '3.12'
|
python: '3.13'
|
||||||
|
|
||||||
# Build documentation in the docs/ directory with Sphinx
|
# Build documentation in the docs/ directory with Sphinx
|
||||||
sphinx:
|
sphinx:
|
||||||
|
|
|
@ -2,7 +2,7 @@ dist: focal
|
||||||
|
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- "3.12"
|
- "3.13"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
- {% if cookiecutter.use_docker == 'y' %}docker{% else %}postgresql{% endif %}
|
- {% if cookiecutter.use_docker == 'y' %}docker{% else %}postgresql{% endif %}
|
||||||
|
@ -38,7 +38,7 @@ jobs:
|
||||||
- sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm
|
- sudo apt-get install -qq libsqlite3-dev libxml2 libxml2-dev libssl-dev libbz2-dev wget curl llvm
|
||||||
language: python
|
language: python
|
||||||
python:
|
python:
|
||||||
- "3.12"
|
- "3.13"
|
||||||
install:
|
install:
|
||||||
- pip install uv
|
- pip install uv
|
||||||
- uv sync
|
- uv sync
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# define an alias for the specific python version used in this file.
|
# define an alias for the specific python version used in this file.
|
||||||
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS python
|
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS python
|
||||||
|
|
||||||
# Python build stage
|
# Python build stage
|
||||||
FROM python AS python-build-stage
|
FROM python AS python-build-stage
|
||||||
|
@ -44,7 +44,7 @@ RUN groupadd --gid 1000 dev-user \
|
||||||
&& chmod 0440 /etc/sudoers.d/dev-user
|
&& chmod 0440 /etc/sudoers.d/dev-user
|
||||||
|
|
||||||
ENV PATH="/${APP_HOME}/.venv/bin:$PATH"
|
ENV PATH="/${APP_HOME}/.venv/bin:$PATH"
|
||||||
ENV PYTHONPATH="${APP_HOME}/.venv/lib/python3.12/site-packages:$PYTHONPATH"
|
ENV PYTHONPATH="${APP_HOME}/.venv/lib/python3.13/site-packages:$PYTHONPATH"
|
||||||
|
|
||||||
COPY ./compose/production/django/entrypoint /entrypoint
|
COPY ./compose/production/django/entrypoint /entrypoint
|
||||||
RUN sed -i 's/\r$//g' /entrypoint
|
RUN sed -i 's/\r$//g' /entrypoint
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
# define an alias for the specific python version used in this file.
|
# define an alias for the specific python version used in this file.
|
||||||
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS python
|
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS python
|
||||||
|
|
||||||
|
|
||||||
# Python build stage
|
# Python build stage
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS python
|
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS python
|
||||||
|
|
||||||
ARG APP_HOME=/app
|
ARG APP_HOME=/app
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@ ENV DJANGO_AZURE_ACCOUNT_NAME=${DJANGO_AZURE_ACCOUNT_NAME}
|
||||||
RUN npm run build
|
RUN npm run build
|
||||||
{%- endif %}
|
{%- endif %}
|
||||||
# define an alias for the specific python version used in this file.
|
# define an alias for the specific python version used in this file.
|
||||||
FROM ghcr.io/astral-sh/uv:python3.12-bookworm-slim AS python-build-stage
|
FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim AS python-build-stage
|
||||||
|
|
||||||
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy UV_PYTHON_DOWNLOADS=0
|
ENV UV_COMPILE_BYTECODE=1 UV_LINK_MODE=copy UV_PYTHON_DOWNLOADS=0
|
||||||
|
|
||||||
|
@ -57,7 +57,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
|
||||||
uv sync --locked --no-dev
|
uv sync --locked --no-dev
|
||||||
|
|
||||||
# Python 'run' stage
|
# Python 'run' stage
|
||||||
FROM python:3.12-slim-bookworm AS python-run-stage
|
FROM python:3.13-slim-bookworm AS python-run-stage
|
||||||
|
|
||||||
ARG APP_HOME=/app
|
ARG APP_HOME=/app
|
||||||
|
|
||||||
|
|
|
@ -65,7 +65,7 @@ MIDDLEWARE += ["debug_toolbar.middleware.DebugToolbarMiddleware"]
|
||||||
DEBUG_TOOLBAR_CONFIG = {
|
DEBUG_TOOLBAR_CONFIG = {
|
||||||
"DISABLE_PANELS": [
|
"DISABLE_PANELS": [
|
||||||
"debug_toolbar.panels.redirects.RedirectsPanel",
|
"debug_toolbar.panels.redirects.RedirectsPanel",
|
||||||
# Disable profiling panel due to an issue with Python 3.12:
|
# Disable profiling panel due to an issue with Python 3.12+:
|
||||||
# https://github.com/jazzband/django-debug-toolbar/issues/1875
|
# https://github.com/jazzband/django-debug-toolbar/issues/1875
|
||||||
"debug_toolbar.panels.profiling.ProfilingPanel",
|
"debug_toolbar.panels.profiling.ProfilingPanel",
|
||||||
],
|
],
|
||||||
|
|
|
@ -18,7 +18,7 @@ plugins = ["django_coverage_plugin"]
|
||||||
|
|
||||||
# ==== mypy ====
|
# ==== mypy ====
|
||||||
[tool.mypy]
|
[tool.mypy]
|
||||||
python_version = "3.12"
|
python_version = "3.13"
|
||||||
check_untyped_defs = true
|
check_untyped_defs = true
|
||||||
ignore_missing_imports = true
|
ignore_missing_imports = true
|
||||||
warn_unused_ignores = true
|
warn_unused_ignores = true
|
||||||
|
@ -59,7 +59,6 @@ indent_size = 2
|
||||||
indent_size = 2
|
indent_size = 2
|
||||||
|
|
||||||
[tool.ruff]
|
[tool.ruff]
|
||||||
target-version = "py312"
|
|
||||||
# Exclude a variety of commonly ignored directories.
|
# Exclude a variety of commonly ignored directories.
|
||||||
extend-exclude = [
|
extend-exclude = [
|
||||||
"*/migrations/*.py",
|
"*/migrations/*.py",
|
||||||
|
@ -148,5 +147,5 @@ license = { text = "{{ cookiecutter.open_source_license }}" }
|
||||||
authors = [
|
authors = [
|
||||||
{ name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.email }}" },
|
{ name = "{{ cookiecutter.author_name }}", email = "{{ cookiecutter.email }}" },
|
||||||
]
|
]
|
||||||
requires-python = "==3.12.*"
|
requires-python = "==3.13.*"
|
||||||
dependencies = []
|
dependencies = []
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
version = 1
|
version = 1
|
||||||
requires-python = "==3.12.*"
|
requires-python = "==3.13.*"
|
||||||
|
|
Loading…
Reference in New Issue
Block a user