Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout Benchmark Repo
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
repository: django/django-asv
path: "."
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Install Requirements
run: pip install -r requirements.txt
- name: Cache Django
uses: actions/cache@v3
uses: actions/cache@v4
with:
path: Django/*
key: Django
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/check_commit_messages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
if: startsWith(github.event.pull_request.base.ref, 'stable/')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: Calculate commit prefix
id: vars
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ jobs:
name: spelling
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
cache: 'pip'
Expand All @@ -43,9 +43,9 @@ jobs:
name: blacken-docs
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: python -m pip install blacken-docs
Expand All @@ -64,9 +64,9 @@ jobs:
name: lint-docs
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: python -m pip install sphinx-lint
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ jobs:
name: "Flag if no Trac ticket is found in the title"
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5

- name: "Check title and manage labels"
uses: actions/github-script@v7
uses: actions/github-script@v8
with:
script: |
const title = context.payload.pull_request.title;
Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/linters.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: python -m pip install flake8
Expand All @@ -40,9 +40,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
- run: python -m pip install "isort<6"
Expand All @@ -57,6 +57,6 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: black
uses: psf/black@stable
2 changes: 1 addition & 1 deletion .github/workflows/new_contributor_pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Hello new contributor
runs-on: ubuntu-latest
steps:
- uses: actions/first-interaction@v1
- uses: actions/first-interaction@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/postgis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ jobs:
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
cache: 'pip'
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/python_matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
python_versions_output: ${{ steps.set-matrix.outputs.python_versions }}
steps:
- name: Checkout code
uses: actions/checkout@v4
uses: actions/checkout@v5
- id: set-matrix
run: |
python_versions=$(sed -n "s/^.*Programming Language :: Python :: \([[:digit:]]\+\.[[:digit:]]\+\).*$/'\1', /p" pyproject.toml | tr -d '\n' | sed 's/, $//g')
Expand All @@ -36,9 +36,9 @@ jobs:
python-version: ${{ fromJson(needs.define-matrix.outputs.python_versions_output) }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand Down
24 changes: 12 additions & 12 deletions .github/workflows/schedule_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ jobs:
continue-on-error: true
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand All @@ -41,9 +41,9 @@ jobs:
name: Byte-compiled Django with no source files (only .pyc files)
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
cache: 'pip'
Expand All @@ -67,9 +67,9 @@ jobs:
name: JavaScript tests
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: '20'
cache: 'npm'
Expand All @@ -82,9 +82,9 @@ jobs:
name: Selenium tests, SQLite
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
cache: 'pip'
Expand Down Expand Up @@ -118,9 +118,9 @@ jobs:
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
cache: 'pip'
Expand Down Expand Up @@ -163,9 +163,9 @@ jobs:
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
cache: 'pip'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/schedules.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
branch:
- main
steps:
- uses: actions/github-script@v7
- uses: actions/github-script@v8
with:
github-token: ${{secrets.SCHEDULE_WORKFLOW_TOKEN}}
script: |
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/screenshots.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
name: Screenshots
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
cache: 'pip'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/selenium.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@ jobs:
name: SQLite
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
cache: 'pip'
Expand Down Expand Up @@ -57,9 +57,9 @@ jobs:
--health-retries 5
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.13'
cache: 'pip'
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,9 @@ jobs:
name: Windows, SQLite, Python ${{ matrix.python-version }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
Expand All @@ -45,9 +45,9 @@ jobs:
name: JavaScript tests
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5
- name: Set up Node.js
uses: actions/setup-node@v4
uses: actions/setup-node@v5
with:
node-version: '20'
cache: 'npm'
Expand Down
5 changes: 2 additions & 3 deletions django/template/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,13 +52,12 @@

import inspect
import logging
import os
import re
import warnings
from enum import Enum

import django
from django.template.context import BaseContext
from django.utils.deprecation import django_file_prefixes
from django.utils.formats import localize
from django.utils.html import conditional_escape
from django.utils.regex_helper import _lazy_re_compile
Expand Down Expand Up @@ -329,7 +328,7 @@ def source(self):
"PartialTemplate.source is only available when template "
"debugging is enabled.",
RuntimeWarning,
skip_file_prefixes=(os.path.dirname(django.__file__),),
skip_file_prefixes=django_file_prefixes(),
)
return self.find_partial_source(template.source)

Expand Down
11 changes: 10 additions & 1 deletion django/utils/deprecation.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,15 @@
import django


@functools.cache
def django_file_prefixes():
try:
file = django.__file__
except AttributeError:
return ()
return (os.path.dirname(file),)


class RemovedInDjango61Warning(DeprecationWarning):
pass

Expand Down Expand Up @@ -237,7 +246,7 @@ def remap_deprecated_args(args, kwargs):
f"Passing positional argument(s) {remapped_names_str} to {func_name}() "
"is deprecated. Use keyword arguments instead.",
deprecation_warning,
skip_file_prefixes=(os.path.dirname(django.__file__),),
skip_file_prefixes=django_file_prefixes(),
)

return remaining_args, updated_kwargs
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -282,7 +282,7 @@ previous behavior, or standalone items that are unnecessary or unused when the
deprecation ends. For example::

import warnings
from django.utils.deprecation import RemovedInDjangoXXWarning
from django.utils.deprecation import RemovedInDjangoXXWarning, django_file_prefixes


# RemovedInDjangoXXWarning.
Expand All @@ -295,7 +295,7 @@ deprecation ends. For example::
warnings.warn(
"foo() is deprecated.",
category=RemovedInDjangoXXWarning,
stacklevel=2,
stacklevel=django_file_prefixes(),
)
old_private_helper()
...
Expand Down
2 changes: 1 addition & 1 deletion docs/ref/contrib/auth.txt
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ Methods

Sends an email to the user. If ``from_email`` is ``None``, Django uses
the :setting:`DEFAULT_FROM_EMAIL`. Any ``**kwargs`` are passed to the
underlying :meth:`~django.core.mail.send_mail` call.
underlying :func:`~django.core.mail.send_mail` call.

Manager methods
---------------
Expand Down
4 changes: 2 additions & 2 deletions docs/ref/django-admin.txt
Original file line number Diff line number Diff line change
Expand Up @@ -1052,12 +1052,12 @@ together:
.. django-admin-option:: --managers

Mails the email addresses specified in :setting:`MANAGERS` using
:meth:`~django.core.mail.mail_managers`.
:func:`~django.core.mail.mail_managers`.

.. django-admin-option:: --admins

Mails the email addresses specified in :setting:`ADMINS` using
:meth:`~django.core.mail.mail_admins`.
:func:`~django.core.mail.mail_admins`.

``shell``
---------
Expand Down
2 changes: 1 addition & 1 deletion docs/ref/settings.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2656,7 +2656,7 @@ protocol.
.. admonition:: Why are my emails sent from a different address?

This address is used only for error messages. It is *not* the address that
regular email messages sent with :meth:`~django.core.mail.send_mail`
regular email messages sent with :func:`~django.core.mail.send_mail`
come from; for that, see :setting:`DEFAULT_FROM_EMAIL`.

.. setting:: SHORT_DATE_FORMAT
Expand Down
Loading
Loading