Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: evansd/whitenoise
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 6.6.0
Choose a base ref
...
head repository: evansd/whitenoise
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 6.7.0
Choose a head ref
Loading
4 changes: 4 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -2,5 +2,9 @@ version: 2
updates:
- package-ecosystem: github-actions
directory: "/"
groups:
"GitHub Actions":
patterns:
- "*"
schedule:
interval: weekly
22 changes: 13 additions & 9 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -30,7 +30,7 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
@@ -47,10 +47,10 @@ jobs:

- name: Upload coverage data
if: matrix.os != 'windows-2022'
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: coverage-data
path: '.coverage.*'
name: coverage-data-${{ matrix.python-version }}
path: '${{ github.workspace }}/.coverage.*'

coverage:
name: Coverage
@@ -59,27 +59,31 @@ jobs:
steps:
- uses: actions/checkout@v4

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: '3.11'
python-version: '3.12'

- name: Install dependencies
run: python -m pip install --upgrade coverage[toml]

- name: Download data
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: coverage-data
path: ${{ github.workspace }}
pattern: coverage-data-*
merge-multiple: true

- name: Combine coverage and fail if it's <100%
run: |
python -m coverage combine
python -m coverage html --skip-covered --skip-empty
python -m coverage report --fail-under=95
echo "## Coverage summary" >> $GITHUB_STEP_SUMMARY
python -m coverage report --format=markdown >> $GITHUB_STEP_SUMMARY
- name: Upload HTML report
if: ${{ failure() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: html-report
path: htmlcov
41 changes: 14 additions & 27 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
default_language_version:
python: python3.11
python: python3.12

repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
- id: check-added-large-files
- id: check-case-conflict
@@ -14,17 +14,9 @@ repos:
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: https://github.com/tox-dev/pyproject-fmt
rev: 1.2.0
rev: 2.1.3
hooks:
- id: pyproject-fmt
- repo: https://github.com/asottile/setup-cfg-fmt
rev: v2.5.0
hooks:
- id: setup-cfg-fmt
args:
- --include-version-classifiers
- --max-py-version
- '3.12'
- repo: https://github.com/tox-dev/tox-ini-fmt
rev: 1.3.1
hooks:
@@ -37,21 +29,21 @@ repos:
- sphinx==6.1.3
- tomli==2.0.1
- repo: https://github.com/sphinx-contrib/sphinx-lint
rev: v0.6.8
rev: v0.9.1
hooks:
- id: sphinx-lint
- repo: https://github.com/asottile/pyupgrade
rev: v3.15.0
rev: v3.16.0
hooks:
- id: pyupgrade
args: [--py38-plus]
- repo: https://github.com/adamchainz/django-upgrade
rev: 1.15.0
rev: 1.18.0
hooks:
- id: django-upgrade
args: [--target-version, '3.2']
- repo: https://github.com/psf/black
rev: 23.9.1
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.4.2
hooks:
- id: black
- repo: https://github.com/adamchainz/blacken-docs
@@ -60,22 +52,17 @@ repos:
- id: blacken-docs
additional_dependencies:
- black==23.1.0
- repo: https://github.com/asottile/reorder-python-imports
rev: v3.12.0
- repo: https://github.com/pycqa/isort
rev: 5.13.2
hooks:
- id: reorder-python-imports
args:
- --py38-plus
- --application-directories
- .:example:src
- --add-import
- 'from __future__ import annotations'
- id: isort
name: isort (python)
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
rev: 7.1.0
hooks:
- id: flake8
additional_dependencies:
- flake8-bugbear
- flake8-comprehensions
- flake8-logging
- flake8-tidy-imports
- flake8-typing-imports
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -6,7 +6,7 @@ version: 2
build:
os: ubuntu-22.04
tools:
python: "3.11"
python: "3.12"

sphinx:
configuration: docs/conf.py
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ WhiteNoise
.. image:: https://img.shields.io/readthedocs/whitenoise?style=for-the-badge
:target: https://whitenoise.readthedocs.io/en/latest/

.. image:: https://img.shields.io/github/actions/workflow/status/evansd/whitenoise/main.yml?branch=master&style=for-the-badge
.. image:: https://img.shields.io/github/actions/workflow/status/evansd/whitenoise/main.yml.svg?branch=master&style=for-the-badge
:target: https://github.com/evansd/whitenoise/actions?workflow=CI

.. image:: https://img.shields.io/badge/Coverage-96%25-success?style=for-the-badge
8 changes: 8 additions & 0 deletions SECURITY.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Security contact information
============================


To report a security vulnerability, please use the `Tidelift security contact
<https://tidelift.com/security>`_.

Tidelift will coordinate the fix and disclosure.
5 changes: 5 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
@@ -2,6 +2,11 @@
Changelog
=========

6.7.0 (2024-06-19)
------------------

* Support Django 5.1.

6.6.0 (2023-10-11)
------------------

28 changes: 9 additions & 19 deletions docs/conf.py
Original file line number Diff line number Diff line change
@@ -1,21 +1,14 @@
from __future__ import annotations

import datetime
import os
import sys
import tomllib
from pathlib import Path

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
# -- Path setup --------------------------------------------------------------

# Get the project root dir, which is the parent dir of this
cwd = os.getcwd()
project_root = os.path.dirname(cwd)

# Insert the project root dir as the first element in the PYTHONPATH.
# This lets us ensure that the source package is imported, and that its
# version is used.
sys.path.insert(0, os.path.join(project_root, "src"))
here = Path(__file__).parent.resolve()
sys.path.insert(0, str(here / ".." / "src"))

# -- General configuration -----------------------------------------------------

@@ -50,13 +43,10 @@


def _get_version() -> str:
with open(os.path.join(project_root, "setup.cfg")) as setup_fp:
version_lines = [
line.strip() for line in setup_fp if line.startswith("version = ")
]

assert len(version_lines) == 1
return version_lines[0].split(" = ")[1]
with (here / ".." / "pyproject.toml").open("rb") as fp:
data = tomllib.load(fp)
version: str = data["project"]["version"]
return version


version = _get_version()
2 changes: 1 addition & 1 deletion docs/index.rst
Original file line number Diff line number Diff line change
@@ -31,7 +31,7 @@ WhiteNoise works with any WSGI-compatible application.

Python 3.8 to 3.12 supported.

Django 3.2 to 5.0 supported.
Django 3.2 to 5.1 supported.

Installation
------------
70 changes: 68 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -4,14 +4,80 @@ requires = [
"setuptools",
]

[tool.black]
target-version = ['py38']
[project]
name = "whitenoise"
version = "6.7.0"
description = "Radically simplified static file serving for WSGI applications"
readme = "README.rst"
keywords = [
"Django",
]
maintainers = [
{ name = "Adam Johnson", email = "me@adamj.eu" },
{ name = "David Evans" },
]
authors = [
{ name = "David Evans" },
]
requires-python = ">=3.8"
classifiers = [
"Development Status :: 5 - Production/Stable",
"Framework :: Django",
"Framework :: Django :: 3.2",
"Framework :: Django :: 4.0",
"Framework :: Django :: 4.1",
"Framework :: Django :: 4.2",
"Framework :: Django :: 5.0",
"Framework :: Django :: 5.1",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: Implementation :: CPython",
"Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware",
"Typing :: Typed",
]
optional-dependencies.brotli = [
"brotli",
]
urls.Changelog = "https://whitenoise.readthedocs.io/en/stable/changelog.html"
urls.Documentation = "https://whitenoise.readthedocs.io/"
urls.Repository = "https://github.com/evansd/whitenoise"

[tool.isort]
add_imports = [
"from __future__ import annotations",
]
force_single_line = true
profile = "black"

[tool.pytest.ini_options]
addopts = """\
--strict-config
--strict-markers
"""

[tool.coverage.run]
branch = true
parallel = true
source = [
"whitenoise",
"tests",
]

[tool.coverage.paths]
source = [
"src",
".tox/**/site-packages",
]

[tool.coverage.report]
show_missing = true

[tool.rstcheck]
report_level = "ERROR"
Loading